summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-06-19 21:00:14 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-06-19 21:00:14 +0000
commit4d6357246ffd3cf6aba7de0e7ff23ef3f84f3ce9 (patch)
tree8f3be0db03c5782823e375bfecc662329522327f /libdiskfs
parent421cc3aba9d83f4862b73f5a6c917e857bd994a3 (diff)
(diskfs_S_file_set_translator): Use new translator interface
throughout.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-set-trans.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index f7de8254..9f3379c8 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -60,35 +60,31 @@ diskfs_S_file_set_translator (struct protid *cred,
return EBUSY;
}
- mutex_unlock (&np->lock);
- mutex_lock (&np->translator.lock);
-
if ((active_flags & FS_TRANS_SET)
&& (active_flags & FS_TRANS_EXCL)
- && np->translator.control != MACH_PORT_NULL)
+ && np->transbox.active != MACH_PORT_NULL)
{
- mutex_unlock (&np->translator.lock);
+ mutex_unlock (&np->lock);
return EBUSY;
}
if (active_flags & FS_TRANS_SET)
{
- if (np->translator.control != MACH_PORT_NULL
- && np->translator.control != active)
- diskfs_destroy_translator (np, killtrans_flags);
-
- if (active != MACH_PORT_NULL)
+ if (active != np->transbox.active
+ && np->transbox.active != MACH_PORT_NULL)
{
- if (active == np->translator.control)
- mach_port_deallocate (mach_task_self (), active);
- else
- fshelp_set_control (&np->translator, active);
+ mach_port_t control;
+
+ control = fshelp_get_active (&np->transbox);
+ mutex_unlock (&np->lock);
+ error = fsys_goaway (control, killtrans_flags);
+ if (error)
+ return error;
+ mutex_lock (&np->lock);
}
+ fshelp_set_active (&np->transbox, active);
}
-
- mutex_unlock (&np->translator.lock);
- mutex_lock (&np->lock);
-
+
/* Set passive translator */
if (passive_flags & FS_TRANS_SET)
{