patch-2.1.131 linux/fs/nfs/dir.c

Next file: linux/fs/nfs/file.c
Previous file: linux/fs/ncpfs/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.130/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
@@ -721,7 +721,7 @@
  */
 static int nfs_rmdir(struct inode *dir, struct dentry *dentry)
 {
-	int error, rehash = 0;
+	int error;
 
 	dfprintk(VFS, "NFS: rmdir(%x/%ld, %s\n",
 		dir->i_dev, dir->i_ino, dentry->d_name.name);
@@ -731,39 +731,24 @@
 		goto out;
 
 	error = -EBUSY;
-	if (dentry->d_count > 1) {
-		/* Attempt to shrink child dentries ... */
-		shrink_dcache_parent(dentry);
-		if (dentry->d_count > 1)
-			goto out;
-	}
+	if (!list_empty(&dentry->d_hash))
+		goto out;
+
 #ifdef NFS_PARANOIA
 if (dentry->d_inode->i_count > 1)
 printk("nfs_rmdir: %s/%s inode busy?? i_count=%d, i_nlink=%d\n",
 dentry->d_parent->d_name.name, dentry->d_name.name,
 dentry->d_inode->i_count, dentry->d_inode->i_nlink);
 #endif
-	/*
-	 * Unhash the dentry while we remove the directory.
-	 */
-	if (!list_empty(&dentry->d_hash)) {
-		d_drop(dentry);
-		rehash = 1;
-	}
+
 	/*
 	 * Update i_nlink and free the inode before unlinking.
 	 */
 	if (dentry->d_inode->i_nlink)
 		dentry->d_inode->i_nlink --;
-	d_delete(dentry);
 	nfs_invalidate_dircache(dir);
 	error = nfs_proc_rmdir(NFS_SERVER(dir), NFS_FH(dentry->d_parent),
 				dentry->d_name.name);
-	if (!error) {
-		if (rehash)
-			d_add(dentry, NULL);
-		nfs_renew_times(dentry);
-	}
 out:
 	return error;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov