[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1301522968-4382-7-git-send-email-sage@newdream.net>
Date: Wed, 30 Mar 2011 15:09:27 -0700
From: Sage Weil <sage@...dream.net>
To: viro@...IV.linux.org.uk, linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, mszeredi@...e.cz,
Sage Weil <sage@...dream.net>
Subject: [PATCH 6/7] libfs: drop unneeded dentry_unhash
There are no libfs issues with dangling references to empty directories.
Replace dentry_unhash() calls with shrink_dcache_parent().
Signed-off-by: Sage Weil <sage@...dream.net>
---
fs/libfs.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/libfs.c b/fs/libfs.c
index 91a3710..65aa858 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -311,8 +311,7 @@ int simple_rmdir(struct inode *dir, struct dentry *dentry)
if (!simple_empty(dentry))
return -ENOTEMPTY;
- dentry_unhash(dentry);
-
+ shrink_dcache_parent(dentry);
drop_nlink(dentry->d_inode);
simple_unlink(dir, dentry);
drop_nlink(dir);
@@ -325,8 +324,8 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *inode = old_dentry->d_inode;
int they_are_dirs = S_ISDIR(old_dentry->d_inode->i_mode);
- if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode))
- dentry_unhash(new_dentry);
+ if (new_dentry->d_inode && they_are_dirs)
+ shrink_dcache_parent(new_dentry);
if (!simple_empty(new_dentry))
return -ENOTEMPTY;
--
1.7.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists