Lines Matching defs:bmap

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