]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: use lock-less list(llist) to simplify the flush cmd management
authorGu Zheng <guz.fnst@cn.fujitsu.com>
Fri, 5 Sep 2014 10:31:00 +0000 (18:31 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 9 Sep 2014 20:15:06 +0000 (13:15 -0700)
commit6a7b3c9d6963666671a6ef457086c7c81add3c21
treee2bb12369f481acc821367da79b5e3e426b6b6ab
parentd6335b6522fd8c7108f00309761a74521691dbfe
f2fs: use lock-less list(llist) to simplify the flush cmd management

We use flush cmd control to collect many flush cmds, and flush them
together. In this case, we use two list to manage the flush cmds
(collect and dispatch), and one spin lock is used to protect this.
In fact, the lock-less list(llist) is very suitable to this case,
and we use simplify this routine.

-
v2:
-use llist_for_each_entry_safe to fix possible use-after-free issue.
-remove the unused field from struct flush_cmd.
Thanks for Yu's suggestion.
-

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/segment.c