mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
autofs: get rid of pointless checks around ->count handling
* IS_ROOT can't be true for unlink or rmdir victim * any positive autofs dentry has non-NULL autofs_dentry_ino() * autofs symlink can't have ->count other than 1 * autofs empty directory can't have ->count other than 1 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
e509d6e9c1
commit
41ca19740a
@ -571,8 +571,7 @@ static int autofs_dir_symlink(struct inode *dir,
|
||||
dget(dentry);
|
||||
atomic_inc(&ino->count);
|
||||
p_ino = autofs_dentry_ino(dentry->d_parent);
|
||||
if (p_ino && !IS_ROOT(dentry))
|
||||
atomic_inc(&p_ino->count);
|
||||
atomic_inc(&p_ino->count);
|
||||
|
||||
dir->i_mtime = current_time(dir);
|
||||
|
||||
@ -610,11 +609,9 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry)
|
||||
if (sbi->flags & AUTOFS_SBI_CATATONIC)
|
||||
return -EACCES;
|
||||
|
||||
if (atomic_dec_and_test(&ino->count)) {
|
||||
p_ino = autofs_dentry_ino(dentry->d_parent);
|
||||
if (p_ino && !IS_ROOT(dentry))
|
||||
atomic_dec(&p_ino->count);
|
||||
}
|
||||
atomic_dec(&ino->count);
|
||||
p_ino = autofs_dentry_ino(dentry->d_parent);
|
||||
atomic_dec(&p_ino->count);
|
||||
dput(ino->dentry);
|
||||
|
||||
d_inode(dentry)->i_size = 0;
|
||||
@ -706,11 +703,9 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
if (sbi->version < 5)
|
||||
autofs_clear_leaf_automount_flags(dentry);
|
||||
|
||||
if (atomic_dec_and_test(&ino->count)) {
|
||||
p_ino = autofs_dentry_ino(dentry->d_parent);
|
||||
if (p_ino && dentry->d_parent != dentry)
|
||||
atomic_dec(&p_ino->count);
|
||||
}
|
||||
atomic_dec(&ino->count);
|
||||
p_ino = autofs_dentry_ino(dentry->d_parent);
|
||||
atomic_dec(&p_ino->count);
|
||||
dput(ino->dentry);
|
||||
d_inode(dentry)->i_size = 0;
|
||||
clear_nlink(d_inode(dentry));
|
||||
@ -758,8 +753,7 @@ static int autofs_dir_mkdir(struct inode *dir,
|
||||
dget(dentry);
|
||||
atomic_inc(&ino->count);
|
||||
p_ino = autofs_dentry_ino(dentry->d_parent);
|
||||
if (p_ino && !IS_ROOT(dentry))
|
||||
atomic_inc(&p_ino->count);
|
||||
atomic_inc(&p_ino->count);
|
||||
inc_nlink(dir);
|
||||
dir->i_mtime = current_time(dir);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user