Lines Matching refs:start

47 		       state->start, state->end, state->state,  in btrfs_extent_state_leak_debug_check()
55 #define btrfs_debug_check_extent_io_range(tree, start, end) \ argument
56 __btrfs_debug_check_extent_io_range(__func__, (tree), (start), (end))
59 u64 start, u64 end) in __btrfs_debug_check_extent_io_range() argument
71 caller, btrfs_ino(inode), isize, start, end); in __btrfs_debug_check_extent_io_range()
91 u64 start; member
190 changeset->bytes_changed += state->end - state->start + 1; in add_extent_changeset()
191 ret = ulist_add(&changeset->range_changed, state->start, state->end, in add_extent_changeset()
247 if (offset < entry->start) in tree_search_for_insert()
295 if (offset < entry->start) in tree_search_prev_next()
309 while (entry && offset < entry->start) in tree_search_prev_next()
347 if (other && other->end == state->start - 1 && in merge_state()
351 state->start = other->start; in merge_state()
357 if (other && other->start == state->end + 1 && in merge_state()
410 if (end < entry->start) { in insert_state()
417 entry->start, entry->end, state->start, end); in insert_state()
466 prealloc->start = orig->start; in split_state()
469 orig->start = split; in split_state()
479 if (prealloc->end < entry->start) { in split_state()
557 int __clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, in __clear_extent_bit() argument
572 btrfs_debug_check_extent_io_range(tree, start, end); in __clear_extent_bit()
573 trace_btrfs_clear_extent_bit(tree, start, end - start + 1, bits); in __clear_extent_bit()
606 cached->start <= start && cached->end > start) { in __clear_extent_bit()
617 state = tree_search(tree, start); in __clear_extent_bit()
621 if (state->start > end) in __clear_extent_bit()
623 WARN_ON(state->end < start); in __clear_extent_bit()
647 if (state->start < start) { in __clear_extent_bit()
651 err = split_state(tree, state, prealloc, start); in __clear_extent_bit()
669 if (state->start <= end && state->end > end) { in __clear_extent_bit()
690 start = last_end + 1; in __clear_extent_bit()
691 if (start <= end && state && !need_resched()) in __clear_extent_bit()
695 if (start > end) in __clear_extent_bit()
729 void wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, u32 bits, in wait_extent_bit() argument
734 btrfs_debug_check_extent_io_range(tree, start, end); in wait_extent_bit()
745 state->start <= start && start < state->end) in wait_extent_bit()
753 state = tree_search(tree, start); in wait_extent_bit()
757 if (state->start > end) in wait_extent_bit()
761 start = state->start; in wait_extent_bit()
767 start = state->end + 1; in wait_extent_bit()
769 if (start > end) in wait_extent_bit()
812 u64 start, u32 bits) in find_first_extent_bit_state() argument
820 state = tree_search(tree, start); in find_first_extent_bit_state()
822 if (state->end >= start && (state->state & bits)) in find_first_extent_bit_state()
837 bool find_first_extent_bit(struct extent_io_tree *tree, u64 start, in find_first_extent_bit() argument
847 if (state->end == start - 1 && extent_state_in_tree(state)) { in find_first_extent_bit()
860 state = find_first_extent_bit_state(tree, start, bits); in find_first_extent_bit()
864 *start_ret = state->start; in find_first_extent_bit()
889 int find_contiguous_extent_bit(struct extent_io_tree *tree, u64 start, in find_contiguous_extent_bit() argument
896 state = find_first_extent_bit_state(tree, start, bits); in find_contiguous_extent_bit()
898 *start_ret = state->start; in find_contiguous_extent_bit()
901 if (state->start > (*end_ret + 1)) in find_contiguous_extent_bit()
917 bool btrfs_find_delalloc_range(struct extent_io_tree *tree, u64 *start, in btrfs_find_delalloc_range() argument
922 u64 cur_start = *start; in btrfs_find_delalloc_range()
939 if (found && (state->start != cur_start || in btrfs_find_delalloc_range()
949 *start = state->start; in btrfs_find_delalloc_range()
956 total_bytes += state->end - state->start + 1; in btrfs_find_delalloc_range()
980 static int __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, in __set_extent_bit() argument
997 btrfs_debug_check_extent_io_range(tree, start, end); in __set_extent_bit()
998 trace_btrfs_set_extent_bit(tree, start, end - start + 1, bits); in __set_extent_bit()
1019 if (state->start <= start && state->end > start && in __set_extent_bit()
1027 state = tree_search_for_insert(tree, start, &p, &parent); in __set_extent_bit()
1032 prealloc->start = start; in __set_extent_bit()
1040 last_start = state->start; in __set_extent_bit()
1049 if (state->start == start && state->end <= end) { in __set_extent_bit()
1051 *failed_start = state->start; in __set_extent_bit()
1062 start = last_end + 1; in __set_extent_bit()
1064 if (start < end && state && state->start == start && in __set_extent_bit()
1085 if (state->start < start) { in __set_extent_bit()
1087 *failed_start = start; in __set_extent_bit()
1098 start = state->end + 1; in __set_extent_bit()
1106 err = split_state(tree, state, prealloc, start); in __set_extent_bit()
1119 start = last_end + 1; in __set_extent_bit()
1121 if (start < end && state && state->start == start && in __set_extent_bit()
1134 if (state->start > start) { in __set_extent_bit()
1149 prealloc->start = start; in __set_extent_bit()
1157 start = this_end + 1; in __set_extent_bit()
1166 if (state->start <= end && state->end > end) { in __set_extent_bit()
1168 *failed_start = start; in __set_extent_bit()
1189 if (start > end) in __set_extent_bit()
1205 int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, in set_extent_bit() argument
1208 return __set_extent_bit(tree, start, end, bits, NULL, NULL, in set_extent_bit()
1230 int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, in convert_extent_bit() argument
1243 btrfs_debug_check_extent_io_range(tree, start, end); in convert_extent_bit()
1244 trace_btrfs_convert_extent_bit(tree, start, end - start + 1, bits, in convert_extent_bit()
1264 if (state->start <= start && state->end > start && in convert_extent_bit()
1273 state = tree_search_for_insert(tree, start, &p, &parent); in convert_extent_bit()
1280 prealloc->start = start; in convert_extent_bit()
1288 last_start = state->start; in convert_extent_bit()
1297 if (state->start == start && state->end <= end) { in convert_extent_bit()
1303 start = last_end + 1; in convert_extent_bit()
1304 if (start < end && state && state->start == start && in convert_extent_bit()
1325 if (state->start < start) { in convert_extent_bit()
1331 err = split_state(tree, state, prealloc, start); in convert_extent_bit()
1343 start = last_end + 1; in convert_extent_bit()
1344 if (start < end && state && state->start == start && in convert_extent_bit()
1357 if (state->start > start) { in convert_extent_bit()
1374 prealloc->start = start; in convert_extent_bit()
1381 start = this_end + 1; in convert_extent_bit()
1390 if (state->start <= end && state->end > end) { in convert_extent_bit()
1409 if (start > end) in convert_extent_bit()
1439 void find_first_clear_extent_bit(struct extent_io_tree *tree, u64 start, in find_first_clear_extent_bit() argument
1449 state = tree_search_prev_next(tree, start, &prev, &next); in find_first_clear_extent_bit()
1474 if (in_range(start, state->start, state->end - state->start + 1)) { in find_first_clear_extent_bit()
1481 start = state->end + 1; in find_first_clear_extent_bit()
1492 *start_ret = state->start; in find_first_clear_extent_bit()
1520 if (state->end >= start && !(state->state & bits)) { in find_first_clear_extent_bit()
1523 *end_ret = state->start - 1; in find_first_clear_extent_bit()
1558 u64 *start, u64 search_end, u64 max_bytes, in count_range_bits() argument
1564 u64 cur_start = *start; in count_range_bits()
1582 if (cached->start <= cur_start && cur_start <= cached->end) { in count_range_bits()
1584 } else if (cached->start > cur_start) { in count_range_bits()
1597 else if (prev->start <= cur_start && cur_start <= prev->end) in count_range_bits()
1610 if (state->start > search_end) in count_range_bits()
1612 if (contig && found && state->start > last + 1) in count_range_bits()
1616 max(cur_start, state->start); in count_range_bits()
1620 *start = max(cur_start, state->start); in count_range_bits()
1647 int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, in test_range_bit() argument
1654 if (cached && extent_state_in_tree(cached) && cached->start <= start && in test_range_bit()
1655 cached->end > start) in test_range_bit()
1658 state = tree_search(tree, start); in test_range_bit()
1659 while (state && start <= end) { in test_range_bit()
1660 if (filled && state->start > start) { in test_range_bit()
1665 if (state->start > end) in test_range_bit()
1680 start = state->end + 1; in test_range_bit()
1681 if (start > end) in test_range_bit()
1694 int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, in set_record_extent_bits() argument
1705 return __set_extent_bit(tree, start, end, bits, NULL, NULL, NULL, changeset); in set_record_extent_bits()
1708 int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, in clear_record_extent_bits() argument
1717 return __clear_extent_bit(tree, start, end, bits, NULL, changeset); in clear_record_extent_bits()
1720 int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end, in try_lock_extent() argument
1726 err = __set_extent_bit(tree, start, end, EXTENT_LOCKED, &failed_start, in try_lock_extent()
1729 if (failed_start > start) in try_lock_extent()
1730 clear_extent_bit(tree, start, failed_start - 1, in try_lock_extent()
1741 int lock_extent(struct extent_io_tree *tree, u64 start, u64 end, in lock_extent() argument
1748 err = __set_extent_bit(tree, start, end, EXTENT_LOCKED, &failed_start, in lock_extent()
1751 if (failed_start != start) in lock_extent()
1752 clear_extent_bit(tree, start, failed_start - 1, in lock_extent()
1757 err = __set_extent_bit(tree, start, end, EXTENT_LOCKED, in lock_extent()