Skip to content

Commit

Permalink
fsnotify: Exchange list heads instead of moving elements
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Gruenbacher authored and Eric Paris committed Jul 28, 2010
1 parent 75c1be4 commit 8778abb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/notify/mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,8 @@ static int fsnotify_mark_destroy(void *ignored)

for (;;) {
spin_lock(&destroy_lock);
list_for_each_entry_safe(mark, next, &destroy_list, destroy_list) {
list_del(&mark->destroy_list);
list_add(&mark->destroy_list, &private_destroy_list);
}
/* exchange the list head */
list_replace_init(&destroy_list, &private_destroy_list);
spin_unlock(&destroy_lock);

synchronize_srcu(&fsnotify_mark_srcu);
Expand Down

0 comments on commit 8778abb

Please sign in to comment.