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()
382 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in sanity_check_nid() local
466 f2fs_test_bit(nid, fsck->nat_area_bitmap) != 0) { in sanity_check_nid()
467 f2fs_clear_bit(nid, fsck->nat_area_bitmap); in sanity_check_nid()
484 fsck->chk.valid_blk_cnt++; in sanity_check_nid()
485 fsck->chk.valid_node_cnt++; in sanity_check_nid()
532 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_node_blk() local
535 quota_add_inode_usage(fsck->qctx, nid, &node_blk->i); in fsck_chk_node_blk()
656 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_inode_blk() local
677 fsck->chk.valid_inode_cnt++; in fsck_chk_inode_blk()
689 fsck->chk.multi_hard_link_files++; in fsck_chk_inode_blk()
1378 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in __chk_dentries() local
1513 fsck->dentry_depth, i, en, name_len, in __chk_dentries()
1517 print_dentry(fsck->dentry_depth, name, bitmap, in __chk_dentries()
1552 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_inline_dentries() local
1562 fsck->dentry_depth++; in fsck_chk_inline_dentries()
1568 fsck->dentry_depth); in fsck_chk_inline_dentries()
1572 fsck->dentry_depth, dentries, in fsck_chk_inline_dentries()
1575 fsck->dentry_depth--; in fsck_chk_inline_dentries()
1582 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_dentry_blk() local
1592 fsck->dentry_depth++; in fsck_chk_dentry_blk()
1602 fsck->dentry_depth, blk_addr); in fsck_chk_dentry_blk()
1606 fsck->dentry_depth, blk_addr, dentries, in fsck_chk_dentry_blk()
1609 fsck->dentry_depth--; in fsck_chk_dentry_blk()
1619 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_data_blk() local
1623 fsck->chk.valid_blk_cnt++; in fsck_chk_data_blk()
1646 fsck->chk.valid_blk_cnt++; in fsck_chk_data_blk()
1760 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_quota_files() local
1768 if (!fsck->qctx) in fsck_chk_quota_files()
1807 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_chk_meta() local
1826 if (fsck->chk.sit_free_segs + sit_valid_segs != TOTAL_SEGS(sbi)) { in fsck_chk_meta()
1829 fsck->chk.sit_free_segs, sit_valid_segs, in fsck_chk_meta()
1835 if (fsck->chk.valid_nat_entry_cnt != sit_node_blks) { in fsck_chk_meta()
1838 fsck->chk.valid_nat_entry_cnt, sit_node_blks); in fsck_chk_meta()
1843 if (fsck->chk.sit_free_segs != le32_to_cpu(cp->free_segment_count)) { in fsck_chk_meta()
1846 fsck->chk.sit_free_segs, in fsck_chk_meta()
1852 if (fsck->chk.valid_nat_entry_cnt != in fsck_chk_meta()
1856 fsck->chk.valid_nat_entry_cnt, in fsck_chk_meta()
1866 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_chk_meta()
1867 u32 blk = le32_to_cpu(fsck->entries[i].block_addr); in fsck_chk_meta()
1868 nid_t ino = le32_to_cpu(fsck->entries[i].ino); in fsck_chk_meta()
1894 ino, fsck->nr_nat_entries); in fsck_chk_meta()
1898 if (!f2fs_test_bit(ino, fsck->nat_area_bitmap)) { in fsck_chk_meta()
1909 if (fsck->nat_valid_inode_cnt != le32_to_cpu(cp->valid_inode_count)) { in fsck_chk_meta()
1912 fsck->nat_valid_inode_cnt, in fsck_chk_meta()
1922 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_init() local
1934 fsck->nr_main_blks = sm_i->main_segments << sbi->log_blocks_per_seg; in fsck_init()
1935 fsck->main_area_bitmap_sz = (fsck->nr_main_blks + 7) / 8; in fsck_init()
1936 fsck->main_area_bitmap = calloc(fsck->main_area_bitmap_sz, 1); in fsck_init()
1937 ASSERT(fsck->main_area_bitmap != NULL); in fsck_init()
1950 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_hard_links() local
1956 if (fsck->hard_link_list_head == NULL) in fix_hard_links()
1962 node = fsck->hard_link_list_head; in fix_hard_links()
1985 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_nat_entries() local
1988 for (i = 0; i < fsck->nr_nat_entries; i++) in fix_nat_entries()
1989 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) in fix_nat_entries()
2022 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fix_checkpoint() local
2055 set_cp(valid_block_count, fsck->chk.valid_blk_cnt); in fix_checkpoint()
2056 set_cp(valid_node_count, fsck->chk.valid_node_cnt); in fix_checkpoint()
2057 set_cp(valid_inode_count, fsck->chk.valid_inode_cnt); in fix_checkpoint()
2254 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file_dnode() local
2267 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file_dnode()
2268 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_dnode()
2275 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_dnode()
2287 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file_idnode() local
2300 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file_idnode()
2301 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_idnode()
2317 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file_didnode() local
2330 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file_didnode()
2331 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file_didnode()
2351 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_failed_reconnect_file() local
2365 fsck->chk.valid_inode_cnt--; in fsck_failed_reconnect_file()
2366 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file()
2367 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file()
2373 fsck->chk.valid_node_cnt--; in fsck_failed_reconnect_file()
2374 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file()
2386 fsck->chk.valid_blk_cnt--; in fsck_failed_reconnect_file()
2427 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_reconnect_file() local
2438 reconnect_bitmap = calloc(fsck->nat_area_bitmap_sz, 1); in fsck_reconnect_file()
2441 for (nid = 0; nid < fsck->nr_nat_entries; nid++) { in fsck_reconnect_file()
2442 if (f2fs_test_bit(nid, fsck->nat_area_bitmap)) { in fsck_reconnect_file()
2486 for (nid = 0; nid < fsck->nr_nat_entries; nid++) { in fsck_reconnect_file()
2499 quota_add_inode_usage(fsck->qctx, nid, &node->i); in fsck_reconnect_file()
2558 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_verify() local
2564 for (i = 0; i < fsck->nr_nat_entries; i++) in fsck_verify()
2565 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) in fsck_verify()
2567 if (i < fsck->nr_nat_entries) { in fsck_verify()
2573 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_verify()
2574 if (f2fs_test_bit(i, fsck->nat_area_bitmap) != 0) { in fsck_verify()
2584 if (fsck->hard_link_list_head != NULL) { in fsck_verify()
2585 node = fsck->hard_link_list_head; in fsck_verify()
2604 if (memcmp(fsck->sit_area_bitmap, fsck->main_area_bitmap, in fsck_verify()
2605 fsck->sit_area_bitmap_sz) == 0x0) { in fsck_verify()
2614 if (fsck->hard_link_list_head == NULL) { in fsck_verify()
2615 printf(" [Ok..] [0x%x]\n", fsck->chk.multi_hard_link_files); in fsck_verify()
2617 printf(" [Fail] [0x%x]\n", fsck->chk.multi_hard_link_files); in fsck_verify()
2623 if (sbi->total_valid_block_count == fsck->chk.valid_blk_cnt) { in fsck_verify()
2624 printf(" [Ok..] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt); in fsck_verify()
2626 printf(" [Fail] [0x%x]\n", (u32)fsck->chk.valid_blk_cnt); in fsck_verify()
2632 if (sbi->total_valid_node_count == fsck->chk.valid_node_cnt) { in fsck_verify()
2633 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_node_cnt); in fsck_verify()
2635 printf(" [Fail] [0x%x]\n", fsck->chk.valid_node_cnt); in fsck_verify()
2641 if (sbi->total_valid_node_count == fsck->chk.valid_nat_entry_cnt) { in fsck_verify()
2642 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_nat_entry_cnt); in fsck_verify()
2644 printf(" [Fail] [0x%x]\n", fsck->chk.valid_nat_entry_cnt); in fsck_verify()
2650 if (sbi->total_valid_inode_count == fsck->chk.valid_inode_cnt) { in fsck_verify()
2651 printf(" [Ok..] [0x%x]\n", fsck->chk.valid_inode_cnt); in fsck_verify()
2653 printf(" [Fail] [0x%x]\n", fsck->chk.valid_inode_cnt); in fsck_verify()
2660 fsck->chk.sit_free_segs) { in fsck_verify()
2661 printf(" [Ok..] [0x%x]\n", fsck->chk.sit_free_segs); in fsck_verify()
2663 printf(" [Fail] [0x%x]\n", fsck->chk.sit_free_segs); in fsck_verify()
2697 for (i = 0; i < fsck->nr_nat_entries; i++) { in fsck_verify()
2698 if (f2fs_test_bit(i, fsck->nat_area_bitmap)) in fsck_verify()
2730 struct f2fs_fsck *fsck = F2FS_FSCK(sbi); in fsck_free() local
2732 if (fsck->qctx) in fsck_free()
2733 quota_release_context(&fsck->qctx); in fsck_free()
2735 if (fsck->main_area_bitmap) in fsck_free()
2736 free(fsck->main_area_bitmap); in fsck_free()
2738 if (fsck->nat_area_bitmap) in fsck_free()
2739 free(fsck->nat_area_bitmap); in fsck_free()
2741 if (fsck->sit_area_bitmap) in fsck_free()
2742 free(fsck->sit_area_bitmap); in fsck_free()
2744 if (fsck->entries) in fsck_free()
2745 free(fsck->entries); in fsck_free()