diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-09-22 21:07:47 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-09 16:20:53 -0700 |
commit | 4abd3f5ac49314fe345566ec859b8e60993207bf (patch) | |
tree | 9f7630f55ba33d0ad7c3071bbe27ed9c92b8dc9e /fs/f2fs/extent_cache.c | |
parent | 545fe4210df5eb4097aa17c68f0f153db27bcf44 (diff) | |
download | op-kernel-dev-4abd3f5ac49314fe345566ec859b8e60993207bf.zip op-kernel-dev-4abd3f5ac49314fe345566ec859b8e60993207bf.tar.gz |
f2fs: introduce __try_update_largest_extent
This patch adds a new helper __try_update_largest_extent for cleanup.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/extent_cache.c')
-rw-r--r-- | fs/f2fs/extent_cache.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index c9d1cfd..a38ee9b 100644 --- a/fs/f2fs/extent_cache.c +++ b/fs/f2fs/extent_cache.c @@ -351,8 +351,7 @@ static struct extent_node *__try_merge_extent_node(struct f2fs_sb_info *sbi, } if (en) { - if (en->ei.len > et->largest.len) - et->largest = en->ei; + __try_update_largest_extent(et, en); et->cached_en = en; } return en; @@ -389,8 +388,7 @@ do_insert: if (!en) return NULL; - if (en->ei.len > et->largest.len) - et->largest = en->ei; + __try_update_largest_extent(et, en); et->cached_en = en; return en; } @@ -476,12 +474,10 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode, : NULL; } - if (parts) { - if (en->ei.len > et->largest.len) - et->largest = en->ei; - } else { + if (parts) + __try_update_largest_extent(et, en); + else __detach_extent_node(sbi, et, en); - } /* * if original extent is split into zero or two parts, extent |