diff options
author | Jan Kara <jack@suse.cz> | 2014-12-12 19:58:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 15:42:53 -0500 |
commit | 37d469e7673a663cbf38360beb1eaa3224c9d272 (patch) | |
tree | b980de73eb2a32cb759d57792c0028e634350b80 /fs/notify/mark.c | |
parent | 0809ab69a2782afac8c4d7f3d35cd123050aab9a (diff) |
fsnotify: remove destroy_list from fsnotify_mark
destroy_list is used to track marks which still need waiting for srcu
period end before they can be freed. However by the time mark is added to
destroy_list it isn't in group's list of marks anymore and thus we can
reuse fsnotify_mark->g_list for queueing into destroy_list. This saves
two pointers for each fsnotify_mark.
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r-- | fs/notify/mark.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 3942d5c9eb8d..92e48c70f0f0 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c | |||
@@ -161,7 +161,7 @@ void fsnotify_destroy_mark_locked(struct fsnotify_mark *mark, | |||
161 | mutex_unlock(&group->mark_mutex); | 161 | mutex_unlock(&group->mark_mutex); |
162 | 162 | ||
163 | spin_lock(&destroy_lock); | 163 | spin_lock(&destroy_lock); |
164 | list_add(&mark->destroy_list, &destroy_list); | 164 | list_add(&mark->g_list, &destroy_list); |
165 | spin_unlock(&destroy_lock); | 165 | spin_unlock(&destroy_lock); |
166 | wake_up(&destroy_waitq); | 166 | wake_up(&destroy_waitq); |
167 | /* | 167 | /* |
@@ -370,7 +370,7 @@ err: | |||
370 | spin_unlock(&mark->lock); | 370 | spin_unlock(&mark->lock); |
371 | 371 | ||
372 | spin_lock(&destroy_lock); | 372 | spin_lock(&destroy_lock); |
373 | list_add(&mark->destroy_list, &destroy_list); | 373 | list_add(&mark->g_list, &destroy_list); |
374 | spin_unlock(&destroy_lock); | 374 | spin_unlock(&destroy_lock); |
375 | wake_up(&destroy_waitq); | 375 | wake_up(&destroy_waitq); |
376 | 376 | ||
@@ -469,8 +469,8 @@ static int fsnotify_mark_destroy(void *ignored) | |||
469 | 469 | ||
470 | synchronize_srcu(&fsnotify_mark_srcu); | 470 | synchronize_srcu(&fsnotify_mark_srcu); |
471 | 471 | ||
472 | list_for_each_entry_safe(mark, next, &private_destroy_list, destroy_list) { | 472 | list_for_each_entry_safe(mark, next, &private_destroy_list, g_list) { |
473 | list_del_init(&mark->destroy_list); | 473 | list_del_init(&mark->g_list); |
474 | fsnotify_put_mark(mark); | 474 | fsnotify_put_mark(mark); |
475 | } | 475 | } |
476 | 476 | ||