• Home
  • Raw
  • Download

Lines Matching refs:fsck

21 	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_clear_main_bitmap() local
53 fsck->main_area_bitmap); in f2fs_clear_main_bitmap()
58 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in f2fs_test_sit_bitmap() local
60 return f2fs_test_bit(BLKOFF_FROM_MAIN(sbi, blk), fsck->sit_area_bitmap); in f2fs_test_sit_bitmap()
65 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in f2fs_set_sit_bitmap() local
67 return f2fs_set_bit(BLKOFF_FROM_MAIN(sbi, blk), fsck->sit_area_bitmap); in f2fs_set_sit_bitmap()
73 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in add_into_hard_link_list() local
84 if (fsck->hard_link_list_head == NULL) { in add_into_hard_link_list()
85 fsck->hard_link_list_head = node; in add_into_hard_link_list()
89 tmp = fsck->hard_link_list_head; in add_into_hard_link_list()
98 if (tmp == fsck->hard_link_list_head) { in add_into_hard_link_list()
100 fsck->hard_link_list_head = node; in add_into_hard_link_list()
113 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in find_and_dec_hard_link_list() local
116 if (fsck->hard_link_list_head == NULL) in find_and_dec_hard_link_list()
119 node = fsck->hard_link_list_head; in find_and_dec_hard_link_list()
135 if (fsck->hard_link_list_head == node) in find_and_dec_hard_link_list()
136 fsck->hard_link_list_head = node->next; in find_and_dec_hard_link_list()
394 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in sanity_check_nid() local
478 f2fs_test_bit(nid, fsck->nat_area_bitmap) != 0) { in sanity_check_nid()
479 f2fs_clear_bit(nid, fsck->nat_area_bitmap); in sanity_check_nid()
497 fsck->chk.valid_blk_cnt++; in sanity_check_nid()
498 fsck->chk.valid_node_cnt++; in sanity_check_nid()
504 if (sbi->fsck->chk.checked_node_cnt++ % p10) in sanity_check_nid()
508 sbi->fsck->chk.checked_node_cnt, in sanity_check_nid()
510 10 * (float)sbi->fsck->chk.checked_node_cnt / in sanity_check_nid()
568 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_node_blk() local
572 quota_add_inode_usage(fsck->qctx, nid, &node_blk->i); in fsck_chk_node_blk()
694 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_inode_blk() local
737 fsck->chk.valid_inode_cnt++; in fsck_chk_inode_blk()
751 fsck->chk.multi_hard_link_files++; in fsck_chk_inode_blk()
960 fsck->chk.valid_blk_cnt++; in fsck_chk_inode_blk()
1391 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in print_dentry() local
1392 u32 depth = fsck->dentry_depth; in print_dentry()
1428 struct f2fs_dentry *d = fsck->dentry; in print_dentry()
1577 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in __chk_dentries() local
1714 fsck->dentry_depth, i, en, name_len, in __chk_dentries()
1755 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_inline_dentries() local
1756 struct f2fs_dentry *cur_dentry = fsck->dentry_end; in fsck_chk_inline_dentries()
1767 fsck->dentry_depth++; in fsck_chk_inline_dentries()
1771 new_dentry->depth = fsck->dentry_depth; in fsck_chk_inline_dentries()
1774 fsck->dentry_end = new_dentry; in fsck_chk_inline_dentries()
1781 fsck->dentry_depth); in fsck_chk_inline_dentries()
1785 fsck->dentry_depth, dentries, in fsck_chk_inline_dentries()
1788 fsck->dentry = cur_dentry; in fsck_chk_inline_dentries()
1789 fsck->dentry_end = cur_dentry; in fsck_chk_inline_dentries()
1792 fsck->dentry_depth--; in fsck_chk_inline_dentries()
1799 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_dentry_blk() local
1801 struct f2fs_dentry *cur_dentry = fsck->dentry_end; in fsck_chk_dentry_blk()
1811 fsck->dentry_depth++; in fsck_chk_dentry_blk()
1814 new_dentry->depth = fsck->dentry_depth; in fsck_chk_dentry_blk()
1817 fsck->dentry_end = new_dentry; in fsck_chk_dentry_blk()
1828 fsck->dentry_depth, blk_addr); in fsck_chk_dentry_blk()
1832 fsck->dentry_depth, blk_addr, dentries, in fsck_chk_dentry_blk()
1835 fsck->dentry = cur_dentry; in fsck_chk_dentry_blk()
1836 fsck->dentry_end = cur_dentry; in fsck_chk_dentry_blk()
1839 fsck->dentry_depth--; in fsck_chk_dentry_blk()
1849 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_data_blk() local
1853 fsck->chk.valid_blk_cnt++; in fsck_chk_data_blk()
1876 fsck->chk.valid_blk_cnt++; in fsck_chk_data_blk()
2008 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_quota_files() local
2016 if (!fsck->qctx) in fsck_chk_quota_files()
2055 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_meta() local
2074 if (fsck->chk.sit_free_segs + sit_valid_segs != in fsck_chk_meta()
2078 fsck->chk.sit_free_segs, sit_valid_segs, in fsck_chk_meta()
2084 if (fsck->chk.valid_nat_entry_cnt != sit_node_blks) { in fsck_chk_meta()
2087 fsck->chk.valid_nat_entry_cnt, sit_node_blks); in fsck_chk_meta()
2092 if (fsck->chk.sit_free_segs != le32_to_cpu(cp->free_segment_count)) { in fsck_chk_meta()
2095 fsck->chk.sit_free_segs, in fsck_chk_meta()
2101 if (fsck->chk.valid_nat_entry_cnt != in fsck_chk_meta()
2105 fsck->chk.valid_nat_entry_cnt, in fsck_chk_meta()
2115 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_chk_meta()
2116 u32 blk = le32_to_cpu(fsck->entries[i].block_addr); in fsck_chk_meta()
2117 nid_t ino = le32_to_cpu(fsck->entries[i].ino); in fsck_chk_meta()
2143 ino, fsck->nr_nat_entries); in fsck_chk_meta()
2147 if (!f2fs_test_bit(ino, fsck->nat_area_bitmap)) { in fsck_chk_meta()
2158 if (fsck->nat_valid_inode_cnt != le32_to_cpu(cp->valid_inode_count)) { in fsck_chk_meta()
2161 fsck->nat_valid_inode_cnt, in fsck_chk_meta()
2184 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_init() local
2196 fsck->nr_main_blks = sm_i->main_segments << sbi->log_blocks_per_seg; in fsck_init()
2197 fsck->main_area_bitmap_sz = (fsck->nr_main_blks + 7) / 8; in fsck_init()
2198 fsck->main_area_bitmap = calloc(fsck->main_area_bitmap_sz, 1); in fsck_init()
2199 ASSERT(fsck->main_area_bitmap != NULL); in fsck_init()
2208 fsck->dentry = calloc(sizeof(struct f2fs_dentry), 1); in fsck_init()
2209 ASSERT(fsck->dentry != NULL); in fsck_init()
2210 memcpy(fsck->dentry->name, "/", 1); in fsck_init()
2211 fsck->dentry_end = fsck->dentry; in fsck_init()
2218 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_hard_links() local
2224 if (fsck->hard_link_list_head == NULL) in fix_hard_links()
2230 node = fsck->hard_link_list_head; in fix_hard_links()
2253 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_nat_entries() local
2256 for (i = 0; i < fsck->nr_nat_entries; i++) in fix_nat_entries()
2257 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) in fix_nat_entries()
2307 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_checkpoint() local
2349 set_cp(valid_block_count, fsck->chk.valid_blk_cnt); in fix_checkpoint()
2350 set_cp(valid_node_count, fsck->chk.valid_node_cnt); in fix_checkpoint()
2351 set_cp(valid_inode_count, fsck->chk.valid_inode_cnt); in fix_checkpoint()
2439 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in check_curseg_write_pointer() local
2483 fsck->chk.wp_inconsistent_zones++; in check_curseg_write_pointer()
2517 fsck->chk.wp_inconsistent_zones++; in check_curseg_write_pointer()
2728 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file_dnode() local
2741 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file_dnode()
2742 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_dnode()
2749 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_dnode()
2761 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file_idnode() local
2774 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file_idnode()
2775 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_idnode()
2791 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file_didnode() local
2804 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file_didnode()
2805 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_didnode()
2825 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file() local
2839 fsck->chk.valid_inode_cnt--; in fsck_failed_reconnect_file()
2840 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file()
2841 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file()
2847 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file()
2848 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file()
2860 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file()
2901 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_reconnect_file() local
2913 reconnect_bitmap = calloc(fsck->nat_area_bitmap_sz, 1); in fsck_reconnect_file()
2916 for (nid = 0; nid < fsck->nr_nat_entries; nid++) { in fsck_reconnect_file()
2917 if (f2fs_test_bit(nid, fsck->nat_area_bitmap)) { in fsck_reconnect_file()
2963 for (nid = 0; nid < fsck->nr_nat_entries; nid++) { in fsck_reconnect_file()
2976 quota_add_inode_usage(fsck->qctx, nid, &node->i); in fsck_reconnect_file()
3003 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in chk_and_fix_wp_with_sit() local
3044 fsck->chk.wp_inconsistent_zones++; in chk_and_fix_wp_with_sit()
3056 fsck->chk.wp_fixed = 1; in chk_and_fix_wp_with_sit()
3112 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_and_fix_write_pointers() local
3119 fsck->chk.wp_fixed = 1; in fsck_chk_and_fix_write_pointers()
3175 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_verify() local
3186 if (fsck->chk.wp_inconsistent_zones == 0x0) { in fsck_verify()
3190 fsck->chk.wp_inconsistent_zones); in fsck_verify()
3194 if (fsck->chk.wp_fixed && c.fix_on) in fsck_verify()
3199 for (i = 0; i < fsck->nr_nat_entries; i++) in fsck_verify()
3200 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) in fsck_verify()
3202 if (i < fsck->nr_nat_entries) { in fsck_verify()
3208 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_verify()
3209 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) { in fsck_verify()
3219 if (fsck->hard_link_list_head != NULL) { in fsck_verify()
3220 node = fsck->hard_link_list_head; in fsck_verify()
3241 if (memcmp(fsck->sit_area_bitmap, fsck->main_area_bitmap, in fsck_verify()
3242 fsck->sit_area_bitmap_sz) == 0x0) { in fsck_verify()
3250 if (fsck->hard_link_list_head == NULL) { in fsck_verify()
3251 printf(" [Ok..] [0x%x]\n", fsck->chk.multi_hard_link_files); in fsck_verify()
3253 printf(" [Fail] [0x%x]\n", fsck->chk.multi_hard_link_files); in fsck_verify()
3258 if (sbi->total_valid_block_count == fsck->chk.valid_blk_cnt) { in fsck_verify()
3259 printf(" [Ok..] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt); in fsck_verify()
3261 printf(" [Fail] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt); in fsck_verify()
3266 if (sbi->total_valid_node_count == fsck->chk.valid_node_cnt) { in fsck_verify()
3267 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_node_cnt); in fsck_verify()
3269 printf(" [Fail] [0x%x]\n", fsck->chk.valid_node_cnt); in fsck_verify()
3274 if (sbi->total_valid_node_count == fsck->chk.valid_nat_entry_cnt) { in fsck_verify()
3275 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_nat_entry_cnt); in fsck_verify()
3277 printf(" [Fail] [0x%x]\n", fsck->chk.valid_nat_entry_cnt); in fsck_verify()
3282 if (sbi->total_valid_inode_count == fsck->chk.valid_inode_cnt) { in fsck_verify()
3283 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_inode_cnt); in fsck_verify()
3285 printf(" [Fail] [0x%x]\n", fsck->chk.valid_inode_cnt); in fsck_verify()
3291 fsck->chk.sit_free_segs) { in fsck_verify()
3292 printf(" [Ok..] [0x%x]\n", fsck->chk.sit_free_segs); in fsck_verify()
3294 printf(" [Fail] [0x%x]\n", fsck->chk.sit_free_segs); in fsck_verify()
3332 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_verify()
3333 if (f2fs_test_bit(i, fsck->nat_area_bitmap)) in fsck_verify()
3366 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_free() local
3368 if (fsck->qctx) in fsck_free()
3369 quota_release_context(&fsck->qctx); in fsck_free()
3371 if (fsck->main_area_bitmap) in fsck_free()
3372 free(fsck->main_area_bitmap); in fsck_free()
3374 if (fsck->nat_area_bitmap) in fsck_free()
3375 free(fsck->nat_area_bitmap); in fsck_free()
3377 if (fsck->sit_area_bitmap) in fsck_free()
3378 free(fsck->sit_area_bitmap); in fsck_free()
3380 if (fsck->entries) in fsck_free()
3381 free(fsck->entries); in fsck_free()
3386 while (fsck->dentry) { in fsck_free()
3387 struct f2fs_dentry *dentry = fsck->dentry; in fsck_free()
3389 fsck->dentry = fsck->dentry->next; in fsck_free()