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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -164,6 +164,10 @@ struct f2fs_checkpoint { · 163 unmodified lines | |||
| 164 | unsigned char sit_nat_version_bitmap[1]; | 164 | unsigned char sit_nat_version_bitmap[1]; |
| 165 | } __packed; | 165 | } __packed; |
| 166 | 166 | ||
| 167 | #define CP_CHKSUM_OFFSET 4092 /* default chksum offset in checkpoint */ | ||
| 168 | #define CP_MIN_CHKSUM_OFFSET \ | ||
| 169 | (offsetof(struct f2fs_checkpoint, sit_nat_version_bitmap)) | ||
| 170 | |||
| 167 | /* | 171 | /* |
| 168 | * For orphan inode management | 172 | * For orphan inode management |
| 169 | */ | 173 | */ |