]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
autofs: use IS_ROOT to replace root dentry checks
authorRui Xiang <rui.xiang@huawei.com>
Thu, 23 Jan 2014 23:55:00 +0000 (15:55 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:36:59 +0000 (16:36 -0800)
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>
fs/autofs4/root.c

index 92ef341ba0cf35c1bd1b5f001b9b39068979f6ff..2caf36ac3e93e41d4f14ac48ef4bcedc4b682548 100644 (file)
@@ -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;