Return-Path: linux-nfs-owner@vger.kernel.org Received: from fieldses.org ([174.143.236.118]:43933 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759440Ab2IEUzf (ORCPT ); Wed, 5 Sep 2012 16:55:35 -0400 From: "J. Bruce Fields" To: Al Viro Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, "J. Bruce Fields" Subject: [RFC PATCH 08/13] namei: minor vfs_unlink cleanup Date: Wed, 5 Sep 2012 16:55:18 -0400 Message-Id: <1346878524-10585-9-git-send-email-bfields@redhat.com> In-Reply-To: <1346878524-10585-1-git-send-email-bfields@redhat.com> References: <1346878524-10585-1-git-send-email-bfields@redhat.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: From: "J. Bruce Fields" We'll be using dentry->d_inode in one more place. Signed-off-by: J. Bruce Fields --- fs/namei.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 6156135..10d6622 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3307,6 +3307,7 @@ SYSCALL_DEFINE1(rmdir, const char __user *, pathname) int vfs_unlink(struct inode *dir, struct dentry *dentry) { + struct inode *target = dentry->d_inode; int error = may_delete(dir, dentry, 0); if (error) @@ -3315,7 +3316,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry) if (!dir->i_op->unlink) return -EPERM; - mutex_lock(&dentry->d_inode->i_mutex); + mutex_lock(&target->i_mutex); if (d_mountpoint(dentry)) error = -EBUSY; else { @@ -3326,11 +3327,11 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry) dont_mount(dentry); } } - mutex_unlock(&dentry->d_inode->i_mutex); + mutex_unlock(&target->i_mutex); /* We don't d_delete() NFS sillyrenamed files--they still exist. */ if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { - fsnotify_link_count(dentry->d_inode); + fsnotify_link_count(target); d_delete(dentry); } -- 1.7.9.5