fsnotify: store struct file not struct path
[sfrench/cifs-2.6.git] / kernel / audit_watch.c
index d8cb55a5c0599702e864fda5f214e85100e4127a..b955a22d8ff19ed01703e1502a561309d85ce6a7 100644 (file)
@@ -101,10 +101,7 @@ static inline struct audit_parent *audit_find_parent(struct inode *inode)
        struct audit_parent *parent = NULL;
        struct fsnotify_mark *entry;
 
-       spin_lock(&inode->i_lock);
-       entry = fsnotify_find_mark_entry(audit_watch_group, inode);
-       spin_unlock(&inode->i_lock);
-
+       entry = fsnotify_find_inode_mark(audit_watch_group, inode);
        if (entry)
                parent = container_of(entry, struct audit_parent, mark);
 
@@ -161,7 +158,7 @@ static struct audit_parent *audit_init_parent(struct nameidata *ndp)
 
        fsnotify_init_mark(&parent->mark, audit_watch_free_mark);
        parent->mark.mask = AUDIT_FS_WATCH;
-       ret = fsnotify_add_mark(&parent->mark, audit_watch_group, inode, 0);
+       ret = fsnotify_add_mark(&parent->mark, audit_watch_group, inode, NULL, 0);
        if (ret < 0) {
                audit_free_parent(parent);
                return ERR_PTR(ret);
@@ -354,7 +351,7 @@ static void audit_remove_parent_watches(struct audit_parent *parent)
        }
        mutex_unlock(&audit_filter_mutex);
 
-       fsnotify_destroy_mark_by_entry(&parent->mark);
+       fsnotify_destroy_mark(&parent->mark);
 
        fsnotify_recalc_group_mask(audit_watch_group);
 
@@ -504,7 +501,7 @@ void audit_remove_watch_rule(struct audit_krule *krule)
 
                if (list_empty(&parent->watches)) {
                        audit_get_parent(parent);
-                       fsnotify_destroy_mark_by_entry(&parent->mark);
+                       fsnotify_destroy_mark(&parent->mark);
                        audit_put_parent(parent);
                }
        }
@@ -520,9 +517,7 @@ static bool audit_watch_should_send_event(struct fsnotify_group *group, struct i
        struct fsnotify_mark *entry;
        bool send;
 
-       spin_lock(&inode->i_lock);
-       entry = fsnotify_find_mark_entry(group, inode);
-       spin_unlock(&inode->i_lock);
+       entry = fsnotify_find_inode_mark(group, inode);
        if (!entry)
                return false;
 
@@ -550,8 +545,8 @@ static int audit_watch_handle_event(struct fsnotify_group *group, struct fsnotif
                return 0;
 
        switch (event->data_type) {
-       case (FSNOTIFY_EVENT_PATH):
-               inode = event->path.dentry->d_inode;
+       case (FSNOTIFY_EVENT_FILE):
+               inode = event->file->f_path.dentry->d_inode;
                break;
        case (FSNOTIFY_EVENT_INODE):
                inode = event->inode;