f2fs: introduce is_cur{seg,sec}()
authorChao Yu <chao@kernel.org>
Mon, 7 Jul 2025 11:46:14 +0000 (19:46 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 9 Jul 2025 18:02:20 +0000 (18:02 +0000)
commitc1cfc87e49525853ebe9dce2ffce6332eb811fa6
treef568cbe2c5d2f368c59509138e2127922c83cf59
parenta509a55f8eecc8970b3980c6f06886bbff0e2f68
f2fs: introduce is_cur{seg,sec}()

There are redundant codes in IS_CUR{SEG,SEC}() macros, let's introduce
inline is_cur{seg,sec}() functions, and use a loop in it for cleanup.

Meanwhile, it enhances expansibility, as it doesn't need to change
is_cur{seg,sec}() when we add a new log header.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/debug.c
fs/f2fs/gc.c
fs/f2fs/segment.c
fs/f2fs/segment.h