summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorliuderong <liuderong@oppo.com>2024-09-18 18:06:20 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2024-10-14 20:04:57 +0000
commitb19ee72722087c1d441193ce3b6b3d937ae16bf2 (patch)
treeb9032d2eae6c44ea88ad27cbc693a42fcc1d44fc /fs/f2fs/segment.h
parentMerge tag 'f2fs-6.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ja... (diff)
downloadlinux-b19ee72722087c1d441193ce3b6b3d937ae16bf2.tar.gz
linux-b19ee72722087c1d441193ce3b6b3d937ae16bf2.zip
f2fs: introduce f2fs_get_section_mtime
When segs_per_sec is larger than 1, section may contain invalid segments, mtime should be the average value of each valid blocks, so introduce f2fs_get_section_mtime to record the average mtime of all valid blocks in a section. Signed-off-by: liuderong <liuderong@oppo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 71adb4a43bec..e9cc73093417 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -18,6 +18,8 @@
#define F2FS_MIN_SEGMENTS 9 /* SB + 2 (CP + SIT + NAT) + SSA + MAIN */
#define F2FS_MIN_META_SEGMENTS 8 /* SB + 2 (CP + SIT + NAT) + SSA */
+#define INVALID_MTIME ULLONG_MAX /* no valid blocks in a segment/section */
+
/* L: Logical segment # in volume, R: Relative segment # in main area */
#define GET_L2R_SEGNO(free_i, segno) ((segno) - (free_i)->start_segno)
#define GET_R2L_SEGNO(free_i, segno) ((segno) + (free_i)->start_segno)