open_last_lookups(): consolidate fsnotify_create() calls
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
c5971b8c63
commit
f7bb959d96
@ -2957,8 +2957,6 @@ static struct dentry *atomic_open(struct nameidata *nd, struct dentry *dentry,
|
|||||||
dput(dentry);
|
dput(dentry);
|
||||||
dentry = dget(file->f_path.dentry);
|
dentry = dget(file->f_path.dentry);
|
||||||
}
|
}
|
||||||
if (file->f_mode & FMODE_CREATED)
|
|
||||||
fsnotify_create(dir, dentry);
|
|
||||||
} else if (WARN_ON(file->f_path.dentry == DENTRY_NOT_SET)) {
|
} else if (WARN_ON(file->f_path.dentry == DENTRY_NOT_SET)) {
|
||||||
error = -EIO;
|
error = -EIO;
|
||||||
} else {
|
} else {
|
||||||
@ -2966,8 +2964,6 @@ static struct dentry *atomic_open(struct nameidata *nd, struct dentry *dentry,
|
|||||||
dput(dentry);
|
dput(dentry);
|
||||||
dentry = file->f_path.dentry;
|
dentry = file->f_path.dentry;
|
||||||
}
|
}
|
||||||
if (file->f_mode & FMODE_CREATED)
|
|
||||||
fsnotify_create(dir, dentry);
|
|
||||||
if (unlikely(d_is_negative(dentry)))
|
if (unlikely(d_is_negative(dentry)))
|
||||||
error = -ENOENT;
|
error = -ENOENT;
|
||||||
}
|
}
|
||||||
@ -3103,7 +3099,6 @@ no_open:
|
|||||||
open_flag & O_EXCL);
|
open_flag & O_EXCL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_dput;
|
goto out_dput;
|
||||||
fsnotify_create(dir_inode, dentry);
|
|
||||||
}
|
}
|
||||||
if (unlikely(create_error) && !dentry->d_inode) {
|
if (unlikely(create_error) && !dentry->d_inode) {
|
||||||
error = create_error;
|
error = create_error;
|
||||||
@ -3182,6 +3177,8 @@ static const char *open_last_lookups(struct nameidata *nd,
|
|||||||
else
|
else
|
||||||
inode_lock_shared(dir->d_inode);
|
inode_lock_shared(dir->d_inode);
|
||||||
dentry = lookup_open(nd, file, op, got_write);
|
dentry = lookup_open(nd, file, op, got_write);
|
||||||
|
if (!IS_ERR(dentry) && (file->f_mode & FMODE_CREATED))
|
||||||
|
fsnotify_create(dir->d_inode, dentry);
|
||||||
if (open_flag & O_CREAT)
|
if (open_flag & O_CREAT)
|
||||||
inode_unlock(dir->d_inode);
|
inode_unlock(dir->d_inode);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user