Merge tag 'xtensa-next-20130710' of git://github.com/czankel/xtensa-linux
[cascardo/linux.git] / include / linux / audit.h
index b20b038..729a4d1 100644 (file)
@@ -103,8 +103,11 @@ extern void __audit_syscall_exit(int ret_success, long ret_value);
 extern struct filename *__audit_reusename(const __user char *uptr);
 extern void __audit_getname(struct filename *name);
 extern void audit_putname(struct filename *name);
+
+#define AUDIT_INODE_PARENT     1       /* dentry represents the parent */
+#define AUDIT_INODE_HIDDEN     2       /* audit record should be hidden */
 extern void __audit_inode(struct filename *name, const struct dentry *dentry,
-                               unsigned int parent);
+                               unsigned int flags);
 extern void __audit_inode_child(const struct inode *parent,
                                const struct dentry *dentry,
                                const unsigned char type);
@@ -148,10 +151,22 @@ static inline void audit_getname(struct filename *name)
        if (unlikely(!audit_dummy_context()))
                __audit_getname(name);
 }
-static inline void audit_inode(struct filename *name, const struct dentry *dentry,
+static inline void audit_inode(struct filename *name,
+                               const struct dentry *dentry,
                                unsigned int parent) {
+       if (unlikely(!audit_dummy_context())) {
+               unsigned int flags = 0;
+               if (parent)
+                       flags |= AUDIT_INODE_PARENT;
+               __audit_inode(name, dentry, flags);
+       }
+}
+static inline void audit_inode_parent_hidden(struct filename *name,
+                                               const struct dentry *dentry)
+{
        if (unlikely(!audit_dummy_context()))
-               __audit_inode(name, dentry, parent);
+               __audit_inode(name, dentry,
+                               AUDIT_INODE_PARENT | AUDIT_INODE_HIDDEN);
 }
 static inline void audit_inode_child(const struct inode *parent,
                                     const struct dentry *dentry,
@@ -311,7 +326,7 @@ static inline void audit_putname(struct filename *name)
 { }
 static inline void __audit_inode(struct filename *name,
                                        const struct dentry *dentry,
-                                       unsigned int parent)
+                                       unsigned int flags)
 { }
 static inline void __audit_inode_child(const struct inode *parent,
                                        const struct dentry *dentry,
@@ -321,6 +336,9 @@ static inline void audit_inode(struct filename *name,
                                const struct dentry *dentry,
                                unsigned int parent)
 { }
+static inline void audit_inode_parent_hidden(struct filename *name,
+                               const struct dentry *dentry)
+{ }
 static inline void audit_inode_child(const struct inode *parent,
                                     const struct dentry *dentry,
                                     const unsigned char type)