Lines Matching +full:lower +full:- +full:case

1 /* SPDX-License-Identifier: GPL-2.0 */
12 #include "disk-io.h"
18 * The value must be non-negative and must not be 0, 1 (which is a common return
27 * continue. Can return BTRFS_ITERATE_EXTENT_INODES_STOP or any other non-zero
78 * Time sequence acquired from btrfs_get_tree_mod_seq(), in case the
82 * commit roots when searching b+trees - this is a special case for
93 * extent is accessible. Can be NULL in case the caller does not care
187 * case we don't have multiple file extent items that point to the same
278 btrfs_free_path(iter->path); in btrfs_backref_iter_free()
287 return iter->path->nodes[0]; in btrfs_backref_get_eb()
291 * For metadata with EXTENT_ITEM key (non-skinny) case, the first inline data
294 * This helper determines if that's the case.
299 if (iter->cur_key.type == BTRFS_EXTENT_ITEM_KEY && in btrfs_backref_has_tree_block_info()
300 iter->cur_ptr - iter->item_ptr == sizeof(struct btrfs_extent_item)) in btrfs_backref_has_tree_block_info()
312 if (iter->cur_key.type == BTRFS_EXTENT_ITEM_KEY || in btrfs_backref_iter_is_inline_ref()
313 iter->cur_key.type == BTRFS_METADATA_ITEM_KEY) in btrfs_backref_iter_is_inline_ref()
320 iter->bytenr = 0; in btrfs_backref_iter_release()
321 iter->item_ptr = 0; in btrfs_backref_iter_release()
322 iter->cur_ptr = 0; in btrfs_backref_iter_release()
323 iter->end_ptr = 0; in btrfs_backref_iter_release()
324 btrfs_release_path(iter->path); in btrfs_backref_iter_release()
325 memset(&iter->cur_key, 0, sizeof(iter->cur_key)); in btrfs_backref_iter_release()
331 * The whole objective of backref_cache is to build a bi-directional map
352 /* List of lower level edges, which link this node to its children */
353 struct list_head lower; member
361 /* Is the block in a non-shareable tree */
386 #define LOWER 0 macro
390 * Represent an edge connecting upper and lower backref nodes.
394 * list[LOWER] is linked to btrfs_backref_node::upper of lower level
395 * node, and list[UPPER] is linked to btrfs_backref_node::lower of
456 struct btrfs_backref_node *lower, in btrfs_backref_link_edge() argument
460 ASSERT(upper && lower && upper->level == lower->level + 1); in btrfs_backref_link_edge()
461 edge->node[LOWER] = lower; in btrfs_backref_link_edge()
462 edge->node[UPPER] = upper; in btrfs_backref_link_edge()
464 list_add_tail(&edge->list[LOWER], &lower->upper); in btrfs_backref_link_edge()
466 list_add_tail(&edge->list[UPPER], &upper->lower); in btrfs_backref_link_edge()
473 ASSERT(list_empty(&node->list)); in btrfs_backref_free_node()
474 ASSERT(list_empty(&node->lower)); in btrfs_backref_free_node()
475 ASSERT(node->eb == NULL); in btrfs_backref_free_node()
476 cache->nr_nodes--; in btrfs_backref_free_node()
477 btrfs_put_root(node->root); in btrfs_backref_free_node()
486 cache->nr_edges--; in btrfs_backref_free_edge()
494 if (node->locked) { in btrfs_backref_unlock_node_buffer()
495 btrfs_tree_unlock(node->eb); in btrfs_backref_unlock_node_buffer()
496 node->locked = 0; in btrfs_backref_unlock_node_buffer()
503 if (node->eb) { in btrfs_backref_drop_node_buffer()
505 free_extent_buffer(node->eb); in btrfs_backref_drop_node_buffer()
506 node->eb = NULL; in btrfs_backref_drop_node_buffer()
520 ASSERT(list_empty(&node->upper)); in btrfs_backref_drop_node()
523 list_del_init(&node->list); in btrfs_backref_drop_node()
524 list_del_init(&node->lower); in btrfs_backref_drop_node()
525 if (!RB_EMPTY_NODE(&node->rb_node)) in btrfs_backref_drop_node()
526 rb_erase(&node->rb_node, &tree->rb_root); in btrfs_backref_drop_node()