Lines Matching full:start
87 static u64 range_end(u64 start, u64 len) in range_end() argument
89 if (start + len < start) in range_end()
91 return start + len; in range_end()
100 u64 end = range_end(em->start, em->len); in tree_insert()
107 if (em->start < entry->start) { in tree_insert()
109 } else if (em->start >= extent_map_end(entry)) { in tree_insert()
118 while (parent && em->start >= extent_map_end(entry)) { in tree_insert()
123 if (end > entry->start && em->start < extent_map_end(entry)) in tree_insert()
128 while (parent && em->start < entry->start) { in tree_insert()
133 if (end > entry->start && em->start < extent_map_end(entry)) in tree_insert()
160 if (offset < entry->start) in __tree_search()
180 while (prev && offset < prev_entry->start) { in __tree_search()
221 if (extent_map_end(prev) == next->start && in mergable_maps()
251 if (em->start != 0) { in try_merge_map()
256 em->start = merge->start; in try_merge_map()
288 * @start: logical offset in the file
296 int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, in unpin_extent_cache() argument
304 em = lookup_extent_mapping(tree, start, len); in unpin_extent_cache()
306 WARN_ON(!em || em->start != start); in unpin_extent_cache()
313 em->mod_start = em->start; in unpin_extent_cache()
324 em->mod_start = em->start; in unpin_extent_cache()
347 em->mod_start = em->start; in setup_extent_mapping()
419 u64 start, u64 len, int strict) in __lookup_extent_mapping() argument
425 u64 end = range_end(start, len); in __lookup_extent_mapping()
427 rb_node = __tree_search(&tree->map.rb_root, start, &prev, &next); in __lookup_extent_mapping()
439 if (strict && !(end > em->start && start < extent_map_end(em))) in __lookup_extent_mapping()
449 * @start: byte offset to start the search
453 * [start, len] range. There may be additional objects in the tree that
458 u64 start, u64 len) in lookup_extent_mapping() argument
460 return __lookup_extent_mapping(tree, start, len, 1); in lookup_extent_mapping()
466 * @start: byte offset to start the search
470 * [start, len] range.
475 u64 start, u64 len) in search_extent_mapping() argument
477 return __lookup_extent_mapping(tree, start, len, 0); in search_extent_mapping()
547 u64 start; in merge_extent_mapping() local
551 BUG_ON(map_start < em->start || map_start >= extent_map_end(em)); in merge_extent_mapping()
553 if (existing->start > map_start) { in merge_extent_mapping()
561 start = prev ? extent_map_end(prev) : em->start; in merge_extent_mapping()
562 start = max_t(u64, start, em->start); in merge_extent_mapping()
563 end = next ? next->start : extent_map_end(em); in merge_extent_mapping()
565 start_diff = start - em->start; in merge_extent_mapping()
566 em->start = start; in merge_extent_mapping()
567 em->len = end - start; in merge_extent_mapping()
581 * @start - start of the logical range btrfs_get_extent() is requesting
584 * Note that @em_in's range may be different from [start, start+len),
589 * a) Returning the existing extent in @em_in if @start is within the
598 struct extent_map **em_in, u64 start, u64 len) in btrfs_add_extent_mapping() argument
613 existing = search_extent_mapping(em_tree, start, len); in btrfs_add_extent_mapping()
615 trace_btrfs_handle_em_exist(fs_info, existing, em, start, len); in btrfs_add_extent_mapping()
621 if (start >= existing->start && in btrfs_add_extent_mapping()
622 start < extent_map_end(existing)) { in btrfs_add_extent_mapping()
627 u64 orig_start = em->start; in btrfs_add_extent_mapping()
632 * the [start, start + len) range which overlaps in btrfs_add_extent_mapping()
635 em, start); in btrfs_add_extent_mapping()
640 "unexpected error %d: merge existing(start %llu len %llu) with em(start %llu len %llu)\n", in btrfs_add_extent_mapping()
641 ret, existing->start, existing->len, in btrfs_add_extent_mapping()