提交 8778abb9 编写于 作者: A Andreas Gruenbacher 提交者: Eric Paris

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: NAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: NEric Paris <eparis@redhat.com>
上级 75c1be48
...@@ -349,10 +349,8 @@ static int fsnotify_mark_destroy(void *ignored) ...@@ -349,10 +349,8 @@ static int fsnotify_mark_destroy(void *ignored)
for (;;) { for (;;) {
spin_lock(&destroy_lock); spin_lock(&destroy_lock);
list_for_each_entry_safe(mark, next, &destroy_list, destroy_list) { /* exchange the list head */
list_del(&mark->destroy_list); list_replace_init(&destroy_list, &private_destroy_list);
list_add(&mark->destroy_list, &private_destroy_list);
}
spin_unlock(&destroy_lock); spin_unlock(&destroy_lock);
synchronize_srcu(&fsnotify_mark_srcu); synchronize_srcu(&fsnotify_mark_srcu);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册