Lines Matching refs:start
39 __u64 start; member
65 static int rb_insert_extent(__u64 start, __u64 count,
83 ext->start, ext->start + ext->count); in print_tree()
99 ext->start, ext->start + 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()
113 if (old->start > ext->start) { in check_tree()
116 old->start, old->start + old->count, in check_tree()
120 ext->start, ext->start + ext->count, in check_tree()
124 if ((old->start + old->count) >= ext->start) { in check_tree()
128 old->start, old->start + old->count, in check_tree()
132 ext->start, ext->start + ext->count, in check_tree()
151 static void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start, in rb_get_new_extent() argument
162 new_ext->start = start; in rb_get_new_extent()
293 if ((ext->start + ext->count - 1) <= new_max) in rb_truncate()
295 else if (ext->start > new_max) { in rb_truncate()
301 ext->count = new_max - ext->start + 1; in rb_truncate()
314 rb_truncate(((new_end < bmap->end) ? new_end : bmap->end) - bmap->start, in rb_resize_bmap()
321 rb_insert_extent(bmap->end + 1 - bmap->start, in rb_resize_bmap()
339 if (bit >= rcursor->start && bit < rcursor->start + rcursor->count) { in rb_test_bit()
354 if ((bit >= rcursor->start + rcursor->count) && in rb_test_bit()
355 (bit < next_ext->start)) { in rb_test_bit()
369 if (bit >= rcursor->start && bit < rcursor->start + rcursor->count) 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()
390 static int rb_insert_extent(__u64 start, __u64 count, in rb_insert_extent() argument
406 if (start >= ext->start && in rb_insert_extent()
407 start <= (ext->start + ext->count)) { 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()
442 rb_get_new_extent(&new_ext, start, count); in rb_insert_extent()
452 if ((ext->start + ext->count) == start) { in rb_insert_extent()
453 start = ext->start; 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()
480 count += ((ext->start + ext->count) - in rb_insert_extent()
481 (start + count)); in rb_insert_extent()
488 new_ext->start = start; in rb_insert_extent()
494 static int rb_remove_extent(__u64 start, __u64 count, in rb_remove_extent() argument
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()
521 new_start = start + 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()
542 if (start == ext->start) { in rb_remove_extent()
543 ext->start += count; 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()
568 ext->count -= ((start + count) - ext->start); in rb_remove_extent()
569 ext->start = start + count; in rb_remove_extent()
584 arg -= bitmap->start; in rb_mark_bmap()
597 arg -= bitmap->start; in rb_unmark_bmap()
611 arg -= bitmap->start; in rb_test_bmap()
622 arg -= bitmap->start; in rb_mark_bmap_extent()
634 arg -= bitmap->start; in rb_unmark_bmap_extent()
641 __u64 start, unsigned int len) in rb_test_clear_bmap_extent() argument
651 start -= bitmap->start; 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()
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()
697 __u64 start, size_t num, void *in) in rb_set_bmap_range() argument
728 rb_insert_extent(start + first_set - bitmap->start, in rb_set_bmap_range()
734 rb_insert_extent(start + first_set - bitmap->start, in rb_set_bmap_range()
743 __u64 start, size_t num, void *out) in rb_get_bmap_range() argument
753 start -= bitmap->start; 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()
775 pos = ext->start; in rb_get_bmap_range()
777 if (pos >= start + num) in rb_get_bmap_range()
779 if (pos < start) { in rb_get_bmap_range()
780 if (pos + count < start) in rb_get_bmap_range()
782 count -= start - pos; in rb_get_bmap_range()
783 pos = start; in rb_get_bmap_range()
785 if (pos + count > start + num) in rb_get_bmap_range()
786 count = start + num - pos; in rb_get_bmap_range()
790 ((pos - start) % 8) == 0) { in rb_get_bmap_range()
792 int offset = (pos - start) >> 3; in rb_get_bmap_range()
799 ext2fs_fast_set_bit64((pos - start), out); in rb_get_bmap_range()
821 __u64 start, __u64 end, __u64 *out) in rb_find_first_zero() argument
829 start -= bitmap->start; in rb_find_first_zero()
830 end -= bitmap->start; in rb_find_first_zero()
832 if (start > end) 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()
852 *out = start + bitmap->start; in rb_find_first_zero()
857 __u64 start, __u64 end, __u64 *out) in rb_find_first_set() argument
866 start -= bitmap->start; in rb_find_first_set()
867 end -= bitmap->start; in rb_find_first_set()
869 if (start > end) 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()
884 *out = start + bitmap->start; in rb_find_first_set()
891 if (ext->start < start) { 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()
938 (bitmap->real_end - bitmap->start); in rb_print_stats()
960 bitmap->real_end - bitmap->start); in rb_print_stats()