Lines Matching refs:eb
588 struct extent_buffer *eb; in create_reloc_root() local
625 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
648 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
661 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
662 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
672 btrfs_tree_unlock(eb); in create_reloc_root()
673 free_extent_buffer(eb); in create_reloc_root()
1001 static noinline_for_stack int memcmp_node_keys(const struct extent_buffer *eb, in memcmp_node_keys() argument
1007 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1028 struct extent_buffer *eb; in replace_path() local
1051 eb = btrfs_lock_root_node(dest); in replace_path()
1052 level = btrfs_header_level(eb); in replace_path()
1055 btrfs_tree_unlock(eb); in replace_path()
1056 free_extent_buffer(eb); in replace_path()
1061 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1064 btrfs_tree_unlock(eb); in replace_path()
1065 free_extent_buffer(eb); in replace_path()
1076 parent = eb; in replace_path()
1095 eb = path->nodes[level]; in replace_path()
1096 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1098 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1117 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1118 if (IS_ERR(eb)) { in replace_path()
1119 ret = PTR_ERR(eb); in replace_path()
1122 btrfs_tree_lock(eb); in replace_path()
1124 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1125 slot, &eb, in replace_path()
1128 btrfs_tree_unlock(eb); in replace_path()
1129 free_extent_buffer(eb); in replace_path()
1137 parent = eb; in replace_path()
1265 struct extent_buffer *eb; in walk_up_reloc_tree() local
1278 eb = path->nodes[i]; in walk_up_reloc_tree()
1279 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1282 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1302 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1311 eb = path->nodes[i]; in walk_down_reloc_tree()
1312 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1314 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1330 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1331 if (IS_ERR(eb)) in walk_down_reloc_tree()
1332 return PTR_ERR(eb); in walk_down_reloc_tree()
1333 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1334 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2212 struct extent_buffer *eb; in do_relocation() local
2222 ASSERT(!lowest || !node->eb); in do_relocation()
2236 if (upper->eb && !upper->locked) { in do_relocation()
2238 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2242 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2243 if (node->eb->start == bytenr) in do_relocation()
2249 if (!upper->eb) { in do_relocation()
2259 if (!upper->eb) { in do_relocation()
2260 upper->eb = path->nodes[upper->level]; in do_relocation()
2263 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2272 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2278 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2284 upper->eb->start); in do_relocation()
2289 if (node->eb->start == bytenr) in do_relocation()
2294 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2295 if (IS_ERR(eb)) { in do_relocation()
2296 ret = PTR_ERR(eb); in do_relocation()
2299 btrfs_tree_lock(eb); in do_relocation()
2301 if (!node->eb) { in do_relocation()
2302 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2303 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2304 btrfs_tree_unlock(eb); in do_relocation()
2305 free_extent_buffer(eb); in do_relocation()
2312 ASSERT(node->eb == eb); in do_relocation()
2316 .bytenr = node->eb->start, in do_relocation()
2318 .parent = upper->eb->start, in do_relocation()
2319 .owning_root = btrfs_header_owner(upper->eb), in do_relocation()
2320 .ref_root = btrfs_header_owner(upper->eb), in do_relocation()
2323 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2324 node->eb->start); in do_relocation()
2325 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2327 btrfs_mark_buffer_dirty(trans, upper->eb); in do_relocation()
2333 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2334 upper->eb); in do_relocation()
2370 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2452 struct extent_buffer *eb; in get_tree_block_key() local
2454 eb = read_tree_block(fs_info, block->bytenr, &check); in get_tree_block_key()
2455 if (IS_ERR(eb)) in get_tree_block_key()
2456 return PTR_ERR(eb); in get_tree_block_key()
2457 if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2458 free_extent_buffer(eb); in get_tree_block_key()
2462 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2464 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2465 free_extent_buffer(eb); in get_tree_block_key()
3061 struct extent_buffer *eb; in add_tree_block() local
3071 eb = path->nodes[0]; in add_tree_block()
3072 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3078 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3083 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3089 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3106 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3107 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3114 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3119 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3122 btrfs_print_leaf(eb); in add_tree_block()
3125 eb->start, path->slots[0]); in add_tree_block()
3333 struct extent_buffer *eb; in add_data_references() local
3335 eb = read_tree_block(ctx.fs_info, ref_node->val, &check); in add_data_references()
3336 if (IS_ERR(eb)) { in add_data_references()
3337 ret = PTR_ERR(eb); in add_data_references()
3340 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3342 free_extent_buffer(eb); in add_data_references()
4334 node->eb = cow; in btrfs_reloc_cow_block()