Skip to contentSkip to conversation

f2fs: split discard_cmd_list

PATCH Superseded Chao Yu 1 participant 1 message Mar 27, 2017 F2FS file system

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH v2 1/4 f2fs: split discard_cmd_list

Split discard_cmd_list to discard_{pend,wait}_list, so while sending/waiting discard command, we can avoid traversing unneeded entries in original list.

---
v2: remove unneeded judgment condition in issue_discard_thread.

 fs/f2fs/f2fs.h    |  3 ++-
 fs/f2fs/segment.c | 44 ++++++++++++++++++++++++++------------------
 2 files changed, 28 insertions(+), 19 deletions(-)
fs/f2fs/f2fs.h +2 -1
index 19e28127a725..d3c052f2ad66 100644
@@ -210,7 +210,8 @@ struct discard_cmd_control {
 	struct task_struct *f2fs_issue_discard;	/* discard thread */
 	struct list_head discard_entry_list;	/* 4KB discard entry list */
 	int nr_discards;			/* # of discards in the list */
-	struct list_head discard_cmd_list;	/* discard cmd list */
+	struct list_head discard_pend_list;	/* store pending entries */
+	struct list_head discard_wait_list;	/* store on-flushing entries */
 	wait_queue_head_t discard_wait_queue;	/* waiting queue for wake-up */
 	struct mutex cmd_lock;
 	int max_discards;			/* max. discards to be issued */
fs/f2fs/segment.c +26 -18

112 lines not on this page · raw message

Signature · 6 lines
2.8.2.295.g3f1c1d0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot