Lines Matching refs:bmap
243 void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap) in ext2fs_free_generic_bmap() argument
245 if (!bmap) in ext2fs_free_generic_bmap()
248 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_free_generic_bmap()
249 ext2fs_free_generic_bitmap(bmap); in ext2fs_free_generic_bmap()
253 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_free_generic_bmap()
258 ext2fs_print_bmap_statistics(bmap); in ext2fs_free_generic_bmap()
259 bmap->bitmap_ops->print_stats(bmap); in ext2fs_free_generic_bmap()
263 bmap->bitmap_ops->free_bmap(bmap); in ext2fs_free_generic_bmap()
265 if (bmap->description) { in ext2fs_free_generic_bmap()
266 ext2fs_free_mem(&bmap->description); in ext2fs_free_generic_bmap()
267 bmap->description = 0; in ext2fs_free_generic_bmap()
269 bmap->magic = 0; in ext2fs_free_generic_bmap()
270 ext2fs_free_mem(&bmap); in ext2fs_free_generic_bmap()
342 errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap, in ext2fs_resize_generic_bmap() argument
346 if (!bmap) in ext2fs_resize_generic_bmap()
349 if (EXT2FS_IS_32_BITMAP(bmap)) in ext2fs_resize_generic_bmap()
350 return ext2fs_resize_generic_bitmap(bmap->magic, new_end, in ext2fs_resize_generic_bmap()
351 new_real_end, bmap); in ext2fs_resize_generic_bmap()
353 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_resize_generic_bmap()
356 INC_STAT(bmap, resize_count); in ext2fs_resize_generic_bmap()
358 return bmap->bitmap_ops->resize_bmap(bmap, new_end, new_real_end); in ext2fs_resize_generic_bmap()
530 errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap, in ext2fs_set_generic_bmap_range() argument
534 if (!bmap) in ext2fs_set_generic_bmap_range()
537 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_set_generic_bmap_range()
539 ext2fs_warn_bitmap2(bmap, EXT2FS_UNMARK_ERROR, in ext2fs_set_generic_bmap_range()
543 return ext2fs_set_generic_bitmap_range(bmap, bmap->magic, in ext2fs_set_generic_bmap_range()
547 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_set_generic_bmap_range()
550 INC_STAT(bmap, set_range_count); in ext2fs_set_generic_bmap_range()
552 return bmap->bitmap_ops->set_bmap_range(bmap, start, num, in); in ext2fs_set_generic_bmap_range()
555 errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap, in ext2fs_get_generic_bmap_range() argument
559 if (!bmap) in ext2fs_get_generic_bmap_range()
562 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_get_generic_bmap_range()
564 ext2fs_warn_bitmap2(bmap, in ext2fs_get_generic_bmap_range()
568 return ext2fs_get_generic_bitmap_range(bmap, bmap->magic, in ext2fs_get_generic_bmap_range()
572 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_get_generic_bmap_range()
575 INC_STAT(bmap, get_range_count); in ext2fs_get_generic_bmap_range()
577 return bmap->bitmap_ops->get_bmap_range(bmap, start, num, out); in ext2fs_get_generic_bmap_range()
610 void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap) in ext2fs_set_generic_bmap_padding() argument
614 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_set_generic_bmap_padding()
615 ext2fs_set_generic_bitmap_padding(bmap); in ext2fs_set_generic_bmap_padding()
619 start = bmap->end + 1; in ext2fs_set_generic_bmap_padding()
620 num = bmap->real_end - bmap->end; in ext2fs_set_generic_bmap_padding()
621 bmap->bitmap_ops->mark_bmap_extent(bmap, start, num); in ext2fs_set_generic_bmap_padding()
625 int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bmap, in ext2fs_test_block_bitmap_range2() argument
630 if (!bmap) in ext2fs_test_block_bitmap_range2()
635 bmap, block); in ext2fs_test_block_bitmap_range2()
637 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_test_block_bitmap_range2()
639 ext2fs_warn_bitmap2((ext2fs_generic_bitmap) bmap, in ext2fs_test_block_bitmap_range2()
644 (ext2fs_generic_bitmap) bmap, block, num); in ext2fs_test_block_bitmap_range2()
647 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_test_block_bitmap_range2()
650 INC_STAT(bmap, test_ext_count); in ext2fs_test_block_bitmap_range2()
653 block >>= bmap->cluster_bits; in ext2fs_test_block_bitmap_range2()
654 end += (1 << bmap->cluster_bits) - 1; in ext2fs_test_block_bitmap_range2()
655 end >>= bmap->cluster_bits; in ext2fs_test_block_bitmap_range2()
658 if ((block < bmap->start) || (block+num-1 > bmap->end)) { in ext2fs_test_block_bitmap_range2()
660 bmap->description); in ext2fs_test_block_bitmap_range2()
664 return bmap->bitmap_ops->test_clear_bmap_extent(bmap, block, num); in ext2fs_test_block_bitmap_range2()
667 void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bmap, in ext2fs_mark_block_bitmap_range2() argument
672 if (!bmap) in ext2fs_mark_block_bitmap_range2()
675 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_mark_block_bitmap_range2()
677 ext2fs_warn_bitmap2((ext2fs_generic_bitmap) bmap, in ext2fs_mark_block_bitmap_range2()
681 ext2fs_mark_block_bitmap_range((ext2fs_generic_bitmap) bmap, in ext2fs_mark_block_bitmap_range2()
685 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_mark_block_bitmap_range2()
688 INC_STAT(bmap, mark_ext_count); in ext2fs_mark_block_bitmap_range2()
691 block >>= bmap->cluster_bits; in ext2fs_mark_block_bitmap_range2()
692 end += (1 << bmap->cluster_bits) - 1; in ext2fs_mark_block_bitmap_range2()
693 end >>= bmap->cluster_bits; in ext2fs_mark_block_bitmap_range2()
696 if ((block < bmap->start) || (block+num-1 > bmap->end)) { in ext2fs_mark_block_bitmap_range2()
698 bmap->description); in ext2fs_mark_block_bitmap_range2()
702 bmap->bitmap_ops->mark_bmap_extent(bmap, block, num); in ext2fs_mark_block_bitmap_range2()
705 void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bmap, in ext2fs_unmark_block_bitmap_range2() argument
710 if (!bmap) in ext2fs_unmark_block_bitmap_range2()
713 if (EXT2FS_IS_32_BITMAP(bmap)) { in ext2fs_unmark_block_bitmap_range2()
715 ext2fs_warn_bitmap2((ext2fs_generic_bitmap) bmap, in ext2fs_unmark_block_bitmap_range2()
719 ext2fs_unmark_block_bitmap_range((ext2fs_generic_bitmap) bmap, in ext2fs_unmark_block_bitmap_range2()
723 if (!EXT2FS_IS_64_BITMAP(bmap)) in ext2fs_unmark_block_bitmap_range2()
726 INC_STAT(bmap, unmark_ext_count); in ext2fs_unmark_block_bitmap_range2()
729 block >>= bmap->cluster_bits; in ext2fs_unmark_block_bitmap_range2()
730 end += (1 << bmap->cluster_bits) - 1; in ext2fs_unmark_block_bitmap_range2()
731 end >>= bmap->cluster_bits; in ext2fs_unmark_block_bitmap_range2()
734 if ((block < bmap->start) || (block+num-1 > bmap->end)) { in ext2fs_unmark_block_bitmap_range2()
736 bmap->description); in ext2fs_unmark_block_bitmap_range2()
740 bmap->bitmap_ops->unmark_bmap_extent(bmap, block, num); in ext2fs_unmark_block_bitmap_range2()
759 ext2fs_block_bitmap cmap, bmap; in ext2fs_convert_subcluster_bitmap() local
764 bmap = *bitmap; in ext2fs_convert_subcluster_bitmap()
766 if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(bmap)) in ext2fs_convert_subcluster_bitmap()
774 i = bmap->start; in ext2fs_convert_subcluster_bitmap()
775 b_end = bmap->end; in ext2fs_convert_subcluster_bitmap()
776 bmap->end = bmap->real_end; in ext2fs_convert_subcluster_bitmap()
781 while (i < bmap->real_end) { in ext2fs_convert_subcluster_bitmap()
782 if (ext2fs_test_block_bitmap2(bmap, i)) { in ext2fs_convert_subcluster_bitmap()
792 bmap->end = b_end; in ext2fs_convert_subcluster_bitmap()
794 ext2fs_free_block_bitmap(bmap); in ext2fs_convert_subcluster_bitmap()