From 84580754e26c9ad6da4ef608ada78b26c4485419 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 20 Jun 1995 00:42:01 +0000 Subject: (diskfs_S_dir_rmdir): Don't attempt anything for translated directories here; just return EBUSY. --- libdiskfs/dir-rmdir.c | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'libdiskfs/dir-rmdir.c') 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 -- cgit v1.2.3