aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/f2fs_fs.h
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2019-04-22 17:33:52 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2019-05-08 21:23:11 -0700
commitd7eb8f1cdfaefcd41b716ef0ed1745b43c6c4fc9 (patch)
treeddf6ee63a9da804b93a422f3b3570c1ab406c449 /include/linux/f2fs_fs.h
parentf2fs: Replace spaces with tab (diff)
downloadwireguard-linux-d7eb8f1cdfaefcd41b716ef0ed1745b43c6c4fc9.tar.xz
wireguard-linux-d7eb8f1cdfaefcd41b716ef0ed1745b43c6c4fc9.zip
f2fs: allow unfixed f2fs_checkpoint.checksum_offset
Previously, f2fs_checkpoint.checksum_offset points fixed position of f2fs_checkpoint structure: "#define CP_CHKSUM_OFFSET 4092" It is unnecessary, and it breaks the consecutiveness of nat and sit bitmap stored across checkpoint park block and payload blocks. This patch allows f2fs to handle unfixed .checksum_offset. In addition, for the case checksum value is stored in the middle of checkpoint park, calculating checksum value with superposition method like we did for inode_checksum. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/linux/f2fs_fs.h')
-rw-r--r--include/linux/f2fs_fs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 55da9abed023..65559900d4d7 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -164,6 +164,10 @@ struct f2fs_checkpoint {
unsigned char sit_nat_version_bitmap[1];
} __packed;
+#define CP_CHKSUM_OFFSET 4092 /* default chksum offset in checkpoint */
+#define CP_MIN_CHKSUM_OFFSET \
+ (offsetof(struct f2fs_checkpoint, sit_nat_version_bitmap))
+
/*
* For orphan inode management
*/