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 | 19c2a0e1a2f60112c158342ba5f568f72b741c2c (patch) | |
tree | 807520e66657e25420389c376cccaf5ca283f346 /fs/notify/group.c | |
parent | 0d2e2a1d00d7d23e5bd9bb0935cde7c3d5835c56 (diff) |
fsnotify: rename fsnotify_groups to fsnotify_inode_groups
Simple renaming patch. fsnotify is about to support mount point listeners
so I am renaming fsnotify_groups and fsnotify_mask to indicate these are lists
used only for groups which have watches on inodes.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/group.c')
-rw-r--r-- | fs/notify/group.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/fs/notify/group.c b/fs/notify/group.c index 1657349c30a..c8080974531 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -33,9 +33,9 @@ static DEFINE_MUTEX(fsnotify_grp_mutex); /* protects reads while running the fsnotify_groups list */ struct srcu_struct fsnotify_grp_srcu; /* all groups registered to receive filesystem notifications */ -LIST_HEAD(fsnotify_groups); +LIST_HEAD(fsnotify_inode_groups); /* bitwise OR of all events (FS_*) interesting to some group on this system */ -__u32 fsnotify_mask; +__u32 fsnotify_inode_mask; /* * When a new group registers or changes it's set of interesting events @@ -48,10 +48,10 @@ void fsnotify_recalc_global_mask(void) int idx; idx = srcu_read_lock(&fsnotify_grp_srcu); - list_for_each_entry_rcu(group, &fsnotify_groups, group_list) + list_for_each_entry_rcu(group, &fsnotify_inode_groups, inode_group_list) mask |= group->mask; srcu_read_unlock(&fsnotify_grp_srcu, idx); - fsnotify_mask = mask; + fsnotify_inode_mask = mask; } /* @@ -77,6 +77,17 @@ void fsnotify_recalc_group_mask(struct fsnotify_group *group) fsnotify_recalc_global_mask(); } +static void fsnotify_add_group(struct fsnotify_group *group) +{ + BUG_ON(!mutex_is_locked(&fsnotify_grp_mutex)); + + group->on_inode_group_list = 1; + /* being on the fsnotify_groups list holds one num_marks */ + atomic_inc(&group->num_marks); + + list_add_tail_rcu(&group->inode_group_list, &fsnotify_inode_groups); +} + /* * Final freeing of a group */ @@ -118,9 +129,9 @@ static void __fsnotify_evict_group(struct fsnotify_group *group) { BUG_ON(!mutex_is_locked(&fsnotify_grp_mutex)); - if (group->on_group_list) - list_del_rcu(&group->group_list); - group->on_group_list = 0; + if (group->on_inode_group_list) + list_del_rcu(&group->inode_group_list); + group->on_inode_group_list = 0; } /* @@ -186,10 +197,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) mutex_lock(&fsnotify_grp_mutex); - list_add_rcu(&group->group_list, &fsnotify_groups); - group->on_group_list = 1; - /* being on the fsnotify_groups list holds one num_marks */ - atomic_inc(&group->num_marks); + fsnotify_add_group(group); mutex_unlock(&fsnotify_grp_mutex); |