Lines Matching refs:bp
160 static void rb_free_extent(struct ext2fs_rb_private *bp, in rb_free_extent() argument
163 if (bp->wcursor == ext) in rb_free_extent()
164 bp->wcursor = NULL; in rb_free_extent()
165 if (bp->rcursor == ext) in rb_free_extent()
166 bp->rcursor = NULL; in rb_free_extent()
167 if (bp->rcursor_next == ext) in rb_free_extent()
168 bp->rcursor_next = NULL; in rb_free_extent()
174 struct ext2fs_rb_private *bp; in rb_alloc_private_data() local
177 retval = ext2fs_get_mem(sizeof (struct ext2fs_rb_private), &bp); in rb_alloc_private_data()
181 bp->root = RB_ROOT; in rb_alloc_private_data()
182 bp->rcursor = NULL; in rb_alloc_private_data()
183 bp->rcursor_next = NULL; in rb_alloc_private_data()
184 bp->wcursor = NULL; in rb_alloc_private_data()
187 bp->test_hit = 0; in rb_alloc_private_data()
188 bp->mark_hit = 0; in rb_alloc_private_data()
191 bitmap->private = (void *) bp; in rb_alloc_private_data()
222 struct ext2fs_rb_private *bp; in rb_free_bmap() local
224 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_free_bmap()
226 rb_free_tree(&bp->root); in rb_free_bmap()
227 ext2fs_free_mem(&bp); in rb_free_bmap()
228 bp = 0; in rb_free_bmap()
300 struct ext2fs_rb_private *bp; in rb_resize_bmap() local
308 bp = (struct ext2fs_rb_private *) bmap->private; in rb_resize_bmap()
309 bp->rcursor = NULL; in rb_resize_bmap()
310 bp->wcursor = NULL; in rb_resize_bmap()
313 rb_truncate(new_real_end, &bp->root); in rb_resize_bmap()
322 rb_test_bit(struct ext2fs_rb_private *bp, __u64 bit) in rb_test_bit() argument
326 struct rb_node **n = &bp->root.rb_node; in rb_test_bit()
329 rcursor = bp->rcursor; in rb_test_bit()
335 bp->test_hit++; in rb_test_bit()
340 next_ext = bp->rcursor_next; in rb_test_bit()
345 bp->rcursor_next = next_ext; in rb_test_bit()
351 bp->test_hit++; in rb_test_bit()
356 bp->rcursor = NULL; in rb_test_bit()
357 bp->rcursor_next = NULL; in rb_test_bit()
359 rcursor = bp->wcursor; in rb_test_bit()
376 bp->rcursor = ext; in rb_test_bit()
377 bp->rcursor_next = NULL; in rb_test_bit()
385 struct ext2fs_rb_private *bp) in rb_insert_extent() argument
387 struct rb_root *root = &bp->root; in rb_insert_extent()
394 bp->rcursor_next = NULL; in rb_insert_extent()
395 ext = bp->wcursor; in rb_insert_extent()
400 bp->mark_hit++; in rb_insert_extent()
438 bp->wcursor = new_ext; in rb_insert_extent()
447 rb_free_extent(bp, ext); in rb_insert_extent()
467 rb_free_extent(bp, ext); in rb_insert_extent()
474 rb_free_extent(bp, ext); in rb_insert_extent()
486 struct ext2fs_rb_private *bp) in rb_remove_extent() argument
488 struct rb_root *root = &bp->root; in rb_remove_extent()
517 rb_insert_extent(new_start, new_count, bp); in rb_remove_extent()
529 rb_free_extent(bp, ext); in rb_remove_extent()
554 rb_free_extent(bp, ext); in rb_remove_extent()
571 struct ext2fs_rb_private *bp; in rb_mark_bmap() local
573 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_mark_bmap()
576 return rb_insert_extent(arg, 1, bp); in rb_mark_bmap()
581 struct ext2fs_rb_private *bp; in rb_unmark_bmap() local
584 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_unmark_bmap()
587 retval = rb_remove_extent(arg, 1, bp); in rb_unmark_bmap()
588 check_tree(&bp->root, __func__); in rb_unmark_bmap()
596 struct ext2fs_rb_private *bp; in rb_test_bmap() local
598 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_test_bmap()
601 return rb_test_bit(bp, arg); in rb_test_bmap()
607 struct ext2fs_rb_private *bp; in rb_mark_bmap_extent() local
609 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_mark_bmap_extent()
612 rb_insert_extent(arg, num, bp); in rb_mark_bmap_extent()
618 struct ext2fs_rb_private *bp; in rb_unmark_bmap_extent() local
620 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_unmark_bmap_extent()
623 rb_remove_extent(arg, num, bp); in rb_unmark_bmap_extent()
624 check_tree(&bp->root, __func__); in rb_unmark_bmap_extent()
632 struct ext2fs_rb_private *bp; in rb_test_clear_bmap_extent() local
636 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_test_clear_bmap_extent()
637 n = &bp->root.rb_node; in rb_test_clear_bmap_extent()
640 if ((len == 0) || EXT2FS_RB_EMPTY_ROOT(&bp->root)) in rb_test_clear_bmap_extent()
686 struct ext2fs_rb_private *bp; in rb_set_bmap_range() local
691 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_set_bmap_range()
716 i - first_set, bp); in rb_set_bmap_range()
721 num - first_set, bp); in rb_set_bmap_range()
731 struct ext2fs_rb_private *bp; in rb_get_bmap_range() local
736 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_get_bmap_range()
737 n = &bp->root.rb_node; in rb_get_bmap_range()
740 if (EXT2FS_RB_EMPTY_ROOT(&bp->root)) in rb_get_bmap_range()
794 struct ext2fs_rb_private *bp; in rb_clear_bmap() local
796 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_clear_bmap()
798 rb_free_tree(&bp->root); in rb_clear_bmap()
799 bp->rcursor = NULL; in rb_clear_bmap()
800 bp->rcursor_next = NULL; in rb_clear_bmap()
801 bp->wcursor = NULL; in rb_clear_bmap()
807 struct ext2fs_rb_private *bp; in rb_print_stats() local
820 bp = (struct ext2fs_rb_private *) bitmap->private; in rb_print_stats()
822 node = ext2fs_rb_first(&bp->root); in rb_print_stats()
823 for (node = ext2fs_rb_first(&bp->root); node != NULL; in rb_print_stats()
844 m_hit = ((double)bp->mark_hit / mark_all) * 100; in rb_print_stats()
846 t_hit = ((double)bp->test_hit / test_all) * 100; in rb_print_stats()
850 bp->test_hit, t_hit, bp->mark_hit, m_hit); in rb_print_stats()