diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-12-17 21:24:27 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:56 -0400 |
commit | 32c3263221bd63316815286dccacdc7abfd7f3c4 (patch) | |
tree | 9dad12d5b966cf42d7506e10fb2e3c8d955415d3 /fs/notify/fanotify | |
parent | 22aa425dec9e47051624714ae283eb2b6a473013 (diff) |
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/fanotify')
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 5 | ||||
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 5b0b6b485a9c..881067dc7923 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -10,8 +10,9 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new) | |||
10 | { | 10 | { |
11 | pr_debug("%s: old=%p new=%p\n", __func__, old, new); | 11 | pr_debug("%s: old=%p new=%p\n", __func__, old, new); |
12 | 12 | ||
13 | if ((old->to_tell == new->to_tell) && | 13 | if (old->to_tell == new->to_tell && |
14 | (old->data_type == new->data_type)) { | 14 | old->data_type == new->data_type && |
15 | old->tgid == new->tgid) { | ||
15 | switch (old->data_type) { | 16 | switch (old->data_type) { |
16 | case (FSNOTIFY_EVENT_PATH): | 17 | case (FSNOTIFY_EVENT_PATH): |
17 | if ((old->path.mnt == new->path.mnt) && | 18 | if ((old->path.mnt == new->path.mnt) && |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index cf9c30009825..66e38fc052b2 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -103,6 +103,7 @@ static ssize_t fill_event_metadata(struct fsnotify_group *group, | |||
103 | metadata->event_len = FAN_EVENT_METADATA_LEN; | 103 | metadata->event_len = FAN_EVENT_METADATA_LEN; |
104 | metadata->vers = FANOTIFY_METADATA_VERSION; | 104 | metadata->vers = FANOTIFY_METADATA_VERSION; |
105 | metadata->mask = fanotify_outgoing_mask(event->mask); | 105 | metadata->mask = fanotify_outgoing_mask(event->mask); |
106 | metadata->pid = pid_vnr(event->tgid); | ||
106 | metadata->fd = create_fd(group, event); | 107 | metadata->fd = create_fd(group, event); |
107 | 108 | ||
108 | return metadata->fd; | 109 | return metadata->fd; |