• Home
  • Raw
  • Download

Lines Matching refs:blk

66 static inline int is_block_bm(ext2_filsys fs, unsigned int grp, blk64_t blk)  in is_block_bm()  argument
68 return blk == ext2fs_block_bitmap_loc(fs, grp); in is_block_bm()
71 static inline int is_inode_bm(ext2_filsys fs, unsigned int grp, blk64_t blk) in is_inode_bm() argument
73 return blk == ext2fs_inode_bitmap_loc(fs, grp); in is_inode_bm()
76 static int is_inode_tb(ext2_filsys fs, unsigned int grp, blk64_t blk) in is_inode_tb() argument
78 return blk >= ext2fs_inode_table_loc(fs, grp) && in is_inode_tb()
79 blk < (ext2fs_inode_table_loc(fs, grp) + in is_inode_tb()
585 blk64_t blk, lblk; in fix_uninit_block_bitmaps() local
596 blk = ext2fs_group_first_block2(fs, g); in fix_uninit_block_bitmaps()
598 ext2fs_unmark_block_bitmap_range2(fs->block_map, blk, in fix_uninit_block_bitmaps()
599 lblk - blk + 1); in fix_uninit_block_bitmaps()
606 for (i = 0, blk = ext2fs_inode_table_loc(fs, g); in fix_uninit_block_bitmaps()
608 i++, blk++) in fix_uninit_block_bitmaps()
609 ext2fs_mark_block_bitmap2(fs->block_map, blk); in fix_uninit_block_bitmaps()
634 blk64_t blk; in free_gdp_blocks() local
653 blk = ext2fs_block_bitmap_loc(old_fs, i); in free_gdp_blocks()
654 if (blk && in free_gdp_blocks()
655 (blk < ext2fs_blocks_count(fs->super)) && in free_gdp_blocks()
656 !(bg_map && ext2fs_test_block_bitmap2(bg_map, blk))) { in free_gdp_blocks()
657 ext2fs_block_alloc_stats2(fs, blk, -1); in free_gdp_blocks()
658 ext2fs_mark_block_bitmap2(reserve_blocks, blk); in free_gdp_blocks()
661 blk = ext2fs_inode_bitmap_loc(old_fs, i); in free_gdp_blocks()
662 if (blk && in free_gdp_blocks()
663 (blk < ext2fs_blocks_count(fs->super)) && in free_gdp_blocks()
664 !(bg_map && ext2fs_test_block_bitmap2(bg_map, blk))) { in free_gdp_blocks()
665 ext2fs_block_alloc_stats2(fs, blk, -1); in free_gdp_blocks()
666 ext2fs_mark_block_bitmap2(reserve_blocks, blk); in free_gdp_blocks()
669 blk = ext2fs_inode_table_loc(old_fs, i); in free_gdp_blocks()
671 j < fs->inode_blocks_per_group; j++, blk++) { in free_gdp_blocks()
672 if (blk >= ext2fs_blocks_count(fs->super) || in free_gdp_blocks()
673 (bg_map && ext2fs_test_block_bitmap2(bg_map, blk))) in free_gdp_blocks()
675 ext2fs_block_alloc_stats2(fs, blk, -1); in free_gdp_blocks()
676 ext2fs_mark_block_bitmap2(reserve_blocks, blk); in free_gdp_blocks()
696 blk64_t blk, group_block; in adjust_fs_info() local
769 blk = ext2fs_blocks_count(old_fs->super); in adjust_fs_info()
770 if (blk > ext2fs_blocks_count(fs->super)) in adjust_fs_info()
773 (blk - ext2fs_blocks_count(fs->super))); in adjust_fs_info()
777 (ext2fs_blocks_count(fs->super) - blk)); in adjust_fs_info()
1151 blk64_t blk; in mark_table_blocks() local
1159 blk = ext2fs_inode_table_loc(fs, i); in mark_table_blocks()
1160 if (blk) in mark_table_blocks()
1161 ext2fs_mark_block_bitmap_range2(bmap, blk, in mark_table_blocks()
1167 blk = ext2fs_block_bitmap_loc(fs, i); in mark_table_blocks()
1168 if (blk) in mark_table_blocks()
1169 ext2fs_mark_block_bitmap2(bmap, blk); in mark_table_blocks()
1174 blk = ext2fs_inode_bitmap_loc(fs, i); in mark_table_blocks()
1175 if (blk) in mark_table_blocks()
1176 ext2fs_mark_block_bitmap2(bmap, blk); in mark_table_blocks()
1188 int group, blk64_t blk) in mark_fs_metablock() argument
1192 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk); in mark_fs_metablock()
1193 ext2fs_block_alloc_stats2(fs, blk, +1); in mark_fs_metablock()
1200 if (is_block_bm(fs, group, blk)) { in mark_fs_metablock()
1205 if (is_inode_bm(fs, group, blk)) { in mark_fs_metablock()
1210 if (is_inode_tb(fs, group, blk)) { in mark_fs_metablock()
1219 if (is_block_bm(fs, i, blk)) { in mark_fs_metablock()
1224 if (is_inode_bm(fs, i, blk)) { in mark_fs_metablock()
1229 if (is_inode_tb(fs, i, blk)) { in mark_fs_metablock()
1244 } else if (ext2fs_test_block_bitmap2(rfs->old_fs->block_map, blk) && in mark_fs_metablock()
1245 !ext2fs_test_block_bitmap2(meta_bmap, blk)) { in mark_fs_metablock()
1246 ext2fs_mark_block_bitmap2(rfs->move_blocks, blk); in mark_fs_metablock()
1262 blk64_t blk, group_blk; in blocks_to_move() local
1332 for (blk = ext2fs_blocks_count(fs->super); in blocks_to_move()
1333 blk < ext2fs_blocks_count(old_fs->super); blk++) { in blocks_to_move()
1334 g = ext2fs_group_of_blk2(fs, blk); in blocks_to_move()
1341 blk = ext2fs_group_first_block2(fs, g+1) - 1; in blocks_to_move()
1344 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1345 !ext2fs_test_block_bitmap2(meta_bmap, blk)) { in blocks_to_move()
1346 ext2fs_mark_block_bitmap2(rfs->move_blocks, blk); in blocks_to_move()
1349 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk); in blocks_to_move()
1401 for (blk = group_blk + 1 + new_blocks; in blocks_to_move()
1402 blk < group_end;) { in blocks_to_move()
1405 blk)) { in blocks_to_move()
1408 (blk & in blocks_to_move()
1410 if (cluster_freed > group_end - blk) in blocks_to_move()
1411 cluster_freed = group_end - blk; in blocks_to_move()
1412 ext2fs_block_alloc_stats2(fs, blk, -1); in blocks_to_move()
1413 blk += EXT2FS_CLUSTER_RATIO(fs); in blocks_to_move()
1418 blk++; in blocks_to_move()
1441 for (blk = group_blk+1; in blocks_to_move()
1442 blk < group_blk + 1 + new_blocks; blk++) in blocks_to_move()
1444 i, blk); in blocks_to_move()
1509 (blk = ext2fs_block_bitmap_loc(fs, i))) { in blocks_to_move()
1510 ext2fs_block_alloc_stats2(fs, blk, +1); in blocks_to_move()
1511 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1512 !ext2fs_test_block_bitmap2(meta_bmap, blk)) in blocks_to_move()
1514 blk); in blocks_to_move()
1517 (blk = ext2fs_inode_bitmap_loc(fs, i))) { in blocks_to_move()
1518 ext2fs_block_alloc_stats2(fs, blk, +1); in blocks_to_move()
1519 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1520 !ext2fs_test_block_bitmap2(meta_bmap, blk)) in blocks_to_move()
1522 blk); in blocks_to_move()
1542 for (blk = ext2fs_inode_table_loc(fs, i), j=0; in blocks_to_move()
1543 j < fs->inode_blocks_per_group ; j++, blk++) { in blocks_to_move()
1544 ext2fs_block_alloc_stats2(fs, blk, +1); in blocks_to_move()
1545 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in blocks_to_move()
1546 !ext2fs_test_block_bitmap2(meta_bmap, blk)) in blocks_to_move()
1548 blk); in blocks_to_move()
1555 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0; in blocks_to_move()
1556 j < fs->inode_blocks_per_group ; j++, blk++) in blocks_to_move()
1557 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk); in blocks_to_move()
1636 blk64_t blk; in resize2fs_get_alloc_block() local
1639 blk = get_new_block(rfs); in resize2fs_get_alloc_block()
1640 if (!blk) in resize2fs_get_alloc_block()
1645 printf("get_alloc_block allocating %llu\n", blk); in resize2fs_get_alloc_block()
1648 ext2fs_mark_block_bitmap2(rfs->old_fs->block_map, blk); in resize2fs_get_alloc_block()
1649 ext2fs_mark_block_bitmap2(rfs->new_fs->block_map, blk); in resize2fs_get_alloc_block()
1651 group = ext2fs_group_of_blk2(rfs->old_fs, blk); in resize2fs_get_alloc_block()
1653 group = ext2fs_group_of_blk2(rfs->new_fs, blk); in resize2fs_get_alloc_block()
1656 *ret = (blk64_t) blk; in resize2fs_get_alloc_block()
1662 blk64_t blk, old_blk, new_blk; in block_mover() local
1696 for (blk = B2C(old_fs->super->s_first_data_block); in block_mover()
1697 blk < ext2fs_blocks_count(old_fs->super); in block_mover()
1698 blk += EXT2FS_CLUSTER_RATIO(fs)) { in block_mover()
1699 if (!ext2fs_test_block_bitmap2(old_fs->block_map, blk)) in block_mover()
1701 if (!ext2fs_test_block_bitmap2(rfs->move_blocks, blk)) in block_mover()
1703 if (ext2fs_badblocks_list_test(badblock_list, blk)) { in block_mover()
1704 ext2fs_badblocks_list_del(badblock_list, blk); in block_mover()
1715 ext2fs_add_extent_entry(rfs->bmap, B2C(blk), B2C(new_blk)); in block_mover()
2299 blk64_t old_blk, new_blk, blk, cluster_freed; in move_itables() local
2407 for (blk = ext2fs_inode_table_loc(rfs->old_fs, i), j=0; in move_itables()
2410 !ext2fs_test_block_bitmap2(new_bmap, blk)) { in move_itables()
2411 ext2fs_block_alloc_stats2(fs, blk, -1); in move_itables()
2413 (blk & EXT2FS_CLUSTER_MASK(fs)); in move_itables()
2414 blk += cluster_freed; in move_itables()
2418 blk++; in move_itables()
2512 blk64_t blk, sb, old_desc; in reserve_sparse_super2_last_group() local
2581 for (blk = sb, i = 0; i < num; blk++, i++) { in reserve_sparse_super2_last_group()
2582 if (ext2fs_test_block_bitmap2(old_fs->block_map, blk) && in reserve_sparse_super2_last_group()
2583 !ext2fs_test_block_bitmap2(meta_bmap, blk)) { in reserve_sparse_super2_last_group()
2584 ext2fs_mark_block_bitmap2(rfs->move_blocks, blk); in reserve_sparse_super2_last_group()
2587 ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk); in reserve_sparse_super2_last_group()
2640 blk64_t blk; in ext2fs_calculate_summary_stats() local
2662 for (blk = B2C(fs->super->s_first_data_block); in ext2fs_calculate_summary_stats()
2663 blk < ext2fs_blocks_count(fs->super); in ext2fs_calculate_summary_stats()
2664 blk += EXT2FS_CLUSTER_RATIO(fs)) { in ext2fs_calculate_summary_stats()
2666 !(EQ_CLSTR(blk, super_blk) || in ext2fs_calculate_summary_stats()
2668 GE_CLSTR(blk, old_desc_blk) && in ext2fs_calculate_summary_stats()
2669 LT_CLSTR(blk, old_desc_blk + old_desc_blocks))) || in ext2fs_calculate_summary_stats()
2670 ((new_desc_blk && EQ_CLSTR(blk, new_desc_blk))) || in ext2fs_calculate_summary_stats()
2671 EQ_CLSTR(blk, ext2fs_block_bitmap_loc(fs, group)) || in ext2fs_calculate_summary_stats()
2672 EQ_CLSTR(blk, ext2fs_inode_bitmap_loc(fs, group)) || in ext2fs_calculate_summary_stats()
2673 ((GE_CLSTR(blk, ext2fs_inode_table_loc(fs, group)) && in ext2fs_calculate_summary_stats()
2674 LT_CLSTR(blk, ext2fs_inode_table_loc(fs, group) in ext2fs_calculate_summary_stats()
2676 (!ext2fs_fast_test_block_bitmap2(fs->block_map, blk))) { in ext2fs_calculate_summary_stats()
2682 EQ_CLSTR(blk, ext2fs_blocks_count(fs->super)-1)) { in ext2fs_calculate_summary_stats()