diff options
author | Eric Paris <eparis@redhat.com> | 2009-12-17 21:24:23 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:51 -0400 |
commit | 4ca763523e040dc61191d4866a82981a5d30a4e9 (patch) | |
tree | 9b02105e7c84853dd89eff16837a9b7fba2a1050 /fs/notify/inode_mark.c | |
parent | 36fddebaa8a9186d4f5817ab798a83400b2fb2e7 (diff) | |
download | kernel_samsung_smdk4412-4ca763523e040dc61191d4866a82981a5d30a4e9.zip kernel_samsung_smdk4412-4ca763523e040dc61191d4866a82981a5d30a4e9.tar.gz kernel_samsung_smdk4412-4ca763523e040dc61191d4866a82981a5d30a4e9.tar.bz2 |
fsnotify: add groups to fsnotify_inode_groups when registering inode watch
Currently all fsnotify groups are added immediately to the
fsnotify_inode_groups list upon creation. This means, even groups with no
watches (common for audit) will be on the global tracking list and will
get checked for every event. This patch adds groups to the global list on
when the first inode mark is added to the group.
Signed-of-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r-- | fs/notify/inode_mark.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index 7d2962e..a3230c4 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c @@ -323,6 +323,13 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry, return -EINVAL; /* + * if this group isn't being testing for inode type events we need + * to start testing + */ + if (unlikely(list_empty(&group->inode_group_list))) + fsnotify_add_inode_group(group); + + /* * LOCKING ORDER!!!! * entry->lock * group->mark_lock |