fsck.f2fs: Remove unused ckpt_valid_map info
authorYunlei He <heyunlei@huawei.com>
Fri, 29 Dec 2017 02:11:09 +0000 (10:11 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 3 Jan 2018 03:25:21 +0000 (19:25 -0800)
Remove unused ckpt_valid_map info.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/f2fs.h
fsck/mount.c

index b7b6305..f5970d9 100644 (file)
@@ -65,12 +65,6 @@ struct f2fs_nm_info {
 struct seg_entry {
        unsigned short valid_blocks;    /* # of valid blocks */
        unsigned char *cur_valid_map;   /* validity bitmap of blocks */
-       /*
-        * # of valid blocks and the validity bitmap stored in the the last
-        * checkpoint pack. This information is used by the SSR mode.
-        */
-       unsigned short ckpt_valid_blocks;
-       unsigned char *ckpt_valid_map;
        unsigned char type;             /* segment type like CURSEG_XXX_TYPE */
        unsigned char orig_type;        /* segment type like CURSEG_XXX_TYPE */
        unsigned long long mtime;       /* modification time of the segment */
index 678eeae..971fc5a 100644 (file)
@@ -1086,10 +1086,7 @@ int build_sit_info(struct f2fs_sb_info *sbi)
        for (start = 0; start < TOTAL_SEGS(sbi); start++) {
                sit_i->sentries[start].cur_valid_map
                        = calloc(SIT_VBLOCK_MAP_SIZE, 1);
-               sit_i->sentries[start].ckpt_valid_map
-                       = calloc(SIT_VBLOCK_MAP_SIZE, 1);
-               if (!sit_i->sentries[start].cur_valid_map
-                               || !sit_i->sentries[start].ckpt_valid_map)
+               if (!sit_i->sentries[start].cur_valid_map)
                        return -ENOMEM;
        }
 
@@ -1396,9 +1393,7 @@ void seg_info_from_raw_sit(struct seg_entry *se,
                struct f2fs_sit_entry *raw_sit)
 {
        se->valid_blocks = GET_SIT_VBLOCKS(raw_sit);
-       se->ckpt_valid_blocks = GET_SIT_VBLOCKS(raw_sit);
        memcpy(se->cur_valid_map, raw_sit->valid_map, SIT_VBLOCK_MAP_SIZE);
-       memcpy(se->ckpt_valid_map, raw_sit->valid_map, SIT_VBLOCK_MAP_SIZE);
        se->type = GET_SIT_TYPE(raw_sit);
        se->orig_type = GET_SIT_TYPE(raw_sit);
        se->mtime = le64_to_cpu(raw_sit->mtime);
@@ -2398,10 +2393,9 @@ void f2fs_do_umount(struct f2fs_sb_info *sbi)
        free(sbi->nm_info);
 
        /* free sit_info */
-       for (i = 0; i < TOTAL_SEGS(sbi); i++) {
+       for (i = 0; i < TOTAL_SEGS(sbi); i++)
                free(sit_i->sentries[i].cur_valid_map);
-               free(sit_i->sentries[i].ckpt_valid_map);
-       }
+
        free(sit_i->sit_bitmap);
        free(sm_i->sit_info);