summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-10-10 16:43:13 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-12 20:15:09 -0400
commitadb5c2473d3f91526c79db972aafb20a56d3fbb3 (patch)
treef0427a11a91af2f5a5d0037ce52c32633019120b /fs
parent669abf4e5539c8aa48bf28c965be05c0a7b58a27 (diff)
downloadlinux-adb5c2473d3f91526c79db972aafb20a56d3fbb3.tar.bz2
audit: make audit_inode take struct filename
Keep a pointer to the audit_names "slot" in struct filename. Have all of the audit_inode callers pass a struct filename ponter to audit_inode instead of a string pointer. If the aname field is already populated, then we can skip walking the list altogether and just use it directly. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 6bbd8fdfb1f5..80b162b142f9 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1999,8 +1999,7 @@ static int filename_lookup(int dfd, struct filename *name,
flags | LOOKUP_REVAL, nd);
if (likely(!retval))
- audit_inode(name->name, nd->path.dentry,
- flags & LOOKUP_PARENT);
+ audit_inode(name, nd->path.dentry, flags & LOOKUP_PARENT);
return retval;
}
@@ -2674,7 +2673,6 @@ static int do_last(struct nameidata *nd, struct path *path,
struct path save_parent = { .dentry = NULL, .mnt = NULL };
bool retried = false;
int error;
- const char *pathname = name->name;
nd->flags &= ~LOOKUP_PARENT;
nd->flags |= op->intent;
@@ -2690,7 +2688,7 @@ static int do_last(struct nameidata *nd, struct path *path,
error = complete_walk(nd);
if (error)
return error;
- audit_inode(pathname, nd->path.dentry, 0);
+ audit_inode(name, nd->path.dentry, 0);
if (open_flag & O_CREAT) {
error = -EISDIR;
goto out;
@@ -2700,7 +2698,7 @@ static int do_last(struct nameidata *nd, struct path *path,
error = complete_walk(nd);
if (error)
return error;
- audit_inode(pathname, dir, 0);
+ audit_inode(name, dir, 0);
goto finish_open;
}
@@ -2729,7 +2727,7 @@ static int do_last(struct nameidata *nd, struct path *path,
if (error)
return error;
- audit_inode(pathname, dir, 0);
+ audit_inode(name, dir, 0);
error = -EISDIR;
/* trailing slashes? */
if (nd->last.name[nd->last.len])
@@ -2759,7 +2757,7 @@ retry_lookup:
!S_ISREG(file->f_path.dentry->d_inode->i_mode))
will_truncate = false;
- audit_inode(pathname, file->f_path.dentry, 0);
+ audit_inode(name, file->f_path.dentry, 0);
goto opened;
}
@@ -2776,7 +2774,7 @@ retry_lookup:
* create/update audit record if it already exists.
*/
if (path->dentry->d_inode)
- audit_inode(pathname, path->dentry, 0);
+ audit_inode(name, path->dentry, 0);
/*
* If atomic_open() acquired write access it is dropped now due to
@@ -2841,7 +2839,7 @@ finish_lookup:
error = -ENOTDIR;
if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)
goto out;
- audit_inode(pathname, nd->path.dentry, 0);
+ audit_inode(name, nd->path.dentry, 0);
finish_open:
if (!S_ISREG(nd->inode->i_mode))
will_truncate = false;