Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
[cascardo/linux.git] / include / linux / audit.h
index b481779..599f3bd 100644 (file)
@@ -93,7 +93,7 @@ extern unsigned compat_dir_class[];
 extern unsigned compat_chattr_class[];
 extern unsigned compat_signal_class[];
 
-extern int __weak audit_classify_compat_syscall(int abi, unsigned syscall);
+extern int audit_classify_compat_syscall(int abi, unsigned syscall);
 
 /* audit_names->type values */
 #define        AUDIT_TYPE_UNKNOWN      0       /* we don't know yet */
@@ -133,6 +133,7 @@ extern void audit_putname(struct filename *name);
 #define AUDIT_INODE_HIDDEN     2       /* audit record should be hidden */
 extern void __audit_inode(struct filename *name, const struct dentry *dentry,
                                unsigned int flags);
+extern void __audit_file(const struct file *);
 extern void __audit_inode_child(const struct inode *parent,
                                const struct dentry *dentry,
                                const unsigned char type);
@@ -186,6 +187,11 @@ static inline void audit_inode(struct filename *name,
                __audit_inode(name, dentry, flags);
        }
 }
+static inline void audit_file(struct file *file)
+{
+       if (unlikely(!audit_dummy_context()))
+               __audit_file(file);
+}
 static inline void audit_inode_parent_hidden(struct filename *name,
                                                const struct dentry *dentry)
 {
@@ -360,6 +366,9 @@ static inline void audit_inode(struct filename *name,
                                const struct dentry *dentry,
                                unsigned int parent)
 { }
+static inline void audit_file(struct file *file)
+{
+}
 static inline void audit_inode_parent_hidden(struct filename *name,
                                const struct dentry *dentry)
 { }