aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/dir-rmdir.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/libdiskfs/dir-rmdir.c b/libdiskfs/dir-rmdir.c
index 5dc6a854..31e20712 100644
--- a/libdiskfs/dir-rmdir.c
+++ b/libdiskfs/dir-rmdir.c
@@ -36,8 +36,6 @@ diskfs_S_dir_rmdir (struct protid *dircred,
if (diskfs_readonly)
return EROFS;
- retry:
-
mutex_lock (&dnp->lock);
error = diskfs_lookup (dnp, name, REMOVE, &np, ds, dircred);
@@ -59,40 +57,13 @@ diskfs_S_dir_rmdir (struct protid *dircred,
return EINVAL;
}
- mutex_lock (&np->translator.lock);
- if (np->translator.control != MACH_PORT_NULL)
+ if (np->istranslated || fshelp_translated (&np->transbox))
{
- mach_port_t control;
-
- /* There is a running active translator here. Give it a push.
- If it squeaks, then return an error. If it consents, then
- clear the active translator spec (unless it's been changed
- in the interim) and repeat the lookup above. */
-
- control = np->translator.control;
- mach_port_mod_refs (mach_task_self (), control, MACH_PORT_RIGHT_SEND, 1);
-
- mutex_unlock (&np->translator.lock);
diskfs_drop_dirstat (dnp, ds);
- mutex_unlock (&dnp->lock);
- mutex_unlock (&np->lock);
-
- error = fsys_goaway (control, FSYS_GOAWAY_UNLINK);
- if (error)
- return error;
-
- mutex_lock (&np->lock);
- mutex_lock (&np->translator.lock);
- if (np->translator.control == control)
- fshelp_translator_drop (&np->translator);
- mutex_unlock (&np->translator.lock);
diskfs_nput (np);
-
- mach_port_deallocate (mach_task_self (), control);
-
- goto retry;
+ mutex_unlock (&dnp->lock);
+ return EBUSY;
}
- mutex_unlock (&np->translator.lock);
/* Verify the directory is empty (and valid). (Rmdir ".." won't be
valid since ".." will contain a reference to the current directory and