Lines Matching refs:ext
75 struct bmap_rb_extent *ext; in print_tree() local
81 ext = node_to_extent(node); in print_tree()
83 ext->start, ext->start + ext->count); in print_tree()
91 struct bmap_rb_extent *ext, *old = NULL; in check_tree() local
95 ext = node_to_extent(node); in check_tree()
96 if (ext->count == 0) { in check_tree()
99 ext->start, ext->start + ext->count, in check_tree()
100 ext->count); in check_tree()
103 if (ext->start + ext->count < ext->start) { in check_tree()
107 ext->start, ext->start + ext->count, in check_tree()
108 ext->count); in check_tree()
113 if (old->start > ext->start) { in check_tree()
120 ext->start, ext->start + ext->count, in check_tree()
121 ext->count); in check_tree()
124 if ((old->start + old->count) >= ext->start) { in check_tree()
132 ext->start, ext->start + ext->count, in check_tree()
133 ext->count); in check_tree()
137 old = ext; in check_tree()
151 static void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start, in rb_get_new_extent() argument
164 *ext = new_ext; in rb_get_new_extent()
169 struct bmap_rb_extent *ext) in rb_free_extent() argument
171 if (bp->wcursor == ext) in rb_free_extent()
173 if (bp->rcursor == ext) in rb_free_extent()
175 if (bp->rcursor_next == ext) in rb_free_extent()
177 ext2fs_free_mem(&ext); in rb_free_extent()
217 struct bmap_rb_extent *ext; in rb_free_tree() local
222 ext = node_to_extent(node); in rb_free_tree()
224 ext2fs_free_mem(&ext); in rb_free_tree()
286 struct bmap_rb_extent *ext; in rb_truncate() local
291 ext = node_to_extent(node); in rb_truncate()
293 if ((ext->start + ext->count - 1) <= new_max) in rb_truncate()
295 else if (ext->start > new_max) { in rb_truncate()
297 ext2fs_free_mem(&ext); in rb_truncate()
301 ext->count = new_max - ext->start + 1; in rb_truncate()
333 struct bmap_rb_extent *ext; in rb_test_bit() local
376 ext = node_to_extent(parent); in rb_test_bit()
377 if (bit < ext->start) in rb_test_bit()
379 else if (bit >= (ext->start + ext->count)) in rb_test_bit()
382 bp->rcursor = ext; in rb_test_bit()
397 struct bmap_rb_extent *ext; in rb_insert_extent() local
404 ext = bp->wcursor; in rb_insert_extent()
405 if (ext) { in rb_insert_extent()
406 if (start >= ext->start && in rb_insert_extent()
407 start <= (ext->start + ext->count)) { in rb_insert_extent()
417 ext = node_to_extent(parent); in rb_insert_extent()
419 if (start < ext->start) { in rb_insert_extent()
421 } else if (start > (ext->start + ext->count)) { in rb_insert_extent()
425 if ((start + count) <= (ext->start + ext->count)) in rb_insert_extent()
428 if ((ext->start + ext->count) == start) in rb_insert_extent()
433 count += (start - ext->start); in rb_insert_extent()
434 start = ext->start; in rb_insert_extent()
435 new_ext = ext; in rb_insert_extent()
436 new_node = &ext->node; in rb_insert_extent()
451 ext = node_to_extent(node); in rb_insert_extent()
452 if ((ext->start + ext->count) == start) { in rb_insert_extent()
453 start = ext->start; in rb_insert_extent()
454 count += ext->count; in rb_insert_extent()
456 rb_free_extent(bp, ext); in rb_insert_extent()
464 ext = node_to_extent(node); in rb_insert_extent()
466 if ((ext->start + ext->count) <= start) in rb_insert_extent()
470 if ((start + count) < ext->start) in rb_insert_extent()
474 if ((start + count) >= (ext->start + ext->count)) { in rb_insert_extent()
476 rb_free_extent(bp, ext); in rb_insert_extent()
480 count += ((ext->start + ext->count) - in rb_insert_extent()
483 rb_free_extent(bp, ext); in rb_insert_extent()
500 struct bmap_rb_extent *ext; in rb_remove_extent() local
509 ext = node_to_extent(parent); in rb_remove_extent()
510 if (start < ext->start) { in rb_remove_extent()
513 } else if (start >= (ext->start + ext->count)) { in rb_remove_extent()
518 if ((start > ext->start) && in rb_remove_extent()
519 (start + count) < (ext->start + ext->count)) { in rb_remove_extent()
522 new_count = (ext->start + ext->count) - new_start; in rb_remove_extent()
524 ext->count = start - ext->start; in rb_remove_extent()
530 if ((start + count) >= (ext->start + ext->count)) { in rb_remove_extent()
531 ext->count = start - ext->start; in rb_remove_extent()
535 if (0 == ext->count) { in rb_remove_extent()
536 parent = ext2fs_rb_next(&ext->node); in rb_remove_extent()
537 ext2fs_rb_erase(&ext->node, root); in rb_remove_extent()
538 rb_free_extent(bp, ext); in rb_remove_extent()
542 if (start == ext->start) { in rb_remove_extent()
543 ext->start += count; in rb_remove_extent()
544 ext->count -= count; in rb_remove_extent()
552 ext = node_to_extent(parent); in rb_remove_extent()
553 if ((ext->start + ext->count) <= start) in rb_remove_extent()
557 if ((start + count) < ext->start) in rb_remove_extent()
561 if ((start + count) >= (ext->start + ext->count)) { in rb_remove_extent()
563 rb_free_extent(bp, ext); in rb_remove_extent()
568 ext->count -= ((start + count) - ext->start); in rb_remove_extent()
569 ext->start = start + count; in rb_remove_extent()
646 struct bmap_rb_extent *ext; in rb_test_clear_bmap_extent() local
663 ext = node_to_extent(parent); in rb_test_clear_bmap_extent()
664 if (start < ext->start) { in rb_test_clear_bmap_extent()
666 } else if (start >= (ext->start + ext->count)) { in rb_test_clear_bmap_extent()
680 ext = node_to_extent(node); in rb_test_clear_bmap_extent()
683 if ((ext->start + ext->count) <= start) in rb_test_clear_bmap_extent()
687 if ((start + len) <= ext->start) in rb_test_clear_bmap_extent()
748 struct bmap_rb_extent *ext; in rb_get_bmap_range() local
760 ext = node_to_extent(parent); in rb_get_bmap_range()
761 if (start < ext->start) { in rb_get_bmap_range()
763 } else if (start >= (ext->start + ext->count)) { in rb_get_bmap_range()
773 ext = node_to_extent(parent); in rb_get_bmap_range()
775 pos = ext->start; in rb_get_bmap_range()
776 count = ext->count; in rb_get_bmap_range()
825 struct bmap_rb_extent *ext; in rb_find_first_zero() local
840 ext = node_to_extent(parent); in rb_find_first_zero()
841 if (start < ext->start) { in rb_find_first_zero()
843 } else if (start >= (ext->start + ext->count)) { in rb_find_first_zero()
845 } else if (ext->start + ext->count <= end) { in rb_find_first_zero()
846 *out = ext->start + ext->count + bitmap->start; in rb_find_first_zero()
862 struct bmap_rb_extent *ext; in rb_find_first_set() local
877 ext = node_to_extent(parent); in rb_find_first_set()
878 if (start < ext->start) { in rb_find_first_set()
880 } else if (start >= (ext->start + ext->count)) { in rb_find_first_set()
890 ext = node_to_extent(node); in rb_find_first_set()
891 if (ext->start < start) { in rb_find_first_set()
895 ext = node_to_extent(node); in rb_find_first_set()
897 if (ext->start <= end) { in rb_find_first_set()
898 *out = ext->start + bitmap->start; in rb_find_first_set()
909 struct bmap_rb_extent *ext; in rb_print_stats() local
924 ext = node_to_extent(node); in rb_print_stats()
926 if (ext->count > max_size) in rb_print_stats()
927 max_size = ext->count; in rb_print_stats()
928 if (ext->count < min_size) in rb_print_stats()
929 min_size = ext->count; in rb_print_stats()
930 size += ext->count; in rb_print_stats()