diff options
author | Rui Xiang <rui.xiang@huawei.com> | 2014-01-23 18:55:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 19:36:59 -0500 |
commit | c24930a9bbb6219f21f670c38b9473181d5f5e10 (patch) | |
tree | 79fc37031fdca3ebb6be77ff67ffe8868c5b8d39 /fs/autofs4/root.c | |
parent | da29b7543957c6e967066f1ee18fab2feb0eeeb3 (diff) |
autofs: use IS_ROOT to replace root dentry checks
Use the helper macro !IS_ROOT to replace parent != dentry->d_parent. Just
clean up.
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r-- | fs/autofs4/root.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 92ef341ba0cf..2caf36ac3e93 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -558,7 +558,7 @@ static int autofs4_dir_symlink(struct inode *dir, | |||
558 | dget(dentry); | 558 | dget(dentry); |
559 | atomic_inc(&ino->count); | 559 | atomic_inc(&ino->count); |
560 | p_ino = autofs4_dentry_ino(dentry->d_parent); | 560 | p_ino = autofs4_dentry_ino(dentry->d_parent); |
561 | if (p_ino && dentry->d_parent != dentry) | 561 | if (p_ino && !IS_ROOT(dentry)) |
562 | atomic_inc(&p_ino->count); | 562 | atomic_inc(&p_ino->count); |
563 | 563 | ||
564 | dir->i_mtime = CURRENT_TIME; | 564 | dir->i_mtime = CURRENT_TIME; |
@@ -593,7 +593,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry) | |||
593 | 593 | ||
594 | if (atomic_dec_and_test(&ino->count)) { | 594 | if (atomic_dec_and_test(&ino->count)) { |
595 | p_ino = autofs4_dentry_ino(dentry->d_parent); | 595 | p_ino = autofs4_dentry_ino(dentry->d_parent); |
596 | if (p_ino && dentry->d_parent != dentry) | 596 | if (p_ino && !IS_ROOT(dentry)) |
597 | atomic_dec(&p_ino->count); | 597 | atomic_dec(&p_ino->count); |
598 | } | 598 | } |
599 | dput(ino->dentry); | 599 | dput(ino->dentry); |
@@ -732,7 +732,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, umode_t m | |||
732 | dget(dentry); | 732 | dget(dentry); |
733 | atomic_inc(&ino->count); | 733 | atomic_inc(&ino->count); |
734 | p_ino = autofs4_dentry_ino(dentry->d_parent); | 734 | p_ino = autofs4_dentry_ino(dentry->d_parent); |
735 | if (p_ino && dentry->d_parent != dentry) | 735 | if (p_ino && !IS_ROOT(dentry)) |
736 | atomic_inc(&p_ino->count); | 736 | atomic_inc(&p_ino->count); |
737 | inc_nlink(dir); | 737 | inc_nlink(dir); |
738 | dir->i_mtime = CURRENT_TIME; | 738 | dir->i_mtime = CURRENT_TIME; |