Lines Matching refs:ext
71 struct bmap_rb_extent *ext; in print_tree() local
77 ext = node_to_extent(node); in print_tree()
79 ext->start, ext->start + ext->count); in print_tree()
87 struct bmap_rb_extent *ext, *old = NULL; in check_tree() local
91 ext = node_to_extent(node); in check_tree()
92 if (ext->count <= 0) { in check_tree()
94 printf("extent: %llu -> %llu (%u)\n", ext->start, in check_tree()
95 ext->start + ext->count, ext->count); in check_tree()
98 if (ext->start < 0) { in check_tree()
100 printf("extent: %llu -> %llu (%u)\n", ext->start, in check_tree()
101 ext->start + ext->count, ext->count); in check_tree()
106 if (old->start > ext->start) { in check_tree()
112 ext->start, ext->start + ext->count, in check_tree()
113 ext->count); in check_tree()
116 if ((old->start + old->count) >= ext->start) { in check_tree()
122 ext->start, ext->start + ext->count, in check_tree()
123 ext->count); in check_tree()
127 old = ext; in check_tree()
141 static void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start, in rb_get_new_extent() argument
156 *ext = new_ext; in rb_get_new_extent()
161 struct bmap_rb_extent *ext) in rb_free_extent() argument
163 if (bp->wcursor == ext) in rb_free_extent()
165 if (bp->rcursor == ext) in rb_free_extent()
167 if (bp->rcursor_next == ext) in rb_free_extent()
169 ext2fs_free_mem(&ext); in rb_free_extent()
209 struct bmap_rb_extent *ext; in rb_free_tree() local
214 ext = node_to_extent(node); in rb_free_tree()
216 ext2fs_free_mem(&ext); in rb_free_tree()
278 struct bmap_rb_extent *ext; in rb_truncate() local
283 ext = node_to_extent(node); in rb_truncate()
285 if ((ext->start + ext->count - 1) <= new_max) in rb_truncate()
287 else if (ext->start > new_max) { in rb_truncate()
289 ext2fs_free_mem(&ext); in rb_truncate()
293 ext->count = new_max - ext->start + 1; in rb_truncate()
327 struct bmap_rb_extent *ext; in rb_test_bit() local
370 ext = node_to_extent(parent); in rb_test_bit()
371 if (bit < ext->start) in rb_test_bit()
373 else if (bit >= (ext->start + ext->count)) in rb_test_bit()
376 bp->rcursor = ext; in rb_test_bit()
391 struct bmap_rb_extent *ext; in rb_insert_extent() local
395 ext = bp->wcursor; in rb_insert_extent()
396 if (ext) { in rb_insert_extent()
397 if (start >= ext->start && in rb_insert_extent()
398 start <= (ext->start + ext->count)) { in rb_insert_extent()
408 ext = node_to_extent(parent); in rb_insert_extent()
410 if (start < ext->start) { in rb_insert_extent()
412 } else if (start > (ext->start + ext->count)) { in rb_insert_extent()
416 if ((start + count) <= (ext->start + ext->count)) in rb_insert_extent()
419 if ((ext->start + ext->count) == start) in rb_insert_extent()
424 count += (start - ext->start); in rb_insert_extent()
425 start = ext->start; in rb_insert_extent()
426 new_ext = ext; in rb_insert_extent()
427 new_node = &ext->node; in rb_insert_extent()
442 ext = node_to_extent(node); in rb_insert_extent()
443 if ((ext->start + ext->count) == start) { in rb_insert_extent()
444 start = ext->start; in rb_insert_extent()
445 count += ext->count; in rb_insert_extent()
447 rb_free_extent(bp, ext); in rb_insert_extent()
455 ext = node_to_extent(node); in rb_insert_extent()
457 if ((ext->start + ext->count) <= start) in rb_insert_extent()
461 if ((start + count) < ext->start) in rb_insert_extent()
465 if ((start + count) >= (ext->start + ext->count)) { in rb_insert_extent()
467 rb_free_extent(bp, ext); in rb_insert_extent()
471 count += ((ext->start + ext->count) - in rb_insert_extent()
474 rb_free_extent(bp, ext); in rb_insert_extent()
491 struct bmap_rb_extent *ext; in rb_remove_extent() local
500 ext = node_to_extent(parent); in rb_remove_extent()
501 if (start < ext->start) { in rb_remove_extent()
504 } else if (start >= (ext->start + ext->count)) { in rb_remove_extent()
509 if ((start > ext->start) && in rb_remove_extent()
510 (start + count) < (ext->start + ext->count)) { in rb_remove_extent()
513 new_count = (ext->start + ext->count) - new_start; in rb_remove_extent()
515 ext->count = start - ext->start; in rb_remove_extent()
521 if ((start + count) >= (ext->start + ext->count)) { in rb_remove_extent()
522 ext->count = start - ext->start; in rb_remove_extent()
526 if (0 == ext->count) { in rb_remove_extent()
527 parent = ext2fs_rb_next(&ext->node); in rb_remove_extent()
528 ext2fs_rb_erase(&ext->node, root); in rb_remove_extent()
529 rb_free_extent(bp, ext); in rb_remove_extent()
533 if (start == ext->start) { in rb_remove_extent()
534 ext->start += count; in rb_remove_extent()
535 ext->count -= count; in rb_remove_extent()
543 ext = node_to_extent(parent); in rb_remove_extent()
544 if ((ext->start + ext->count) <= start) in rb_remove_extent()
548 if ((start + count) < ext->start) in rb_remove_extent()
552 if ((start + count) >= (ext->start + ext->count)) { in rb_remove_extent()
554 rb_free_extent(bp, ext); in rb_remove_extent()
559 ext->count -= ((start + count) - ext->start); in rb_remove_extent()
560 ext->start = start + count; in rb_remove_extent()
633 struct bmap_rb_extent *ext; in rb_test_clear_bmap_extent() local
650 ext = node_to_extent(parent); in rb_test_clear_bmap_extent()
651 if (start < ext->start) { in rb_test_clear_bmap_extent()
653 } else if (start >= (ext->start + ext->count)) { in rb_test_clear_bmap_extent()
667 ext = node_to_extent(node); in rb_test_clear_bmap_extent()
670 if ((ext->start + ext->count) <= start) in rb_test_clear_bmap_extent()
674 if ((start + len) <= ext->start) in rb_test_clear_bmap_extent()
732 struct bmap_rb_extent *ext; in rb_get_bmap_range() local
745 ext = node_to_extent(parent); in rb_get_bmap_range()
746 if (start < ext->start) { in rb_get_bmap_range()
748 } else if (start >= (ext->start + ext->count)) { in rb_get_bmap_range()
758 ext = node_to_extent(parent); in rb_get_bmap_range()
760 pos = ext->start; in rb_get_bmap_range()
761 count = ext->count; in rb_get_bmap_range()
809 struct bmap_rb_extent *ext; in rb_print_stats() local
825 ext = node_to_extent(node); in rb_print_stats()
827 if (ext->count > max_size) in rb_print_stats()
828 max_size = ext->count; in rb_print_stats()
829 if (ext->count < min_size) in rb_print_stats()
830 min_size = ext->count; in rb_print_stats()
831 size += ext->count; in rb_print_stats()