Lines Matching refs:start
39 __u64 start; member
65 static int rb_insert_extent(__u64 start, __u64 count,
83 (unsigned long long) ext->start, in print_tree()
84 (unsigned long long) ext->start + ext->count); in print_tree()
100 (unsigned long long) ext->start, in check_tree()
101 (unsigned long long) ext->start + 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()
116 if (old->start > ext->start) { in check_tree()
119 (unsigned long long) old->start, in check_tree()
120 (unsigned long long) old->start + old->count, in check_tree()
124 (unsigned long long) ext->start, in check_tree()
125 (unsigned long long) ext->start + ext->count, in check_tree()
129 if ((old->start + old->count) >= ext->start) { in check_tree()
133 (unsigned long long) old->start, in check_tree()
134 (unsigned long long) old->start + old->count, in check_tree()
138 (unsigned long long) ext->start, in check_tree()
139 (unsigned long long) ext->start + ext->count, in check_tree()
158 static void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start, in rb_get_new_extent() argument
169 new_ext->start = start; in rb_get_new_extent()
300 if ((ext->start + ext->count - 1) <= new_max) in rb_truncate()
302 else if (ext->start > new_max) { in rb_truncate()
308 ext->count = new_max - ext->start + 1; in rb_truncate()
321 rb_truncate(((new_end < bmap->end) ? new_end : bmap->end) - bmap->start, in rb_resize_bmap()
328 rb_insert_extent(bmap->end + 1 - bmap->start, in rb_resize_bmap()
346 if (bit >= rcursor->start && bit < rcursor->start + rcursor->count) { in rb_test_bit()
361 if ((bit >= rcursor->start + rcursor->count) && in rb_test_bit()
362 (bit < next_ext->start)) { in rb_test_bit()
376 if (bit >= rcursor->start && bit < rcursor->start + rcursor->count) 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()
397 static int rb_insert_extent(__u64 start, __u64 count, in rb_insert_extent() argument
413 if (start >= ext->start && in rb_insert_extent()
414 start <= (ext->start + ext->count)) { 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()
449 rb_get_new_extent(&new_ext, start, count); in rb_insert_extent()
459 if ((ext->start + ext->count) == start) { in rb_insert_extent()
460 start = ext->start; 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()
487 count += ((ext->start + ext->count) - in rb_insert_extent()
488 (start + count)); in rb_insert_extent()
495 new_ext->start = start; in rb_insert_extent()
501 static int rb_remove_extent(__u64 start, __u64 count, in rb_remove_extent() argument
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()
528 new_start = start + 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()
549 if (start == ext->start) { in rb_remove_extent()
550 ext->start += count; 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()
575 ext->count -= ((start + count) - ext->start); in rb_remove_extent()
576 ext->start = start + count; in rb_remove_extent()
591 arg -= bitmap->start; in rb_mark_bmap()
604 arg -= bitmap->start; in rb_unmark_bmap()
618 arg -= bitmap->start; in rb_test_bmap()
629 arg -= bitmap->start; in rb_mark_bmap_extent()
641 arg -= bitmap->start; in rb_unmark_bmap_extent()
648 __u64 start, unsigned int len) in rb_test_clear_bmap_extent() argument
658 start -= bitmap->start; 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()
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()
704 __u64 start, size_t num, void *in) in rb_set_bmap_range() argument
735 rb_insert_extent(start + first_set - bitmap->start, in rb_set_bmap_range()
741 rb_insert_extent(start + first_set - bitmap->start, in rb_set_bmap_range()
750 __u64 start, size_t num, void *out) in rb_get_bmap_range() argument
760 start -= bitmap->start; 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()
782 pos = ext->start; in rb_get_bmap_range()
784 if (pos >= start + num) in rb_get_bmap_range()
786 if (pos < start) { in rb_get_bmap_range()
787 if (pos + count < start) in rb_get_bmap_range()
789 count -= start - pos; in rb_get_bmap_range()
790 pos = start; in rb_get_bmap_range()
792 if (pos + count > start + num) in rb_get_bmap_range()
793 count = start + num - pos; in rb_get_bmap_range()
797 ((pos - start) % 8) == 0) { in rb_get_bmap_range()
799 int offset = (pos - start) >> 3; in rb_get_bmap_range()
806 ext2fs_fast_set_bit64((pos - start), out); in rb_get_bmap_range()
828 __u64 start, __u64 end, __u64 *out) in rb_find_first_zero() argument
836 start -= bitmap->start; in rb_find_first_zero()
837 end -= bitmap->start; in rb_find_first_zero()
839 if (start > end) 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()
859 *out = start + bitmap->start; in rb_find_first_zero()
864 __u64 start, __u64 end, __u64 *out) in rb_find_first_set() argument
873 start -= bitmap->start; in rb_find_first_set()
874 end -= bitmap->start; in rb_find_first_set()
876 if (start > end) 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()
891 *out = start + bitmap->start; in rb_find_first_set()
898 if (ext->start < start) { 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()
945 (bitmap->real_end - bitmap->start); in rb_print_stats()
969 (unsigned long long) bitmap->real_end - bitmap->start); in rb_print_stats()