diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-07-28 10:18:38 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:52 -0400 |
commit | 8778abb9a88fc4a74d8776ffaadf7214cf33c61e (patch) | |
tree | 6a32c8b885e68b3d6035887face6a3c5414d609e /fs/notify | |
parent | 75c1be487a690db43da2c1234fcacd84c982803c (diff) |
fsnotify: Exchange list heads instead of moving elements
Instead of moving list elements from destroy_list to &private_destroy_list,
exchange the list heads.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/mark.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 41f3990f900b..236f29b066ed 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c | |||
@@ -349,10 +349,8 @@ static int fsnotify_mark_destroy(void *ignored) | |||
349 | 349 | ||
350 | for (;;) { | 350 | for (;;) { |
351 | spin_lock(&destroy_lock); | 351 | spin_lock(&destroy_lock); |
352 | list_for_each_entry_safe(mark, next, &destroy_list, destroy_list) { | 352 | /* exchange the list head */ |
353 | list_del(&mark->destroy_list); | 353 | list_replace_init(&destroy_list, &private_destroy_list); |
354 | list_add(&mark->destroy_list, &private_destroy_list); | ||
355 | } | ||
356 | spin_unlock(&destroy_lock); | 354 | spin_unlock(&destroy_lock); |
357 | 355 | ||
358 | synchronize_srcu(&fsnotify_mark_srcu); | 356 | synchronize_srcu(&fsnotify_mark_srcu); |