This patch keeps line with f2fs kernel module for checkpoint update:
1. writeback all blocks inside checkpoint except last cp_park block;
2. fsync;
3. write last cp_park block;
4. fsync;
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
ASSERT(ret >= 0);
}
- ret = dev_write_block(cp, cp_blk_no++);
- ASSERT(ret >= 0);
-
/* Write nat bits */
if (flags & CP_NAT_BITS_FLAG)
write_nat_bits(sbi, sb, cp, sbi->cur_cp);
+
+ ret = f2fs_fsync_device();
+ ASSERT(ret >= 0);
+
+ ret = dev_write_block(cp, cp_blk_no++);
+ ASSERT(ret >= 0);
+
+ ret = f2fs_fsync_device();
+ ASSERT(ret >= 0);
}
int check_curseg_offset(struct f2fs_sb_info *sbi, int type)
/* write the last cp */
ret = dev_write_block(cp, cp_blk_no++);
ASSERT(ret >= 0);
+
+ ret = f2fs_fsync_device();
+ ASSERT(ret >= 0);
}
void build_nat_area_bitmap(struct f2fs_sb_info *sbi)