Lines Matching +full:lower +full:- +full:case
1 /* SPDX-License-Identifier: GPL-2.0 */
11 #include "disk-io.h"
121 btrfs_free_path(iter->path); in btrfs_backref_iter_free()
130 return iter->path->nodes[0]; in btrfs_backref_get_eb()
134 * For metadata with EXTENT_ITEM key (non-skinny) case, the first inline data
137 * This helper determines if that's the case.
142 if (iter->cur_key.type == BTRFS_EXTENT_ITEM_KEY && in btrfs_backref_has_tree_block_info()
143 iter->cur_ptr - iter->item_ptr == sizeof(struct btrfs_extent_item)) in btrfs_backref_has_tree_block_info()
155 if (iter->cur_key.type == BTRFS_EXTENT_ITEM_KEY || in btrfs_backref_iter_is_inline_ref()
156 iter->cur_key.type == BTRFS_METADATA_ITEM_KEY) in btrfs_backref_iter_is_inline_ref()
163 iter->bytenr = 0; in btrfs_backref_iter_release()
164 iter->item_ptr = 0; in btrfs_backref_iter_release()
165 iter->cur_ptr = 0; in btrfs_backref_iter_release()
166 iter->end_ptr = 0; in btrfs_backref_iter_release()
167 btrfs_release_path(iter->path); in btrfs_backref_iter_release()
168 memset(&iter->cur_key, 0, sizeof(iter->cur_key)); in btrfs_backref_iter_release()
174 * The whole objective of backref_cache is to build a bi-directional map
195 /* List of lower level edges, which link this node to its children */
196 struct list_head lower; member
204 /* Is the block in a non-shareable tree */
229 #define LOWER 0 macro
233 * Represent an edge connecting upper and lower backref nodes.
237 * list[LOWER] is linked to btrfs_backref_node::upper of lower level
238 * node, and list[UPPER] is linked to btrfs_backref_node::lower of
299 struct btrfs_backref_node *lower, in btrfs_backref_link_edge() argument
303 ASSERT(upper && lower && upper->level == lower->level + 1); in btrfs_backref_link_edge()
304 edge->node[LOWER] = lower; in btrfs_backref_link_edge()
305 edge->node[UPPER] = upper; in btrfs_backref_link_edge()
307 list_add_tail(&edge->list[LOWER], &lower->upper); in btrfs_backref_link_edge()
309 list_add_tail(&edge->list[UPPER], &upper->lower); in btrfs_backref_link_edge()
316 ASSERT(list_empty(&node->list)); in btrfs_backref_free_node()
317 ASSERT(list_empty(&node->lower)); in btrfs_backref_free_node()
318 ASSERT(node->eb == NULL); in btrfs_backref_free_node()
319 cache->nr_nodes--; in btrfs_backref_free_node()
320 btrfs_put_root(node->root); in btrfs_backref_free_node()
329 cache->nr_edges--; in btrfs_backref_free_edge()
337 if (node->locked) { in btrfs_backref_unlock_node_buffer()
338 btrfs_tree_unlock(node->eb); in btrfs_backref_unlock_node_buffer()
339 node->locked = 0; in btrfs_backref_unlock_node_buffer()
346 if (node->eb) { in btrfs_backref_drop_node_buffer()
348 free_extent_buffer(node->eb); in btrfs_backref_drop_node_buffer()
349 node->eb = NULL; in btrfs_backref_drop_node_buffer()
363 ASSERT(list_empty(&node->upper)); in btrfs_backref_drop_node()
366 list_del_init(&node->list); in btrfs_backref_drop_node()
367 list_del_init(&node->lower); in btrfs_backref_drop_node()
368 if (!RB_EMPTY_NODE(&node->rb_node)) in btrfs_backref_drop_node()
369 rb_erase(&node->rb_node, &tree->rb_root); in btrfs_backref_drop_node()