diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2011-06-14 11:29:51 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2012-12-11 13:44:36 -0500 |
commit | e2a29943e9a2ee2aa737a77f550f46ba72269db4 (patch) | |
tree | cf0275eeed130433df241f115cbd2f9ebea96e7f /fs/notify/mark.c | |
parent | 986ab09807ca9454c3f54aae4db7e1bb00daeed3 (diff) |
fsnotify: pass group to fsnotify_destroy_mark()
In fsnotify_destroy_mark() dont get the group from the passed mark anymore,
but pass the group itself as an additional parameter to the function.
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r-- | fs/notify/mark.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c index ab25b810b146..b77c833c8d0a 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c | |||
@@ -121,21 +121,11 @@ void fsnotify_put_mark(struct fsnotify_mark *mark) | |||
121 | * The caller had better be holding a reference to this mark so we don't actually | 121 | * The caller had better be holding a reference to this mark so we don't actually |
122 | * do the final put under the mark->lock | 122 | * do the final put under the mark->lock |
123 | */ | 123 | */ |
124 | void fsnotify_destroy_mark(struct fsnotify_mark *mark) | 124 | void fsnotify_destroy_mark(struct fsnotify_mark *mark, |
125 | struct fsnotify_group *group) | ||
125 | { | 126 | { |
126 | struct fsnotify_group *group; | ||
127 | struct inode *inode = NULL; | 127 | struct inode *inode = NULL; |
128 | 128 | ||
129 | spin_lock(&mark->lock); | ||
130 | /* dont get the group from a mark that is not alive yet */ | ||
131 | if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) { | ||
132 | spin_unlock(&mark->lock); | ||
133 | return; | ||
134 | } | ||
135 | fsnotify_get_group(mark->group); | ||
136 | group = mark->group; | ||
137 | spin_unlock(&mark->lock); | ||
138 | |||
139 | mutex_lock(&group->mark_mutex); | 129 | mutex_lock(&group->mark_mutex); |
140 | spin_lock(&mark->lock); | 130 | spin_lock(&mark->lock); |
141 | 131 | ||
@@ -143,7 +133,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark) | |||
143 | if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) { | 133 | if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) { |
144 | spin_unlock(&mark->lock); | 134 | spin_unlock(&mark->lock); |
145 | mutex_unlock(&group->mark_mutex); | 135 | mutex_unlock(&group->mark_mutex); |
146 | goto put_group; | 136 | return; |
147 | } | 137 | } |
148 | 138 | ||
149 | mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE; | 139 | mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE; |
@@ -194,9 +184,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark) | |||
194 | */ | 184 | */ |
195 | 185 | ||
196 | atomic_dec(&group->num_marks); | 186 | atomic_dec(&group->num_marks); |
197 | |||
198 | put_group: | ||
199 | fsnotify_put_group(group); | ||
200 | } | 187 | } |
201 | 188 | ||
202 | void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask) | 189 | void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask) |
@@ -307,7 +294,7 @@ void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, | |||
307 | mutex_unlock(&group->mark_mutex); | 294 | mutex_unlock(&group->mark_mutex); |
308 | 295 | ||
309 | list_for_each_entry_safe(mark, lmark, &free_list, free_g_list) { | 296 | list_for_each_entry_safe(mark, lmark, &free_list, free_g_list) { |
310 | fsnotify_destroy_mark(mark); | 297 | fsnotify_destroy_mark(mark, group); |
311 | fsnotify_put_mark(mark); | 298 | fsnotify_put_mark(mark); |
312 | } | 299 | } |
313 | } | 300 | } |