From: Rui Xiang <rui.xiang@huawei.com>
To: Ian Kent <raven@themaw.net>
Cc: <autofs@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Rui Xiang <rui.xiang@huawei.com>
Subject: [PATCH 2/2] autofs: use IS_ROOT to replace parent == dentry->d_parent
Date: Fri, 30 Aug 2013 15:22:18 +0800 [thread overview]
Message-ID: <1377847338-51032-2-git-send-email-rui.xiang@huawei.com> (raw)
In-Reply-To: <1377847338-51032-1-git-send-email-rui.xiang@huawei.com>
Use the helper macro !IS_ROOT to replace parent != dentry->d_parent.
Just clean up.
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
---
fs/autofs4/root.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 92ef341..2caf36a 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -558,7 +558,7 @@ static int autofs4_dir_symlink(struct inode *dir,
dget(dentry);
atomic_inc(&ino->count);
p_ino = autofs4_dentry_ino(dentry->d_parent);
- if (p_ino && dentry->d_parent != dentry)
+ if (p_ino && !IS_ROOT(dentry))
atomic_inc(&p_ino->count);
dir->i_mtime = CURRENT_TIME;
@@ -593,7 +593,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
if (atomic_dec_and_test(&ino->count)) {
p_ino = autofs4_dentry_ino(dentry->d_parent);
- if (p_ino && dentry->d_parent != dentry)
+ if (p_ino && !IS_ROOT(dentry))
atomic_dec(&p_ino->count);
}
dput(ino->dentry);
@@ -732,7 +732,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, umode_t m
dget(dentry);
atomic_inc(&ino->count);
p_ino = autofs4_dentry_ino(dentry->d_parent);
- if (p_ino && dentry->d_parent != dentry)
+ if (p_ino && !IS_ROOT(dentry))
atomic_inc(&p_ino->count);
inc_nlink(dir);
dir->i_mtime = CURRENT_TIME;
--
1.8.2.2
prev parent reply other threads:[~2013-08-30 7:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-30 7:22 [PATCH 1/2] autofs: fix the return value of autofs4_fill_super Rui Xiang
2013-08-30 7:22 ` Rui Xiang [this message]
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=1377847338-51032-2-git-send-email-rui.xiang@huawei.com \
--to=rui.xiang@huawei.com \
--cc=autofs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raven@themaw.net \
/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®