• Home
  • Raw
  • Download

Lines Matching refs:pctx

64 static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
92 struct problem_context *pctx; member
246 static void check_immutable(e2fsck_t ctx, struct problem_context *pctx) in check_immutable() argument
248 if (!(pctx->inode->i_flags & BAD_SPECIAL_FLAGS)) in check_immutable()
251 if (!fix_problem(ctx, PR_1_SET_IMMUTABLE, pctx)) in check_immutable()
254 pctx->inode->i_flags &= ~BAD_SPECIAL_FLAGS; in check_immutable()
255 e2fsck_write_inode(ctx, pctx->ino, pctx->inode, "pass1"); in check_immutable()
262 static void check_size(e2fsck_t ctx, struct problem_context *pctx) in check_size() argument
264 struct ext2_inode *inode = pctx->inode; in check_size()
269 if (!fix_problem(ctx, PR_1_SET_NONZSIZE, pctx)) in check_size()
274 e2fsck_write_inode(ctx, pctx->ino, pctx->inode, "pass1"); in check_size()
277 static void check_ea_in_inode(e2fsck_t ctx, struct problem_context *pctx) in check_ea_in_inode() argument
286 inode = (struct ext2_inode_large *) pctx->inode; in check_ea_in_inode()
306 pctx->num = entry->e_name_len; in check_ea_in_inode()
316 pctx->num = entry->e_value_size; in check_ea_in_inode()
323 pctx->num = entry->e_value_block; in check_ea_in_inode()
333 pctx->num = entry->e_hash; in check_ea_in_inode()
347 if (problem == 0 || !fix_problem(ctx, problem, pctx)) in check_ea_in_inode()
352 e2fsck_write_inode_full(ctx, pctx->ino, pctx->inode, in check_ea_in_inode()
356 static void check_inode_extra_space(e2fsck_t ctx, struct problem_context *pctx) in check_inode_extra_space() argument
363 inode = (struct ext2_inode_large *) pctx->inode; in check_inode_extra_space()
370 printf("inode #%u, i_extra_size %d\n", pctx->ino, in check_inode_extra_space()
382 if (!fix_problem(ctx, PR_1_EXTRA_ISIZE, pctx)) in check_inode_extra_space()
385 e2fsck_write_inode_full(ctx, pctx->ino, pctx->inode, in check_inode_extra_space()
394 check_ea_in_inode(ctx, pctx); in check_inode_extra_space()
406 static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx, in check_is_really_dir() argument
409 struct ext2_inode *inode = pctx->inode; in check_is_really_dir()
448 if (ext2fs_bmap2(ctx->fs, pctx->ino, inode, 0, 0, 0, 0, in check_is_really_dir()
492 (dirent->inode != pctx->ino) || in check_is_really_dir()
509 if (fix_problem(ctx, PR_1_TREAT_AS_DIRECTORY, pctx)) { in check_is_really_dir()
511 e2fsck_write_inode_full(ctx, pctx->ino, inode, in check_is_really_dir()
561 struct problem_context pctx; in e2fsck_pass1() local
571 clear_problem_context(&pctx); in e2fsck_pass1()
574 fix_problem(ctx, PR_1_PASS_HEADER, &pctx); in e2fsck_pass1()
603 pctx.errcode = e2fsck_allocate_inode_bitmap(fs, _("in-use inode map"), in e2fsck_pass1()
607 if (pctx.errcode) { in e2fsck_pass1()
608 pctx.num = 1; in e2fsck_pass1()
609 fix_problem(ctx, PR_1_ALLOCATE_IBITMAP_ERROR, &pctx); in e2fsck_pass1()
613 pctx.errcode = e2fsck_allocate_inode_bitmap(fs, in e2fsck_pass1()
617 if (pctx.errcode) { in e2fsck_pass1()
618 pctx.num = 2; in e2fsck_pass1()
619 fix_problem(ctx, PR_1_ALLOCATE_IBITMAP_ERROR, &pctx); in e2fsck_pass1()
623 pctx.errcode = e2fsck_allocate_inode_bitmap(fs, in e2fsck_pass1()
626 if (pctx.errcode) { in e2fsck_pass1()
627 pctx.num = 6; in e2fsck_pass1()
628 fix_problem(ctx, PR_1_ALLOCATE_IBITMAP_ERROR, &pctx); in e2fsck_pass1()
632 pctx.errcode = e2fsck_allocate_subcluster_bitmap(fs, in e2fsck_pass1()
635 if (pctx.errcode) { in e2fsck_pass1()
636 pctx.num = 1; in e2fsck_pass1()
637 fix_problem(ctx, PR_1_ALLOCATE_BBITMAP_ERROR, &pctx); in e2fsck_pass1()
645 pctx.errcode = ext2fs_create_icount2(fs, 0, 0, 0, in e2fsck_pass1()
650 if (pctx.errcode) { in e2fsck_pass1()
651 fix_problem(ctx, PR_1_ALLOCATE_ICOUNT, &pctx); in e2fsck_pass1()
666 pctx.errcode = ext2fs_init_dblist(fs, 0); in e2fsck_pass1()
667 if (pctx.errcode) { in e2fsck_pass1()
668 fix_problem(ctx, PR_1_ALLOCATE_DBCOUNT, &pctx); in e2fsck_pass1()
689 pctx.errcode = ext2fs_convert_subcluster_bitmap(fs, in e2fsck_pass1()
691 if (pctx.errcode) { in e2fsck_pass1()
692 fix_problem(ctx, PR_1_CONVERT_SUBCLUSTER, &pctx); in e2fsck_pass1()
701 pctx.errcode = ext2fs_open_inode_scan(fs, ctx->inode_buffer_blocks, in e2fsck_pass1()
704 if (pctx.errcode) { in e2fsck_pass1()
705 fix_problem(ctx, PR_1_ISCAN_ERROR, &pctx); in e2fsck_pass1()
735 pctx.errcode = ext2fs_get_next_inode_full(scan, &ino, in e2fsck_pass1()
740 if (pctx.errcode == EXT2_ET_BAD_BLOCK_IN_INODE_TABLE) { in e2fsck_pass1()
747 if (pctx.errcode) { in e2fsck_pass1()
748 fix_problem(ctx, PR_1_ISCAN_ERROR, &pctx); in e2fsck_pass1()
754 pctx.ino = ino; in e2fsck_pass1()
755 pctx.inode = inode; in e2fsck_pass1()
758 pctx.errcode = ext2fs_icount_store(ctx->inode_link_info, in e2fsck_pass1()
760 if (pctx.errcode) { in e2fsck_pass1()
761 pctx.num = inode->i_links_count; in e2fsck_pass1()
762 fix_problem(ctx, PR_1_ICOUNT_STORE, &pctx); in e2fsck_pass1()
788 fix_problem(ctx, PR_1_EXTENT_FEATURE, &pctx)) { in e2fsck_pass1()
792 } else if (fix_problem(ctx, PR_1_EXTENTS_SET, &pctx)) { in e2fsck_pass1()
827 (fix_problem(ctx, PR_1_UNSET_EXTENT_FL, &pctx))) { in e2fsck_pass1()
842 fix_problem(ctx, PR_1_INVALID_BAD_INODE, &pctx)) { in e2fsck_pass1()
848 pctx.errcode = ext2fs_copy_bitmap(ctx->block_found_map, in e2fsck_pass1()
850 if (pctx.errcode) { in e2fsck_pass1()
851 pctx.num = 4; in e2fsck_pass1()
852 fix_problem(ctx, PR_1_ALLOCATE_BBITMAP_ERROR, &pctx); in e2fsck_pass1()
863 pb.pctx = &pctx; in e2fsck_pass1()
865 pctx.errcode = ext2fs_block_iterate3(fs, ino, 0, in e2fsck_pass1()
868 if (pctx.errcode) { in e2fsck_pass1()
869 fix_problem(ctx, PR_1_BLOCK_ITERATE, &pctx); in e2fsck_pass1()
874 if (!fix_problem(ctx, PR_1_BBINODE_BAD_METABLOCK_PROMPT, &pctx)) { in e2fsck_pass1()
879 clear_problem_context(&pctx); in e2fsck_pass1()
888 if (fix_problem(ctx, PR_1_ROOT_NO_DIR, &pctx)) in e2fsck_pass1()
901 if (fix_problem(ctx, PR_1_ROOT_DTIME, &pctx)) { in e2fsck_pass1()
912 &pctx)) { in e2fsck_pass1()
917 check_blocks(ctx, &pctx, block_buf); in e2fsck_pass1()
923 &pctx)) { in e2fsck_pass1()
939 &pctx)) { in e2fsck_pass1()
944 check_blocks(ctx, &pctx, block_buf); in e2fsck_pass1()
950 &pctx)) { in e2fsck_pass1()
973 if (fix_problem(ctx, problem, &pctx)) { in e2fsck_pass1()
979 check_blocks(ctx, &pctx, block_buf); in e2fsck_pass1()
1002 if (fix_problem(ctx, PR_1_LOW_DTIME, &pctx)) { in e2fsck_pass1()
1017 PR_1_ZERO_DTIME, &pctx)) { in e2fsck_pass1()
1036 if (fix_problem(ctx, PR_1_SET_DTIME, &pctx)) { in e2fsck_pass1()
1071 if (fix_problem(ctx, PR_1_SET_IMAGIC, &pctx)) { in e2fsck_pass1()
1079 check_inode_extra_space(ctx, &pctx); in e2fsck_pass1()
1080 check_is_really_dir(ctx, &pctx, block_buf); in e2fsck_pass1()
1089 fix_problem(ctx, PR_1_FAST_SYMLINK_EXTENT_FL, &pctx)) { in e2fsck_pass1()
1105 check_immutable(ctx, &pctx); in e2fsck_pass1()
1106 check_size(ctx, &pctx); in e2fsck_pass1()
1110 check_immutable(ctx, &pctx); in e2fsck_pass1()
1111 check_size(ctx, &pctx); in e2fsck_pass1()
1116 check_immutable(ctx, &pctx); in e2fsck_pass1()
1120 check_blocks(ctx, &pctx, block_buf); in e2fsck_pass1()
1126 check_immutable(ctx, &pctx); in e2fsck_pass1()
1127 check_size(ctx, &pctx); in e2fsck_pass1()
1131 check_immutable(ctx, &pctx); in e2fsck_pass1()
1132 check_size(ctx, &pctx); in e2fsck_pass1()
1153 check_blocks(ctx, &pctx, block_buf); in e2fsck_pass1()
1199 clear_problem_context(&pctx); in e2fsck_pass1()
1200 pctx.errcode = ext2fs_create_resize_inode(fs); in e2fsck_pass1()
1201 if (pctx.errcode) { in e2fsck_pass1()
1203 &pctx)) { in e2fsck_pass1()
1207 pctx.errcode = 0; in e2fsck_pass1()
1209 if (!pctx.errcode) { in e2fsck_pass1()
1234 clear_problem_context(&pctx); in e2fsck_pass1()
1235 fix_problem(ctx, PR_1_DUP_BLOCKS_PREENSTOP, &pctx); in e2fsck_pass1()
1283 struct problem_context pctx; in process_inodes() local
1295 clear_problem_context(&pctx); in process_inodes()
1297 pctx.inode = ctx->stashed_inode = &inodes_to_process[i].inode; in process_inodes()
1298 pctx.ino = ctx->stashed_ino = inodes_to_process[i].ino; in process_inodes()
1301 printf("%u ", pctx.ino); in process_inodes()
1304 pctx.ino); in process_inodes()
1306 check_blocks(ctx, &pctx, block_buf); in process_inodes()
1347 struct problem_context pctx; in mark_inode_bad() local
1350 clear_problem_context(&pctx); in mark_inode_bad()
1352 pctx.errcode = e2fsck_allocate_inode_bitmap(ctx->fs, in mark_inode_bad()
1355 if (pctx.errcode) { in mark_inode_bad()
1356 pctx.num = 3; in mark_inode_bad()
1357 fix_problem(ctx, PR_1_ALLOCATE_IBITMAP_ERROR, &pctx); in mark_inode_bad()
1368 struct problem_context pctx; in add_encrypted_dir() local
1371 pctx.errcode = ext2fs_u32_list_create(&ctx->encrypted_dirs, 0); in add_encrypted_dir()
1372 if (pctx.errcode) in add_encrypted_dir()
1375 pctx.errcode = ext2fs_u32_list_add(ctx->encrypted_dirs, ino); in add_encrypted_dir()
1376 if (pctx.errcode == 0) in add_encrypted_dir()
1379 fix_problem(ctx, PR_1_ALLOCATE_ENCRYPTED_DIRLIST, &pctx); in add_encrypted_dir()
1389 struct problem_context pctx; in alloc_bb_map() local
1391 clear_problem_context(&pctx); in alloc_bb_map()
1392 pctx.errcode = e2fsck_allocate_inode_bitmap(ctx->fs, in alloc_bb_map()
1395 if (pctx.errcode) { in alloc_bb_map()
1396 pctx.num = 4; in alloc_bb_map()
1397 fix_problem(ctx, PR_1_ALLOCATE_IBITMAP_ERROR, &pctx); in alloc_bb_map()
1409 struct problem_context pctx; in alloc_imagic_map() local
1411 clear_problem_context(&pctx); in alloc_imagic_map()
1412 pctx.errcode = e2fsck_allocate_inode_bitmap(ctx->fs, in alloc_imagic_map()
1415 if (pctx.errcode) { in alloc_imagic_map()
1416 pctx.num = 5; in alloc_imagic_map()
1417 fix_problem(ctx, PR_1_ALLOCATE_IBITMAP_ERROR, &pctx); in alloc_imagic_map()
1433 struct problem_context pctx; in mark_block_used() local
1435 clear_problem_context(&pctx); in mark_block_used()
1439 pctx.errcode = e2fsck_allocate_block_bitmap(ctx->fs, in mark_block_used()
1443 if (pctx.errcode) { in mark_block_used()
1444 pctx.num = 3; in mark_block_used()
1446 &pctx); in mark_block_used()
1479 struct problem_context pctx; in adjust_extattr_refcount() local
1485 clear_problem_context(&pctx); in adjust_extattr_refcount()
1491 pctx.blk = blk; in adjust_extattr_refcount()
1492 pctx.errcode = ext2fs_read_ext_attr2(fs, blk, block_buf); in adjust_extattr_refcount()
1493 if (pctx.errcode) { in adjust_extattr_refcount()
1494 fix_problem(ctx, PR_1_EXTATTR_READ_ABORT, &pctx); in adjust_extattr_refcount()
1498 pctx.blkcount = header->h_refcount; in adjust_extattr_refcount()
1500 pctx.num = should_be; in adjust_extattr_refcount()
1501 if (fix_problem(ctx, PR_1_EXTATTR_REFCOUNT, &pctx)) { in adjust_extattr_refcount()
1503 pctx.errcode = ext2fs_write_ext_attr2(fs, blk, in adjust_extattr_refcount()
1505 if (pctx.errcode) { in adjust_extattr_refcount()
1507 &pctx); in adjust_extattr_refcount()
1517 static int check_ext_attr(e2fsck_t ctx, struct problem_context *pctx, in check_ext_attr() argument
1521 ext2_ino_t ino = pctx->ino; in check_ext_attr()
1522 struct ext2_inode *inode = pctx->inode; in check_ext_attr()
1550 pctx->errcode = e2fsck_allocate_block_bitmap(fs, in check_ext_attr()
1554 if (pctx->errcode) { in check_ext_attr()
1555 pctx->num = 2; in check_ext_attr()
1556 fix_problem(ctx, PR_1_ALLOCATE_BBITMAP_ERROR, pctx); in check_ext_attr()
1564 pctx->errcode = ea_refcount_create(0, &ctx->refcount); in check_ext_attr()
1565 if (pctx->errcode) { in check_ext_attr()
1566 pctx->num = 1; in check_ext_attr()
1567 fix_problem(ctx, PR_1_ALLOCATE_REFCOUNT, pctx); in check_ext_attr()
1584 pctx->errcode = ea_refcount_create(0, in check_ext_attr()
1586 if (pctx->errcode) { in check_ext_attr()
1587 pctx->num = 2; in check_ext_attr()
1588 fix_problem(ctx, PR_1_ALLOCATE_REFCOUNT, pctx); in check_ext_attr()
1601 pctx->blk = blk; in check_ext_attr()
1602 pctx->errcode = ext2fs_read_ext_attr2(fs, blk, block_buf); in check_ext_attr()
1603 if (pctx->errcode && fix_problem(ctx, PR_1_READ_EA_BLOCK, pctx)) in check_ext_attr()
1606 pctx->blk = ext2fs_file_acl_block(fs, inode); in check_ext_attr()
1611 if (fix_problem(ctx, PR_1_BAD_EA_BLOCK, pctx)) in check_ext_attr()
1616 if (fix_problem(ctx, PR_1_EA_MULTI_BLOCK, pctx)) in check_ext_attr()
1622 fix_problem(ctx, PR_1_EA_ALLOC_REGION_ABORT, pctx); in check_ext_attr()
1627 if (fix_problem(ctx, PR_1_EA_ALLOC_COLLISION, pctx)) in check_ext_attr()
1638 if (fix_problem(ctx, PR_1_EA_ALLOC_COLLISION, pctx)) in check_ext_attr()
1646 if (fix_problem(ctx, PR_1_EA_BAD_NAME, pctx)) in check_ext_attr()
1651 if (fix_problem(ctx, PR_1_EA_BAD_VALUE, pctx)) in check_ext_attr()
1655 if (fix_problem(ctx, PR_1_EA_BAD_VALUE, pctx)) in check_ext_attr()
1662 if (fix_problem(ctx, PR_1_EA_ALLOC_COLLISION, pctx)) in check_ext_attr()
1670 pctx->num = entry->e_hash; in check_ext_attr()
1671 if (fix_problem(ctx, PR_1_ATTR_HASH, pctx)) in check_ext_attr()
1679 if (fix_problem(ctx, PR_1_EA_ALLOC_COLLISION, pctx)) in check_ext_attr()
1700 static int handle_htree(e2fsck_t ctx, struct problem_context *pctx, in handle_htree() argument
1710 fix_problem(ctx, PR_1_HTREE_NODIR, pctx)) || in handle_htree()
1712 fix_problem(ctx, PR_1_HTREE_SET, pctx))) in handle_htree()
1715 pctx->errcode = ext2fs_bmap2(fs, ino, inode, 0, 0, 0, 0, &blk); in handle_htree()
1717 if ((pctx->errcode) || in handle_htree()
1721 if (fix_problem(ctx, PR_1_HTREE_BADROOT, pctx)) in handle_htree()
1728 if (retval && fix_problem(ctx, PR_1_HTREE_BADROOT, pctx)) in handle_htree()
1735 fix_problem(ctx, PR_1_HTREE_BADROOT, pctx)) in handle_htree()
1738 pctx->num = root->hash_version; in handle_htree()
1742 fix_problem(ctx, PR_1_HTREE_HASHV, pctx)) in handle_htree()
1746 fix_problem(ctx, PR_1_HTREE_INCOMPAT, pctx)) in handle_htree()
1749 pctx->num = root->indirect_levels; in handle_htree()
1751 fix_problem(ctx, PR_1_HTREE_DEPTH, pctx)) in handle_htree()
1785 static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx, in scan_extent_node() argument
1799 pctx->errcode = ext2fs_extent_get_info(ehandle, &info); in scan_extent_node()
1800 if (pctx->errcode) in scan_extent_node()
1803 pctx->errcode = ext2fs_extent_get(ehandle, EXT2_EXTENT_FIRST_SIB, in scan_extent_node()
1805 while (!pctx->errcode && info.num_entries-- > 0) { in scan_extent_node()
1807 is_dir = LINUX_S_ISDIR(pctx->inode->i_mode); in scan_extent_node()
1834 pctx->blk = extent.e_pblk; in scan_extent_node()
1835 pctx->blk2 = extent.e_lblk; in scan_extent_node()
1836 pctx->num = extent.e_len; in scan_extent_node()
1837 pctx->blkcount = extent.e_lblk + extent.e_len; in scan_extent_node()
1838 if (fix_problem(ctx, problem, pctx)) { in scan_extent_node()
1840 pctx->errcode = in scan_extent_node()
1842 if (pctx->errcode) { in scan_extent_node()
1843 pctx->str = "ext2fs_extent_delete"; in scan_extent_node()
1847 pctx->errcode = ext2fs_extent_get(ehandle, in scan_extent_node()
1850 if (pctx->errcode == EXT2_ET_NO_CURRENT_NODE) { in scan_extent_node()
1851 pctx->errcode = 0; in scan_extent_node()
1863 pctx->errcode = ext2fs_extent_get(ehandle, in scan_extent_node()
1865 if (pctx->errcode) { in scan_extent_node()
1866 pctx->str = "EXT2_EXTENT_DOWN"; in scan_extent_node()
1868 if (pctx->errcode == EXT2_ET_EXTENT_HEADER_BAD) in scan_extent_node()
1877 pctx->blk = lblk; in scan_extent_node()
1878 pctx->blk2 = extent.e_lblk; in scan_extent_node()
1879 pctx->num = e_info.curr_level - 1; in scan_extent_node()
1881 if (fix_problem(ctx, problem, pctx)) in scan_extent_node()
1884 scan_extent_node(ctx, pctx, pb, extent.e_lblk, in scan_extent_node()
1886 if (pctx->errcode) in scan_extent_node()
1888 pctx->errcode = ext2fs_extent_get(ehandle, in scan_extent_node()
1890 if (pctx->errcode) { in scan_extent_node()
1891 pctx->str = "EXT2_EXTENT_UP"; in scan_extent_node()
1912 (unsigned long) pctx->ino, type, in scan_extent_node()
1922 pctx->errcode = ext2fs_add_dir_block2(ctx->fs->dblist, in scan_extent_node()
1925 if (pctx->errcode) { in scan_extent_node()
1926 pctx->blk = 0; in scan_extent_node()
1927 pctx->num = pb->last_db_block; in scan_extent_node()
1951 pctx->errcode = ext2fs_add_dir_block2(ctx->fs->dblist, pctx->ino, blk, blockcnt); in scan_extent_node()
1952 if (pctx->errcode) { in scan_extent_node()
1953 pctx->blk = blk; in scan_extent_node()
1954 pctx->num = blockcnt; in scan_extent_node()
1956 fix_problem(ctx, PR_1_ADD_DBLOCK, pctx); in scan_extent_node()
1971 pctx->errcode = ext2fs_extent_get(ehandle, in scan_extent_node()
1975 if (pctx->errcode == EXT2_ET_EXTENT_NO_NEXT) in scan_extent_node()
1976 pctx->errcode = 0; in scan_extent_node()
1979 static void check_blocks_extents(e2fsck_t ctx, struct problem_context *pctx, in check_blocks_extents() argument
1983 struct ext2_inode *inode = pctx->inode; in check_blocks_extents()
1986 ext2_ino_t ino = pctx->ino; in check_blocks_extents()
1990 pctx->errcode = ext2fs_extent_open2(fs, ino, inode, &ehandle); in check_blocks_extents()
1991 if (pctx->errcode) { in check_blocks_extents()
1992 if (fix_problem(ctx, PR_1_READ_EXTENT, pctx)) in check_blocks_extents()
1995 pctx->errcode = 0; in check_blocks_extents()
2008 scan_extent_node(ctx, pctx, pb, 0, 0, eof_lblk, ehandle); in check_blocks_extents()
2009 if (pctx->errcode && in check_blocks_extents()
2010 fix_problem(ctx, PR_1_EXTENT_ITERATE_FAILURE, pctx)) { in check_blocks_extents()
2015 pctx->errcode = 0; in check_blocks_extents()
2024 static void check_blocks(e2fsck_t ctx, struct problem_context *pctx, in check_blocks() argument
2029 ext2_ino_t ino = pctx->ino; in check_blocks()
2030 struct ext2_inode *inode = pctx->inode; in check_blocks()
2050 pb.pctx = pctx; in check_blocks()
2052 pctx->ino = ino; in check_blocks()
2053 pctx->errcode = 0; in check_blocks()
2063 if (fix_problem(ctx, PR_1_COMPR_SET, pctx)) { in check_blocks()
2071 check_ext_attr(ctx, pctx, block_buf)) { in check_blocks()
2079 check_blocks_extents(ctx, pctx, &pb); in check_blocks()
2081 pctx->errcode = ext2fs_block_iterate3(fs, ino, in check_blocks()
2095 if (pctx->errcode) in check_blocks()
2096 fix_problem(ctx, PR_1_BLOCK_ITERATE, pctx); in check_blocks()
2112 if (handle_htree(ctx, pctx, ino, inode, block_buf)) { in check_blocks()
2123 if (fix_problem(ctx, PR_1_ZERO_LENGTH_DIR, pctx)) { in check_blocks()
2180 pctx->num = (pb.last_block+1) * fs->blocksize; in check_blocks()
2181 pctx->group = bad_size; in check_blocks()
2182 if (fix_problem(ctx, PR_1_BAD_I_SIZE, pctx)) { in check_blocks()
2183 inode->i_size = pctx->num; in check_blocks()
2185 inode->i_size_high = pctx->num >> 32; in check_blocks()
2188 pctx->num = 0; in check_blocks()
2198 pctx->num = pb.num_blocks; in check_blocks()
2199 if (fix_problem(ctx, PR_1_BAD_I_BLOCKS, pctx)) { in check_blocks()
2204 pctx->num = 0; in check_blocks()
2280 struct problem_context *pctx; in process_block() local
2287 pctx = p->pctx; in process_block()
2337 (unsigned long) pctx->ino, type, in process_block()
2360 if (fix_problem(ctx, PR_1_TOO_MANY_BAD_BLOCKS, pctx)) { in process_block()
2364 if (fix_problem(ctx, PR_1_SUPPRESS_MESSAGES, pctx)) { in process_block()
2370 pctx->blk = blk; in process_block()
2371 pctx->blkcount = blockcnt; in process_block()
2372 if (fix_problem(ctx, problem, pctx)) { in process_block()
2406 pctx->errcode = ext2fs_add_dir_block2(fs->dblist, in process_block()
2409 if (pctx->errcode) { in process_block()
2410 pctx->blk = 0; in process_block()
2411 pctx->num = p->last_db_block; in process_block()
2415 pctx->errcode = ext2fs_add_dir_block2(fs->dblist, p->ino, in process_block()
2417 if (pctx->errcode) { in process_block()
2418 pctx->blk = blk; in process_block()
2419 pctx->num = blockcnt; in process_block()
2421 fix_problem(ctx, PR_1_ADD_DBLOCK, pctx); in process_block()
2441 struct problem_context *pctx; in process_bad_block() local
2454 pctx = p->pctx; in process_bad_block()
2456 pctx->ino = EXT2_BAD_INO; in process_bad_block()
2457 pctx->blk = blk; in process_bad_block()
2458 pctx->blkcount = blockcnt; in process_bad_block()
2462 if (fix_problem(ctx, PR_1_BB_ILLEGAL_BLOCK_NUM, pctx)) { in process_bad_block()
2472 if (fix_problem(ctx, PR_1_BB_FS_BLOCK, pctx)) { in process_bad_block()
2480 pctx)) { in process_bad_block()
2510 pctx->group = i; in process_bad_block()
2511 pctx->blk = blk; in process_bad_block()
2518 pctx)) { in process_bad_block()
2524 fix_problem(ctx, PR_1_BAD_SUPERBLOCK, pctx); in process_bad_block()
2530 pctx->blk = *block_nr; in process_bad_block()
2532 PR_1_BAD_PRIMARY_GROUP_DESCRIPTOR, pctx)) { in process_bad_block()
2538 fix_problem(ctx, PR_1_BAD_GROUP_DESCRIPTORS, pctx); in process_bad_block()
2543 if (fix_problem(ctx, PR_1_BB_BAD_BLOCK, pctx)) { in process_bad_block()
2550 if (fix_problem(ctx, PR_1_IB_BAD_BLOCK, pctx)) { in process_bad_block()
2577 if (fix_problem(ctx, PR_1_BBINODE_BAD_METABLOCK, pctx)) { in process_bad_block()
2586 pctx->group = -1; in process_bad_block()
2589 fix_problem(ctx, PR_1_PROGERR_CLAIMED_BLOCK, pctx); in process_bad_block()
2605 struct problem_context pctx; in new_table_block() local
2607 clear_problem_context(&pctx); in new_table_block()
2609 pctx.group = group; in new_table_block()
2610 pctx.blk = old_block; in new_table_block()
2611 pctx.str = name; in new_table_block()
2631 pctx.errcode = ext2fs_get_free_blocks2(fs, first_block, last_block, in new_table_block()
2634 if (is_flexbg && (pctx.errcode == EXT2_ET_BLOCK_ALLOC_FAIL)) in new_table_block()
2635 pctx.errcode = ext2fs_get_free_blocks2(fs, in new_table_block()
2639 if (pctx.errcode) { in new_table_block()
2640 pctx.num = num; in new_table_block()
2641 fix_problem(ctx, PR_1_RELOC_BLOCK_ALLOCATE, &pctx); in new_table_block()
2646 pctx.errcode = ext2fs_get_mem(fs->blocksize, &buf); in new_table_block()
2647 if (pctx.errcode) { in new_table_block()
2648 fix_problem(ctx, PR_1_RELOC_MEMORY_ALLOCATE, &pctx); in new_table_block()
2655 pctx.blk2 = *new_block; in new_table_block()
2657 PR_1_RELOC_TO), &pctx); in new_table_block()
2658 pctx.blk2 = 0; in new_table_block()
2660 pctx.blk = i; in new_table_block()
2663 pctx.errcode = io_channel_read_blk64(fs->io, in new_table_block()
2665 if (pctx.errcode) in new_table_block()
2666 fix_problem(ctx, PR_1_RELOC_READ_ERR, &pctx); in new_table_block()
2670 pctx.blk = (*new_block) + i; in new_table_block()
2671 pctx.errcode = io_channel_write_blk64(fs->io, pctx.blk, in new_table_block()
2673 if (pctx.errcode) in new_table_block()
2674 fix_problem(ctx, PR_1_RELOC_WRITE_ERR, &pctx); in new_table_block()
2730 struct problem_context pctx; in mark_table_blocks() local
2732 clear_problem_context(&pctx); in mark_table_blocks()
2735 pctx.group = i; in mark_table_blocks()
2748 pctx.blk = b; in mark_table_blocks()
2751 PR_1_ITABLE_CONFLICT, &pctx)) { in mark_table_blocks()
2768 pctx.blk = ext2fs_block_bitmap_loc(fs, i); in mark_table_blocks()
2769 if (fix_problem(ctx, PR_1_BB_CONFLICT, &pctx)) { in mark_table_blocks()
2785 pctx.blk = ext2fs_inode_bitmap_loc(fs, i); in mark_table_blocks()
2786 if (fix_problem(ctx, PR_1_IB_CONFLICT, &pctx)) { in mark_table_blocks()