• Home
  • Raw
  • Download

Lines Matching refs:ext

75 	struct bmap_rb_extent *ext;  in print_tree()  local
81 ext = node_to_extent(node); in print_tree()
83 (unsigned long long) ext->start, in print_tree()
84 (unsigned long long) ext->start + ext->count); in print_tree()
92 struct bmap_rb_extent *ext, *old = NULL; in check_tree() local
96 ext = node_to_extent(node); in check_tree()
97 if (ext->count == 0) { in check_tree()
100 (unsigned long long) ext->start, in check_tree()
101 (unsigned long long) ext->start + ext->count, in check_tree()
102 (unsigned long long) ext->count); in check_tree()
105 if (ext->start + ext->count < ext->start) { in check_tree()
109 (unsigned long long) ext->start, in check_tree()
110 (unsigned long long) ext->start + ext->count, in check_tree()
111 (unsigned long long) ext->count); in check_tree()
116 if (old->start > ext->start) { in check_tree()
124 (unsigned long long) ext->start, in check_tree()
125 (unsigned long long) ext->start + ext->count, in check_tree()
126 (unsigned long long) ext->count); in check_tree()
129 if ((old->start + old->count) >= ext->start) { in check_tree()
138 (unsigned long long) ext->start, in check_tree()
139 (unsigned long long) ext->start + ext->count, in check_tree()
140 (unsigned long long) ext->count); in check_tree()
144 old = ext; in check_tree()
158 static void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start, in rb_get_new_extent() argument
171 *ext = new_ext; in rb_get_new_extent()
176 struct bmap_rb_extent *ext) in rb_free_extent() argument
178 if (bp->wcursor == ext) in rb_free_extent()
180 if (bp->rcursor == ext) in rb_free_extent()
182 if (bp->rcursor_next == ext) in rb_free_extent()
184 ext2fs_free_mem(&ext); in rb_free_extent()
224 struct bmap_rb_extent *ext; in rb_free_tree() local
229 ext = node_to_extent(node); in rb_free_tree()
231 ext2fs_free_mem(&ext); in rb_free_tree()
293 struct bmap_rb_extent *ext; in rb_truncate() local
298 ext = node_to_extent(node); in rb_truncate()
300 if ((ext->start + ext->count - 1) <= new_max) in rb_truncate()
302 else if (ext->start > new_max) { in rb_truncate()
304 ext2fs_free_mem(&ext); in rb_truncate()
308 ext->count = new_max - ext->start + 1; in rb_truncate()
340 struct bmap_rb_extent *ext; in rb_test_bit() local
383 ext = node_to_extent(parent); in rb_test_bit()
384 if (bit < ext->start) in rb_test_bit()
386 else if (bit >= (ext->start + ext->count)) in rb_test_bit()
389 bp->rcursor = ext; in rb_test_bit()
404 struct bmap_rb_extent *ext; in rb_insert_extent() local
411 ext = bp->wcursor; in rb_insert_extent()
412 if (ext) { in rb_insert_extent()
413 if (start >= ext->start && in rb_insert_extent()
414 start <= (ext->start + ext->count)) { in rb_insert_extent()
424 ext = node_to_extent(parent); in rb_insert_extent()
426 if (start < ext->start) { in rb_insert_extent()
428 } else if (start > (ext->start + ext->count)) { in rb_insert_extent()
432 if ((start + count) <= (ext->start + ext->count)) in rb_insert_extent()
435 if ((ext->start + ext->count) == start) in rb_insert_extent()
440 count += (start - ext->start); in rb_insert_extent()
441 start = ext->start; in rb_insert_extent()
442 new_ext = ext; in rb_insert_extent()
443 new_node = &ext->node; in rb_insert_extent()
458 ext = node_to_extent(node); in rb_insert_extent()
459 if ((ext->start + ext->count) == start) { in rb_insert_extent()
460 start = ext->start; in rb_insert_extent()
461 count += ext->count; in rb_insert_extent()
463 rb_free_extent(bp, ext); in rb_insert_extent()
471 ext = node_to_extent(node); in rb_insert_extent()
473 if ((ext->start + ext->count) <= start) in rb_insert_extent()
477 if ((start + count) < ext->start) in rb_insert_extent()
481 if ((start + count) >= (ext->start + ext->count)) { in rb_insert_extent()
483 rb_free_extent(bp, ext); in rb_insert_extent()
487 count += ((ext->start + ext->count) - in rb_insert_extent()
490 rb_free_extent(bp, ext); in rb_insert_extent()
507 struct bmap_rb_extent *ext; in rb_remove_extent() local
516 ext = node_to_extent(parent); in rb_remove_extent()
517 if (start < ext->start) { in rb_remove_extent()
520 } else if (start >= (ext->start + ext->count)) { in rb_remove_extent()
525 if ((start > ext->start) && in rb_remove_extent()
526 (start + count) < (ext->start + ext->count)) { in rb_remove_extent()
529 new_count = (ext->start + ext->count) - new_start; in rb_remove_extent()
531 ext->count = start - ext->start; in rb_remove_extent()
537 if ((start + count) >= (ext->start + ext->count)) { in rb_remove_extent()
538 ext->count = start - ext->start; in rb_remove_extent()
542 if (0 == ext->count) { in rb_remove_extent()
543 parent = ext2fs_rb_next(&ext->node); in rb_remove_extent()
544 ext2fs_rb_erase(&ext->node, root); in rb_remove_extent()
545 rb_free_extent(bp, ext); in rb_remove_extent()
549 if (start == ext->start) { in rb_remove_extent()
550 ext->start += count; in rb_remove_extent()
551 ext->count -= count; in rb_remove_extent()
559 ext = node_to_extent(parent); in rb_remove_extent()
560 if ((ext->start + ext->count) <= start) in rb_remove_extent()
564 if ((start + count) < ext->start) in rb_remove_extent()
568 if ((start + count) >= (ext->start + ext->count)) { in rb_remove_extent()
570 rb_free_extent(bp, ext); in rb_remove_extent()
575 ext->count -= ((start + count) - ext->start); in rb_remove_extent()
576 ext->start = start + count; in rb_remove_extent()
653 struct bmap_rb_extent *ext; in rb_test_clear_bmap_extent() local
670 ext = node_to_extent(parent); in rb_test_clear_bmap_extent()
671 if (start < ext->start) { in rb_test_clear_bmap_extent()
673 } else if (start >= (ext->start + ext->count)) { in rb_test_clear_bmap_extent()
687 ext = node_to_extent(node); in rb_test_clear_bmap_extent()
690 if ((ext->start + ext->count) <= start) in rb_test_clear_bmap_extent()
694 if ((start + len) <= ext->start) in rb_test_clear_bmap_extent()
755 struct bmap_rb_extent *ext; in rb_get_bmap_range() local
767 ext = node_to_extent(parent); in rb_get_bmap_range()
768 if (start < ext->start) { in rb_get_bmap_range()
770 } else if (start >= (ext->start + ext->count)) { in rb_get_bmap_range()
780 ext = node_to_extent(parent); in rb_get_bmap_range()
782 pos = ext->start; in rb_get_bmap_range()
783 count = ext->count; in rb_get_bmap_range()
832 struct bmap_rb_extent *ext; in rb_find_first_zero() local
847 ext = node_to_extent(parent); in rb_find_first_zero()
848 if (start < ext->start) { in rb_find_first_zero()
850 } else if (start >= (ext->start + ext->count)) { in rb_find_first_zero()
852 } else if (ext->start + ext->count <= end) { in rb_find_first_zero()
853 *out = ext->start + ext->count + bitmap->start; in rb_find_first_zero()
869 struct bmap_rb_extent *ext; in rb_find_first_set() local
884 ext = node_to_extent(parent); in rb_find_first_set()
885 if (start < ext->start) { in rb_find_first_set()
887 } else if (start >= (ext->start + ext->count)) { in rb_find_first_set()
897 ext = node_to_extent(node); in rb_find_first_set()
898 if (ext->start < start) { in rb_find_first_set()
902 ext = node_to_extent(node); in rb_find_first_set()
904 if (ext->start <= end) { in rb_find_first_set()
905 *out = ext->start + bitmap->start; in rb_find_first_set()
916 struct bmap_rb_extent *ext; in rb_print_stats() local
931 ext = node_to_extent(node); in rb_print_stats()
933 if (ext->count > max_size) in rb_print_stats()
934 max_size = ext->count; in rb_print_stats()
935 if (ext->count < min_size) in rb_print_stats()
936 min_size = ext->count; in rb_print_stats()
937 size += ext->count; in rb_print_stats()