aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
parent669abf4e5539c8aa48bf28c965be05c0a7b58a27 (diff)
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 'include')
-rw-r--r--include/linux/audit.h10
-rw-r--r--include/linux/fs.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index d5d7952ab7d8..e5884f950b4b 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -474,7 +474,7 @@ extern void __audit_syscall_exit(int ret_success, long ret_value);
474extern struct filename *__audit_reusename(const __user char *uptr); 474extern struct filename *__audit_reusename(const __user char *uptr);
475extern void __audit_getname(struct filename *name); 475extern void __audit_getname(struct filename *name);
476extern void audit_putname(struct filename *name); 476extern void audit_putname(struct filename *name);
477extern void __audit_inode(const char *name, const struct dentry *dentry, 477extern void __audit_inode(struct filename *name, const struct dentry *dentry,
478 unsigned int parent); 478 unsigned int parent);
479extern void __audit_inode_child(const struct inode *parent, 479extern void __audit_inode_child(const struct inode *parent,
480 const struct dentry *dentry, 480 const struct dentry *dentry,
@@ -519,7 +519,7 @@ static inline void audit_getname(struct filename *name)
519 if (unlikely(!audit_dummy_context())) 519 if (unlikely(!audit_dummy_context()))
520 __audit_getname(name); 520 __audit_getname(name);
521} 521}
522static inline void audit_inode(const char *name, const struct dentry *dentry, 522static inline void audit_inode(struct filename *name, const struct dentry *dentry,
523 unsigned int parent) { 523 unsigned int parent) {
524 if (unlikely(!audit_dummy_context())) 524 if (unlikely(!audit_dummy_context()))
525 __audit_inode(name, dentry, parent); 525 __audit_inode(name, dentry, parent);
@@ -680,14 +680,16 @@ static inline void audit_getname(struct filename *name)
680{ } 680{ }
681static inline void audit_putname(struct filename *name) 681static inline void audit_putname(struct filename *name)
682{ } 682{ }
683static inline void __audit_inode(const char *name, const struct dentry *dentry, 683static inline void __audit_inode(struct filename *name,
684 const struct dentry *dentry,
684 unsigned int parent) 685 unsigned int parent)
685{ } 686{ }
686static inline void __audit_inode_child(const struct inode *parent, 687static inline void __audit_inode_child(const struct inode *parent,
687 const struct dentry *dentry, 688 const struct dentry *dentry,
688 const unsigned char type) 689 const unsigned char type)
689{ } 690{ }
690static inline void audit_inode(const char *name, const struct dentry *dentry, 691static inline void audit_inode(struct filename *name,
692 const struct dentry *dentry,
691 unsigned int parent) 693 unsigned int parent)
692{ } 694{ }
693static inline void audit_inode_child(const struct inode *parent, 695static inline void audit_inode_child(const struct inode *parent,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b6b10e7f0ac0..4aa7160a51ce 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2196,9 +2196,11 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
2196#endif /* CONFIG_FILE_LOCKING */ 2196#endif /* CONFIG_FILE_LOCKING */
2197 2197
2198/* fs/open.c */ 2198/* fs/open.c */
2199struct audit_names;
2199struct filename { 2200struct filename {
2200 const char *name; /* pointer to actual string */ 2201 const char *name; /* pointer to actual string */
2201 const __user char *uptr; /* original userland pointer */ 2202 const __user char *uptr; /* original userland pointer */
2203 struct audit_names *aname;
2202}; 2204};
2203 2205
2204extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, 2206extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,