Lines Matching refs:start

77 static u64 range_end(u64 start, u64 len)  in range_end()  argument
79 if (start + len < start) in range_end()
81 return start + len; in range_end()
90 u64 end = range_end(em->start, em->len); in tree_insert()
97 if (em->start < entry->start) { in tree_insert()
99 } else if (em->start >= extent_map_end(entry)) { in tree_insert()
108 while (parent && em->start >= extent_map_end(entry)) { in tree_insert()
113 if (end > entry->start && em->start < extent_map_end(entry)) in tree_insert()
118 while (parent && em->start < entry->start) { in tree_insert()
123 if (end > entry->start && em->start < extent_map_end(entry)) in tree_insert()
151 if (offset < entry->start) in __tree_search()
176 while (prev && offset < prev_entry->start) { in __tree_search()
217 if (extent_map_end(prev) == next->start && in mergable_maps()
247 if (em->start != 0) { in try_merge_map()
252 em->start = merge->start; in try_merge_map()
295 int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, in unpin_extent_cache() argument
303 em = lookup_extent_mapping(tree, start, len); in unpin_extent_cache()
305 WARN_ON(!em || em->start != start); in unpin_extent_cache()
312 em->mod_start = em->start; in unpin_extent_cache()
323 em->mod_start = em->start; in unpin_extent_cache()
348 em->mod_start = em->start; in setup_extent_mapping()
425 u64 start, u64 len, int strict) in __lookup_extent_mapping() argument
430 u64 end = range_end(start, len); in __lookup_extent_mapping()
432 rb_node = __tree_search(&tree->map.rb_root, start, &prev_or_next); in __lookup_extent_mapping()
442 if (strict && !(end > em->start && start < extent_map_end(em))) in __lookup_extent_mapping()
462 u64 start, u64 len) in lookup_extent_mapping() argument
464 return __lookup_extent_mapping(tree, start, len, 1); in lookup_extent_mapping()
480 u64 start, u64 len) in search_extent_mapping() argument
482 return __lookup_extent_mapping(tree, start, len, 0); in search_extent_mapping()
557 u64 start; in merge_extent_mapping() local
561 BUG_ON(map_start < em->start || map_start >= extent_map_end(em)); in merge_extent_mapping()
563 if (existing->start > map_start) { in merge_extent_mapping()
571 start = prev ? extent_map_end(prev) : em->start; in merge_extent_mapping()
572 start = max_t(u64, start, em->start); in merge_extent_mapping()
573 end = next ? next->start : extent_map_end(em); in merge_extent_mapping()
575 start_diff = start - em->start; in merge_extent_mapping()
576 em->start = start; in merge_extent_mapping()
577 em->len = end - start; in merge_extent_mapping()
609 struct extent_map **em_in, u64 start, u64 len) in btrfs_add_extent_mapping() argument
619 ASSERT(em->start == 0); in btrfs_add_extent_mapping()
631 existing = search_extent_mapping(em_tree, start, len); in btrfs_add_extent_mapping()
633 trace_btrfs_handle_em_exist(fs_info, existing, em, start, len); in btrfs_add_extent_mapping()
639 if (start >= existing->start && in btrfs_add_extent_mapping()
640 start < extent_map_end(existing)) { in btrfs_add_extent_mapping()
645 u64 orig_start = em->start; in btrfs_add_extent_mapping()
653 em, start); in btrfs_add_extent_mapping()
659 ret, existing->start, existing->len, in btrfs_add_extent_mapping()
707 void btrfs_drop_extent_map_range(struct btrfs_inode *inode, u64 start, u64 end, in btrfs_drop_extent_map_range() argument
714 u64 len = end - start + 1; in btrfs_drop_extent_map_range()
716 WARN_ON(end < start); in btrfs_drop_extent_map_range()
718 if (start == 0 && !skip_pinned) { in btrfs_drop_extent_map_range()
740 em = lookup_extent_mapping(em_tree, start, len); in btrfs_drop_extent_map_range()
754 if (next_em->start < end) in btrfs_drop_extent_map_range()
762 start = em_end; in btrfs_drop_extent_map_range()
780 if (em->start >= start && em_end <= end) in btrfs_drop_extent_map_range()
786 if (em->start < start) { in btrfs_drop_extent_map_range()
793 split->start = em->start; in btrfs_drop_extent_map_range()
794 split->len = start - em->start; in btrfs_drop_extent_map_range()
808 split->orig_start = split->start; in btrfs_drop_extent_map_range()
830 split->start = end; in btrfs_drop_extent_map_range()
846 const u64 diff = start + len - em->start; in btrfs_drop_extent_map_range()
854 split->orig_start = split->start; in btrfs_drop_extent_map_range()
897 if ((em->start < start || em_end > end) && modified) { in btrfs_drop_extent_map_range()
939 const u64 end = new_em->start + new_em->len - 1; in btrfs_replace_extent_map_range()
954 btrfs_drop_extent_map_range(inode, new_em->start, end, false); in btrfs_replace_extent_map_range()
969 int split_extent_map(struct btrfs_inode *inode, u64 start, u64 len, u64 pre, in split_extent_map() argument
991 lock_extent(&inode->io_tree, start, start + len - 1, NULL); in split_extent_map()
993 em = lookup_extent_mapping(em_tree, start, len); in split_extent_map()
1010 split_pre->start = em->start; in split_extent_map()
1012 split_pre->orig_start = split_pre->start; in split_extent_map()
1029 split_mid->start = em->start + pre; in split_extent_map()
1031 split_mid->orig_start = split_mid->start; in split_extent_map()
1048 unlock_extent(&inode->io_tree, start, start + len - 1, NULL); in split_extent_map()