mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sage Weil <sage@newdream.net>
To: viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mszeredi@suse.cz,
	Sage Weil <sage@newdream.net>
Subject: [PATCH 6/7] libfs: drop unneeded dentry_unhash
Date: Wed, 30 Mar 2011 15:09:27 -0700	[thread overview]
Message-ID: <1301522968-4382-7-git-send-email-sage@newdream.net> (raw)
In-Reply-To: <1301522968-4382-1-git-send-email-sage@newdream.net>

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@newdream.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


  parent reply	other threads:[~2011-03-30 22:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 22:09 [PATCH 0/7] Do not dentry_unhash() in VFS Sage Weil
2011-03-30 22:09 ` [PATCH 1/7] vfs: dentry_unhash immediately prior to rmdir Sage Weil
2011-03-30 22:09 ` [PATCH 2/7] vfs: remove dget() from dentry_unhash() Sage Weil
2011-03-30 22:09 ` [PATCH 3/7] vfs: push dentry_unhash on rmdir into file systems Sage Weil
2011-03-30 22:09 ` [PATCH 4/7] vfs: push dentry_unhash on rename_dir " Sage Weil
2011-03-31  3:09   ` Dave Chinner
2011-03-31  4:40     ` Sage Weil
2011-03-30 22:09 ` [PATCH 5/7] vfs: update dentry_unhash() comment Sage Weil
2011-03-30 22:09 ` Sage Weil [this message]
2011-03-30 22:09 ` [PATCH 7/7] vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301522968-4382-7-git-send-email-sage@newdream.net \
    --to=sage@newdream.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@suse.cz \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®