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>
This commit is contained in:
Lino Sanfilippo
2011-06-14 17:29:51 +02:00
committed by Eric Paris
parent 986ab09807
commit e2a29943e9
10 changed files with 38 additions and 34 deletions

View File

@@ -121,21 +121,11 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
* The caller had better be holding a reference to this mark so we don't actually
* do the final put under the mark->lock
*/
void fsnotify_destroy_mark(struct fsnotify_mark *mark)
void fsnotify_destroy_mark(struct fsnotify_mark *mark,
struct fsnotify_group *group)
{
struct fsnotify_group *group;
struct inode *inode = NULL;
spin_lock(&mark->lock);
/* dont get the group from a mark that is not alive yet */
if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) {
spin_unlock(&mark->lock);
return;
}
fsnotify_get_group(mark->group);
group = mark->group;
spin_unlock(&mark->lock);
mutex_lock(&group->mark_mutex);
spin_lock(&mark->lock);
@@ -143,7 +133,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) {
spin_unlock(&mark->lock);
mutex_unlock(&group->mark_mutex);
goto put_group;
return;
}
mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE;
@@ -194,9 +184,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
*/
atomic_dec(&group->num_marks);
put_group:
fsnotify_put_group(group);
}
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,
mutex_unlock(&group->mark_mutex);
list_for_each_entry_safe(mark, lmark, &free_list, free_g_list) {
fsnotify_destroy_mark(mark);
fsnotify_destroy_mark(mark, group);
fsnotify_put_mark(mark);
}
}