struct audit_parent *parent = NULL;
struct fsnotify_mark *entry;
- spin_lock(&inode->i_lock);
- entry = fsnotify_find_mark(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);
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);
}
static bool audit_watch_should_send_event(struct fsnotify_group *group, struct inode *inode,
- struct vfsmount *mnt, __u32 mask, void *data,
- int data_type)
+ struct vfsmount *mnt, struct fsnotify_mark *mark,
+ __u32 mask, void *data, int data_type)
{
struct fsnotify_mark *entry;
bool send;
- spin_lock(&inode->i_lock);
- entry = fsnotify_find_mark(group, inode);
- spin_unlock(&inode->i_lock);
+ entry = fsnotify_find_inode_mark(group, inode);
if (!entry)
return false;
}
/* Update watch data in audit rules based on fsnotify events. */
-static int audit_watch_handle_event(struct fsnotify_group *group, struct fsnotify_event *event)
+static int audit_watch_handle_event(struct fsnotify_group *group,
+ struct fsnotify_mark *mark,
+ struct fsnotify_event *event)
{
struct inode *inode;
__u32 mask = event->mask;
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;