f2fs: use rb-tree to track pending discard commands
PATCH 1/1 f2fs: use rb-tree to track pending discard commands
Introduce rb-tree based discard cache infrastructure to speed up lookup and merge operation of discard entry.
Signed-off-by Chao Yu <[email protected]>
--- fs/f2fs/extent_cache.c | 6 +- fs/f2fs/f2fs.h | 47 ++++++++++- fs/f2fs/segment.c | 223 ++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 230 insertions(+), 46 deletions(-)
fs/f2fs/extent_cache.c +3 -3
@@ -49,7 +49,7 @@ static struct rb_entry *__lookup_rb_tree_slow(struct rb_root *root,return NULL ; } -static struct rb_entry *__lookup_rb_tree (struct rb_root *root, +struct rb_entry *__lookup_rb_tree (struct rb_root *root,struct rb_entry *cached_re,unsigned int ofs) {struct rb_entry *re;
@@ -61,7 +61,7 @@ static struct rb_entry *__lookup_rb_tree(struct rb_root *root,return re; } -static struct rb_node **__lookup_rb_tree_for_insert (struct f2fs_sb_info *sbi, +struct rb_node **__lookup_rb_tree_for_insert (struct f2fs_sb_info *sbi,struct rb_root *root,struct rb_node **parent,unsigned int ofs) {
@@ -92,7 +92,7 @@ static struct rb_node **__lookup_rb_tree_for_insert(struct f2fs_sb_info *sbi,* in order to simpfy the insertion after. * tree must stay unchanged between lookup and insertion. */ -static struct rb_entry *__lookup_rb_tree_ret(struct rb_root *root, +struct rb_entry *__lookup_rb_tree_ret(struct rb_root *root, struct rb_entry *cached_re, unsigned int ofs, struct rb_entry **prev_entry,
fs/f2fs/f2fs.h +44 -3
75 lines not on this page · raw message
fs/f2fs/segment.c +183 -40
285 lines not on this page · raw message
Signature · 6 lines
2.12.2.510.ge1104a5ee539 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot