summaryrefslogtreecommitdiffstats
path: root/fs/notify/notification.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2009-12-17 21:24:27 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:58:56 -0400
commit32c3263221bd63316815286dccacdc7abfd7f3c4 (patch)
tree9dad12d5b966cf42d7506e10fb2e3c8d955415d3 /fs/notify/notification.c
parent22aa425dec9e47051624714ae283eb2b6a473013 (diff)
downloadtalos-obmc-linux-32c3263221bd63316815286dccacdc7abfd7f3c4.tar.gz
talos-obmc-linux-32c3263221bd63316815286dccacdc7abfd7f3c4.zip
fanotify: Add pids to events
Pass the process identifiers of the triggering processes to fanotify listeners: this information is useful for event filtering and logging. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/notification.c')
-rw-r--r--fs/notify/notification.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index 066f1f988bac..7fc8d004084c 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -93,6 +93,7 @@ void fsnotify_put_event(struct fsnotify_event *event)
BUG_ON(!list_empty(&event->private_data_list));
kfree(event->file_name);
+ put_pid(event->tgid);
kmem_cache_free(fsnotify_event_cachep, event);
}
}
@@ -346,6 +347,7 @@ struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event)
return NULL;
}
}
+ event->tgid = get_pid(old_event->tgid);
if (event->data_type == FSNOTIFY_EVENT_PATH)
path_get(&event->path);
@@ -385,6 +387,7 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
event->name_len = strlen(event->file_name);
}
+ event->tgid = get_pid(task_tgid(current));
event->sync_cookie = cookie;
event->to_tell = to_tell;
event->data_type = data_type;
OpenPOWER on IntegriCloud