f2fs-tools: rename CHECKSUM_OFFSET to CP_CHKSUM_OFFSET
authorJunling Zheng <zhengjunling@huawei.com>
Wed, 19 Sep 2018 13:53:48 +0000 (21:53 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 21 Nov 2018 19:38:23 +0000 (11:38 -0800)
This patch renamed CHECKSUM_OFFSET to CP_CHKSUM_OFFSET.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/fsck.c
fsck/mount.c
fsck/resize.c
include/f2fs_fs.h
mkfs/f2fs_format.c

index 473372d..19220e2 100644 (file)
@@ -2010,8 +2010,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi)
        set_cp(valid_node_count, fsck->chk.valid_node_cnt);
        set_cp(valid_inode_count, fsck->chk.valid_inode_cnt);
 
-       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CHECKSUM_OFFSET);
-       *((__le32 *)((unsigned char *)cp + CHECKSUM_OFFSET)) = cpu_to_le32(crc);
+       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CP_CHKSUM_OFFSET);
+       *((__le32 *)((unsigned char *)cp + CP_CHKSUM_OFFSET)) = cpu_to_le32(crc);
 
        cp_blk_no = get_sb(cp_blkaddr);
        if (sbi->cur_cp == 2)
index 8816a8a..2b0289e 100644 (file)
@@ -2250,8 +2250,8 @@ void write_checkpoint(struct f2fs_sb_info *sbi)
        flags = update_nat_bits_flags(sb, cp, flags);
        set_cp(ckpt_flags, flags);
 
-       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CHECKSUM_OFFSET);
-       *((__le32 *)((unsigned char *)cp + CHECKSUM_OFFSET)) = cpu_to_le32(crc);
+       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CP_CHKSUM_OFFSET);
+       *((__le32 *)((unsigned char *)cp + CP_CHKSUM_OFFSET)) = cpu_to_le32(crc);
 
        cp_blk_no = get_sb(cp_blkaddr);
        if (sbi->cur_cp == 2)
index 8c2600f..c0a2641 100644 (file)
@@ -87,10 +87,10 @@ static int get_new_sb(struct f2fs_super_block *sb)
                 * It requires more pages for cp.
                 */
                if (max_sit_bitmap_size > MAX_SIT_BITMAP_SIZE_IN_CKPT) {
-                       max_nat_bitmap_size = CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1;
+                       max_nat_bitmap_size = CP_CHKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1;
                        set_sb(cp_payload, F2FS_BLK_ALIGN(max_sit_bitmap_size));
                } else {
-                       max_nat_bitmap_size = CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1
+                       max_nat_bitmap_size = CP_CHKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1
                                - max_sit_bitmap_size;
                        set_sb(cp_payload, 0);
                }
@@ -516,8 +516,8 @@ static void rebuild_checkpoint(struct f2fs_sb_info *sbi,
                                                (unsigned char *)cp);
        new_cp->checkpoint_ver = cpu_to_le64(cp_ver + 1);
 
-       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, new_cp, CHECKSUM_OFFSET);
-       *((__le32 *)((unsigned char *)new_cp + CHECKSUM_OFFSET)) =
+       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, new_cp, CP_CHKSUM_OFFSET);
+       *((__le32 *)((unsigned char *)new_cp + CP_CHKSUM_OFFSET)) =
                                                        cpu_to_le32(crc);
 
        /* Write a new checkpoint in the other set */
index a86e374..dab8b40 100644 (file)
@@ -278,7 +278,7 @@ static inline uint64_t bswap_64(uint64_t val)
 #define PAGE_CACHE_SIZE                4096
 #define BITS_PER_BYTE          8
 #define F2FS_SUPER_MAGIC       0xF2F52010      /* F2FS Magic Number */
-#define CHECKSUM_OFFSET                4092
+#define CP_CHKSUM_OFFSET       4092
 #define MAX_PATH_LEN           64
 #define MAX_DEVICES            8
 
@@ -679,9 +679,9 @@ struct f2fs_checkpoint {
 } __attribute__((packed));
 
 #define MAX_SIT_BITMAP_SIZE_IN_CKPT    \
-       (CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1 - 64)
+       (CP_CHKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1 - 64)
 #define MAX_BITMAP_SIZE_IN_CKPT        \
-       (CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1)
+       (CP_CHKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1)
 
 /*
  * For orphan inode management
index 4b88d93..621126c 100644 (file)
@@ -342,12 +342,12 @@ static int f2fs_prepare_super_block(void)
                 * It requires more pages for cp.
                 */
                if (max_sit_bitmap_size > MAX_SIT_BITMAP_SIZE_IN_CKPT) {
-                       max_nat_bitmap_size = CHECKSUM_OFFSET -
+                       max_nat_bitmap_size = CP_CHKSUM_OFFSET -
                                        sizeof(struct f2fs_checkpoint) + 1;
                        set_sb(cp_payload, F2FS_BLK_ALIGN(max_sit_bitmap_size));
                } else {
                        max_nat_bitmap_size =
-                               CHECKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1
+                               CP_CHKSUM_OFFSET - sizeof(struct f2fs_checkpoint) + 1
                                - max_sit_bitmap_size;
                        set_sb(cp_payload, 0);
                }
@@ -684,10 +684,10 @@ static int f2fs_write_check_point_pack(void)
        set_cp(nat_ver_bitmap_bytesize, ((get_sb(segment_count_nat) / 2) <<
                         get_sb(log_blocks_per_seg)) / 8);
 
-       set_cp(checksum_offset, CHECKSUM_OFFSET);
+       set_cp(checksum_offset, CP_CHKSUM_OFFSET);
 
-       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CHECKSUM_OFFSET);
-       *((__le32 *)((unsigned char *)cp + CHECKSUM_OFFSET)) =
+       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CP_CHKSUM_OFFSET);
+       *((__le32 *)((unsigned char *)cp + CP_CHKSUM_OFFSET)) =
                                                        cpu_to_le32(crc);
 
        blk_size_bytes = 1 << get_sb(log_blocksize);
@@ -932,8 +932,8 @@ static int f2fs_write_check_point_pack(void)
         */
        cp->checkpoint_ver = 0;
 
-       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CHECKSUM_OFFSET);
-       *((__le32 *)((unsigned char *)cp + CHECKSUM_OFFSET)) =
+       crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CP_CHKSUM_OFFSET);
+       *((__le32 *)((unsigned char *)cp + CP_CHKSUM_OFFSET)) =
                                                        cpu_to_le32(crc);
        cp_seg_blk = get_sb(segment0_blkaddr) + c.blks_per_seg;
        DBG(1, "\tWriting cp page 1 of checkpoint pack 2, at offset 0x%08"PRIx64"\n",