Lines Matching refs:blk
558 blk64_t blk; in check_is_really_dir() local
635 &blk)) in check_is_really_dir()
641 blk = inode->i_block[i]; in check_is_really_dir()
642 if (!blk) in check_is_really_dir()
647 if (blk < ctx->fs->super->s_first_data_block || in check_is_really_dir()
648 blk >= ext2fs_blocks_count(ctx->fs->super) || in check_is_really_dir()
650 blk)) in check_is_really_dir()
653 blk = inode->i_block[0]; in check_is_really_dir()
667 retval = ext2fs_read_dir_block4(ctx->fs, blk, buf, 0, pctx->ino); in check_is_really_dir()
776 blk64_t blk = 0; in reserve_block_for_root_repair() local
784 err = ext2fs_new_block2(fs, 0, ctx->block_found_map, &blk); in reserve_block_for_root_repair()
787 ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); in reserve_block_for_root_repair()
788 ctx->root_repair_block = blk; in reserve_block_for_root_repair()
793 blk64_t blk = 0; in reserve_block_for_lnf_repair() local
803 err = ext2fs_new_block2(fs, 0, ctx->block_found_map, &blk); in reserve_block_for_lnf_repair()
806 ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); in reserve_block_for_lnf_repair()
807 ctx->lnf_repair_block = blk; in reserve_block_for_lnf_repair()
2177 blk64_t blk; in adjust_extattr_refcount() local
2185 if ((blk = ea_refcount_intr_next(refcount, &count)) == 0) in adjust_extattr_refcount()
2187 pctx.blk = blk; in adjust_extattr_refcount()
2188 pctx.errcode = ext2fs_read_ext_attr3(fs, blk, block_buf, in adjust_extattr_refcount()
2200 pctx.errcode = ext2fs_write_ext_attr3(fs, blk, in adjust_extattr_refcount()
2221 blk64_t blk; in check_ext_attr() local
2229 blk = ext2fs_file_acl_block(fs, inode); in check_ext_attr()
2230 if (blk == 0) in check_ext_attr()
2241 (blk < fs->super->s_first_data_block) || in check_ext_attr()
2242 (blk >= ext2fs_blocks_count(fs->super))) { in check_ext_attr()
2274 printf("Inode %u has EA block %u\n", ino, blk); in check_ext_attr()
2278 if (ext2fs_fast_test_block_bitmap2(ctx->block_ea_map, blk)) { in check_ext_attr()
2279 if (ea_refcount_decrement(ctx->refcount, blk, 0) == 0) in check_ext_attr()
2292 ea_refcount_increment(ctx->refcount_extra, blk, 0); in check_ext_attr()
2300 pctx->blk = blk; in check_ext_attr()
2301 pctx->errcode = ext2fs_read_ext_attr3(fs, blk, block_buf, pctx->ino); in check_ext_attr()
2314 pctx->blk = ext2fs_file_acl_block(fs, inode); in check_ext_attr()
2401 pctx->errcode = ext2fs_write_ext_attr3(fs, blk, block_buf, in check_ext_attr()
2409 ea_refcount_store(ctx->refcount, blk, count); in check_ext_attr()
2410 mark_block_used(ctx, blk); in check_ext_attr()
2411 ext2fs_fast_mark_block_bitmap2(ctx->block_ea_map, blk); in check_ext_attr()
2430 blk64_t blk; in handle_htree() local
2438 pctx->errcode = ext2fs_bmap2(fs, ino, inode, 0, 0, 0, 0, &blk); in handle_htree()
2441 (blk == 0) || in handle_htree()
2442 (blk < fs->super->s_first_data_block) || in handle_htree()
2443 (blk >= ext2fs_blocks_count(fs->super))) { in handle_htree()
2450 retval = io_channel_read_blk64(fs->io, blk, 1, block_buf); in handle_htree()
2560 blk64_t blk, last_lblk; in scan_extent_node() local
2602 pctx->blk = extent.e_pblk; in scan_extent_node()
2702 blk = extent.e_pblk; in scan_extent_node()
2713 pctx->blk = blk; in scan_extent_node()
2736 pctx->blk = lblk; in scan_extent_node()
2761 mark_block_used(ctx, blk); in scan_extent_node()
2804 pctx->blk = extent.e_lblk; in scan_extent_node()
2833 pctx->blk = 0; in scan_extent_node()
2842 for (blk = extent.e_pblk, blockcnt = extent.e_lblk, i = 0; in scan_extent_node()
2844 blk++, blockcnt++, i++) { in scan_extent_node()
2847 (EXT2FS_B2C(ctx->fs, blk) == in scan_extent_node()
2849 (blk & EXT2FS_CLUSTER_MASK(ctx->fs)) == in scan_extent_node()
2851 mark_block_used(ctx, blk); in scan_extent_node()
2855 pb->last_block, blk, in scan_extent_node()
2857 pctx->blk = blockcnt; in scan_extent_node()
2858 pctx->blk2 = blk; in scan_extent_node()
2860 mark_block_used(ctx, blk); in scan_extent_node()
2861 mark_block_used(ctx, blk); in scan_extent_node()
2864 pb->previous_block = blk; in scan_extent_node()
2867 pctx->errcode = ext2fs_add_dir_block2(ctx->fs->dblist, pctx->ino, blk, blockcnt); in scan_extent_node()
2869 pctx->blk = blk; in scan_extent_node()
2948 pctx->blk = info.max_depth; in check_blocks_extents()
2950 if (pctx->blk2 < pctx->blk && in check_blocks_extents()
2955 pctx->blk = MAX_EXTENT_DEPTH_COUNT; in check_blocks_extents()
2956 if (pctx->blk2 > pctx->blk) in check_blocks_extents()
3037 pctx->blk = 0; in check_blocks_inline_data()
3370 blk64_t blk = *block_nr; in process_block() local
3384 if (p->is_dir && blockcnt == 0 && blk == 0) { in process_block()
3387 pctx->blk = blk; in process_block()
3394 if (blk == 0) in process_block()
3398 printf("Process_block, inode %lu, block %u, #%d\n", p->ino, blk, in process_block()
3408 if (p->previous_block+1 != blk) { in process_block()
3421 (unsigned long) blk, in process_block()
3435 if (blk < fs->super->s_first_data_block || in process_block()
3436 blk >= ext2fs_blocks_count(fs->super)) in process_block()
3447 ext2fs_test_block_bitmap2(ctx->block_metadata_map, blk)) { in process_block()
3448 pctx->blk = blk; in process_block()
3488 pctx->blk = blk; in process_block()
3491 blk = *block_nr = 0; in process_block()
3519 mark_block_used(ctx, blk); in process_block()
3523 (EXT2FS_B2C(ctx->fs, blk) == in process_block()
3525 (blk & EXT2FS_CLUSTER_MASK(ctx->fs)) == in process_block()
3527 mark_block_used(ctx, blk); in process_block()
3530 p->last_block, blk, blockcnt)) { in process_block()
3531 pctx->blk = blockcnt; in process_block()
3532 pctx->blk2 = blk; in process_block()
3534 mark_block_used(ctx, blk); in process_block()
3535 mark_block_used(ctx, blk); in process_block()
3539 p->previous_block = blk; in process_block()
3547 pctx->blk = 0; in process_block()
3553 blk, blockcnt); in process_block()
3555 pctx->blk = blk; in process_block()
3575 blk64_t blk = *block_nr; in process_bad_block() local
3581 if (!blk) in process_bad_block()
3589 pctx->blk = blk; in process_bad_block()
3592 if ((blk < fs->super->s_first_data_block) || in process_bad_block()
3593 (blk >= ext2fs_blocks_count(fs->super))) { in process_bad_block()
3602 if (ext2fs_test_block_bitmap2(p->fs_meta_blocks, blk)) { in process_bad_block()
3609 blk)) { in process_bad_block()
3619 mark_block_used(ctx, blk); in process_bad_block()
3623 printf ("DEBUG: Marking %u as bad.\n", blk); in process_bad_block()
3632 if (!ext2fs_test_block_bitmap2(ctx->block_found_map, blk)) { in process_bad_block()
3633 ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); in process_bad_block()
3643 pctx->blk = blk; in process_bad_block()
3646 if (blk == first_block) { in process_bad_block()
3659 if ((blk > first_block) && in process_bad_block()
3660 (blk <= first_block + fs->desc_blocks)) { in process_bad_block()
3662 pctx->blk = *block_nr; in process_bad_block()
3674 if (blk == ext2fs_block_bitmap_loc(fs, i)) { in process_bad_block()
3681 if (blk == ext2fs_inode_bitmap_loc(fs, i)) { in process_bad_block()
3688 if ((blk >= ext2fs_inode_table_loc(fs, i)) && in process_bad_block()
3689 (blk < (ext2fs_inode_table_loc(fs, i) + in process_bad_block()
3705 if ((blk == p->inode->i_block[EXT2_IND_BLOCK]) || in process_bad_block()
3706 (blk == p->inode->i_block[EXT2_DIND_BLOCK]) || in process_bad_block()
3707 (blk == p->inode->i_block[EXT2_TIND_BLOCK])) { in process_bad_block()
3742 pctx.blk = old_block; in new_table_block()
3791 pctx.blk = i; in new_table_block()
3798 pctx.blk = (*new_block) + i; in new_table_block()
3799 pctx.errcode = io_channel_write_blk64(fs->io, pctx.blk, in new_table_block()
3802 pctx.blk = (*new_block) + i; in new_table_block()
3803 pctx.errcode = ext2fs_zero_blocks2(fs, pctx.blk, 1, in new_table_block()
3883 pctx.blk = b; in mark_table_blocks()
3905 pctx.blk = ext2fs_block_bitmap_loc(fs, i); in mark_table_blocks()
3923 pctx.blk = ext2fs_inode_bitmap_loc(fs, i); in mark_table_blocks()
4044 static void e2fsck_block_alloc_stats(ext2_filsys fs, blk64_t blk, int inuse) in e2fsck_block_alloc_stats() argument
4052 ext2fs_test_block_bitmap2(ctx->block_metadata_map, blk)) in e2fsck_block_alloc_stats()
4057 ext2fs_mark_block_bitmap2(ctx->block_found_map, blk); in e2fsck_block_alloc_stats()
4059 ext2fs_unmark_block_bitmap2(ctx->block_found_map, blk); in e2fsck_block_alloc_stats()
4063 static void e2fsck_block_alloc_stats_range(ext2_filsys fs, blk64_t blk, in e2fsck_block_alloc_stats_range() argument
4072 ext2fs_test_block_bitmap_range2(ctx->block_metadata_map, blk, num)) in e2fsck_block_alloc_stats_range()
4078 blk, num); in e2fsck_block_alloc_stats_range()
4081 blk, num); in e2fsck_block_alloc_stats_range()