Lines Matching refs:fsck
19 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in f2fs_set_main_bitmap() local
37 return f2fs_set_bit(BLKOFF_FROM_MAIN(sbi, blk), fsck->main_area_bitmap); in f2fs_set_main_bitmap()
42 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in f2fs_test_main_bitmap() local
45 fsck->main_area_bitmap); in f2fs_test_main_bitmap()
50 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in f2fs_test_sit_bitmap() local
52 return f2fs_test_bit(BLKOFF_FROM_MAIN(sbi, blk), fsck->sit_area_bitmap); in f2fs_test_sit_bitmap()
58 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in add_into_hard_link_list() local
68 if (fsck->hard_link_list_head == NULL) { in add_into_hard_link_list()
69 fsck->hard_link_list_head = node; in add_into_hard_link_list()
73 tmp = fsck->hard_link_list_head; in add_into_hard_link_list()
82 if (tmp == fsck->hard_link_list_head) { in add_into_hard_link_list()
84 fsck->hard_link_list_head = node; in add_into_hard_link_list()
97 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in find_and_dec_hard_link_list() local
100 if (fsck->hard_link_list_head == NULL) in find_and_dec_hard_link_list()
103 node = fsck->hard_link_list_head; in find_and_dec_hard_link_list()
118 if (fsck->hard_link_list_head == node) in find_and_dec_hard_link_list()
119 fsck->hard_link_list_head = node->next; in find_and_dec_hard_link_list()
197 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in sanity_check_nid() local
268 f2fs_test_bit(nid, fsck->nat_area_bitmap) != 0) in sanity_check_nid()
269 f2fs_clear_bit(nid, fsck->nat_area_bitmap); in sanity_check_nid()
279 fsck->chk.valid_blk_cnt++; in sanity_check_nid()
280 fsck->chk.valid_node_cnt++; in sanity_check_nid()
364 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_inode_blk() local
374 fsck->chk.valid_inode_cnt++; in fsck_chk_inode_blk()
385 fsck->chk.multi_hard_link_files++; in fsck_chk_inode_blk()
672 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in __chk_dentries() local
758 fsck->dentry_depth, i, name, name_len, in __chk_dentries()
762 print_dentry(fsck->dentry_depth, name, bitmap, in __chk_dentries()
797 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_inline_dentries() local
804 fsck->dentry_depth++; in fsck_chk_inline_dentries()
811 fsck->dentry_depth); in fsck_chk_inline_dentries()
815 fsck->dentry_depth, dentries, in fsck_chk_inline_dentries()
818 fsck->dentry_depth--; in fsck_chk_inline_dentries()
825 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_dentry_blk() local
835 fsck->dentry_depth++; in fsck_chk_dentry_blk()
845 fsck->dentry_depth, blk_addr); in fsck_chk_dentry_blk()
849 fsck->dentry_depth, blk_addr, dentries, in fsck_chk_dentry_blk()
852 fsck->dentry_depth--; in fsck_chk_dentry_blk()
861 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_data_blk() local
865 fsck->chk.valid_blk_cnt++; in fsck_chk_data_blk()
889 fsck->chk.valid_blk_cnt++; in fsck_chk_data_blk()
940 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_init() local
952 fsck->nr_main_blks = sm_i->main_segments << sbi->log_blocks_per_seg; in fsck_init()
953 fsck->main_area_bitmap_sz = (fsck->nr_main_blks + 7) / 8; in fsck_init()
954 fsck->main_area_bitmap = calloc(fsck->main_area_bitmap_sz, 1); in fsck_init()
955 ASSERT(fsck->main_area_bitmap != NULL); in fsck_init()
967 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_nat_entries() local
970 for (i = 0; i < fsck->nr_nat_entries; i++) in fix_nat_entries()
971 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) in fix_nat_entries()
977 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_checkpoint() local
991 ckp->free_segment_count = cpu_to_le32(fsck->chk.free_segs); in fix_checkpoint()
992 ckp->valid_block_count = cpu_to_le32(fsck->chk.valid_blk_cnt); in fix_checkpoint()
993 ckp->valid_node_count = cpu_to_le32(fsck->chk.valid_node_cnt); in fix_checkpoint()
994 ckp->valid_inode_count = cpu_to_le32(fsck->chk.valid_inode_cnt); in fix_checkpoint()
1070 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_verify() local
1075 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_verify()
1076 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) { in fsck_verify()
1082 if (fsck->hard_link_list_head != NULL) { in fsck_verify()
1083 node = fsck->hard_link_list_head; in fsck_verify()
1102 if (memcmp(fsck->sit_area_bitmap, fsck->main_area_bitmap, in fsck_verify()
1103 fsck->sit_area_bitmap_sz) == 0x0) { in fsck_verify()
1112 if (fsck->hard_link_list_head == NULL) { in fsck_verify()
1113 printf(" [Ok..] [0x%x]\n", fsck->chk.multi_hard_link_files); in fsck_verify()
1115 printf(" [Fail] [0x%x]\n", fsck->chk.multi_hard_link_files); in fsck_verify()
1121 if (sbi->total_valid_block_count == fsck->chk.valid_blk_cnt) { in fsck_verify()
1122 printf(" [Ok..] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt); in fsck_verify()
1124 printf(" [Fail] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt); in fsck_verify()
1130 if (sbi->total_valid_node_count == fsck->chk.valid_node_cnt) { in fsck_verify()
1131 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_node_cnt); in fsck_verify()
1133 printf(" [Fail] [0x%x]\n", fsck->chk.valid_node_cnt); in fsck_verify()
1139 if (sbi->total_valid_node_count == fsck->chk.valid_nat_entry_cnt) { in fsck_verify()
1140 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_nat_entry_cnt); in fsck_verify()
1142 printf(" [Fail] [0x%x]\n", fsck->chk.valid_nat_entry_cnt); in fsck_verify()
1148 if (sbi->total_valid_inode_count == fsck->chk.valid_inode_cnt) { in fsck_verify()
1149 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_inode_cnt); in fsck_verify()
1151 printf(" [Fail] [0x%x]\n", fsck->chk.valid_inode_cnt); in fsck_verify()
1158 fsck->chk.sit_free_segs) { in fsck_verify()
1159 printf(" [Ok..] [0x%x]\n", fsck->chk.sit_free_segs); in fsck_verify()
1161 printf(" [Fail] [0x%x]\n", fsck->chk.sit_free_segs); in fsck_verify()
1198 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_free() local
1199 if (fsck->main_area_bitmap) in fsck_free()
1200 free(fsck->main_area_bitmap); in fsck_free()
1202 if (fsck->nat_area_bitmap) in fsck_free()
1203 free(fsck->nat_area_bitmap); in fsck_free()
1205 if (fsck->sit_area_bitmap) in fsck_free()
1206 free(fsck->sit_area_bitmap); in fsck_free()