aboutsummaryrefslogtreecommitdiff
path: root/fsck/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-12-09 20:30:41 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-11 15:57:51 -0800
commit003b102d8a26e82547ecfd89dc36066616b4ffaa (patch)
tree2e0f087cce85e5f88c90c79c3370e44e464e35da /fsck/f2fs.h
parent1a35b5e29df043678b7ce485aee5fb2607d514c8 (diff)
downloadf2fs-tools-003b102d8a26e82547ecfd89dc36066616b4ffaa.tar.gz
fsck.f2fs: LFS alloc_type must have free segment after blkoff
This patch checks alloc_type of current segment type. If it is LFS, the last of segment should have no valid block. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fsck/f2fs.h')
-rw-r--r--fsck/f2fs.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 100854e..03a0646 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -354,6 +354,22 @@ static inline bool IS_VALID_BLK_ADDR(struct f2fs_sb_info *sbi, u32 addr)
return 1;
}
+static inline int IS_CUR_SEGNO(struct f2fs_sb_info *sbi, u32 segno, int type)
+{
+ int i;
+
+ for (i = 0; i < NO_CHECK_TYPE; i++) {
+ struct curseg_info *curseg = CURSEG_I(sbi, i);
+
+ if (type == i)
+ continue;
+
+ if (segno == curseg->segno)
+ return 1;
+ }
+ return 0;
+}
+
static inline u64 BLKOFF_FROM_MAIN(struct f2fs_sb_info *sbi, u64 blk_addr)
{
ASSERT(blk_addr >= SM_I(sbi)->main_blkaddr);