[PATCH 6/7] libfs: drop unneeded dentry_unhash

From: Sage Weil
Date: Wed Mar 30 2011 - 18:03:06 EST


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@xxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/