summaryrefslogtreecommitdiff
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-09-22 21:07:47 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-10-09 16:20:53 -0700
commit4abd3f5ac49314fe345566ec859b8e60993207bf (patch)
tree9f7630f55ba33d0ad7c3071bbe27ed9c92b8dc9e /fs/f2fs/f2fs.h
parent545fe4210df5eb4097aa17c68f0f153db27bcf44 (diff)
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/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 79c38adf3ef2..8d6681a33258 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -492,6 +492,13 @@ static inline bool __is_front_mergeable(struct extent_info *cur,
return __is_extent_mergeable(cur, front);
}
+static inline void __try_update_largest_extent(struct extent_tree *et,
+ struct extent_node *en)
+{
+ if (en->ei.len > et->largest.len)
+ et->largest = en->ei;
+}
+
struct f2fs_nm_info {
block_t nat_blkaddr; /* base disk address of NAT */
nid_t max_nid; /* maximum possible node ids */