namei: trim do_last() arguments
now that struct filename is stashed in nameidata we have no need to pass it in Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
c8a53ee5ee
commit
76ae2a5ab1
12
fs/namei.c
12
fs/namei.c
@ -2992,7 +2992,7 @@ out_dput:
|
|||||||
*/
|
*/
|
||||||
static int do_last(struct nameidata *nd,
|
static int do_last(struct nameidata *nd,
|
||||||
struct file *file, const struct open_flags *op,
|
struct file *file, const struct open_flags *op,
|
||||||
int *opened, struct filename *name)
|
int *opened)
|
||||||
{
|
{
|
||||||
struct dentry *dir = nd->path.dentry;
|
struct dentry *dir = nd->path.dentry;
|
||||||
int open_flag = op->open_flag;
|
int open_flag = op->open_flag;
|
||||||
@ -3039,7 +3039,7 @@ static int do_last(struct nameidata *nd,
|
|||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
audit_inode(name, dir, LOOKUP_PARENT);
|
audit_inode(nd->name, dir, LOOKUP_PARENT);
|
||||||
/* trailing slashes? */
|
/* trailing slashes? */
|
||||||
if (unlikely(nd->last.name[nd->last.len]))
|
if (unlikely(nd->last.name[nd->last.len]))
|
||||||
return -EISDIR;
|
return -EISDIR;
|
||||||
@ -3068,7 +3068,7 @@ retry_lookup:
|
|||||||
!S_ISREG(file_inode(file)->i_mode))
|
!S_ISREG(file_inode(file)->i_mode))
|
||||||
will_truncate = false;
|
will_truncate = false;
|
||||||
|
|
||||||
audit_inode(name, file->f_path.dentry, 0);
|
audit_inode(nd->name, file->f_path.dentry, 0);
|
||||||
goto opened;
|
goto opened;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3085,7 +3085,7 @@ retry_lookup:
|
|||||||
* create/update audit record if it already exists.
|
* create/update audit record if it already exists.
|
||||||
*/
|
*/
|
||||||
if (d_is_positive(path.dentry))
|
if (d_is_positive(path.dentry))
|
||||||
audit_inode(name, path.dentry, 0);
|
audit_inode(nd->name, path.dentry, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If atomic_open() acquired write access it is dropped now due to
|
* If atomic_open() acquired write access it is dropped now due to
|
||||||
@ -3143,7 +3143,7 @@ finish_open:
|
|||||||
path_put(&save_parent);
|
path_put(&save_parent);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
audit_inode(name, nd->path.dentry, 0);
|
audit_inode(nd->name, nd->path.dentry, 0);
|
||||||
error = -EISDIR;
|
error = -EISDIR;
|
||||||
if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
|
if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
|
||||||
goto out;
|
goto out;
|
||||||
@ -3298,7 +3298,7 @@ static struct file *path_openat(struct nameidata *nd,
|
|||||||
return ERR_CAST(s);
|
return ERR_CAST(s);
|
||||||
}
|
}
|
||||||
while (!(error = link_path_walk(s, nd)) &&
|
while (!(error = link_path_walk(s, nd)) &&
|
||||||
(error = do_last(nd, file, op, &opened, nd->name)) > 0) {
|
(error = do_last(nd, file, op, &opened)) > 0) {
|
||||||
nd->flags &= ~(LOOKUP_OPEN|LOOKUP_CREATE|LOOKUP_EXCL);
|
nd->flags &= ~(LOOKUP_OPEN|LOOKUP_CREATE|LOOKUP_EXCL);
|
||||||
s = trailing_symlink(nd);
|
s = trailing_symlink(nd);
|
||||||
if (IS_ERR(s)) {
|
if (IS_ERR(s)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user