Lines Matching refs:eb
579 struct extent_buffer *eb; in create_reloc_root() local
597 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
620 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
633 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
634 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
644 btrfs_tree_unlock(eb); in create_reloc_root()
645 free_extent_buffer(eb); in create_reloc_root()
973 static noinline_for_stack int memcmp_node_keys(const struct extent_buffer *eb, in memcmp_node_keys() argument
979 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1000 struct extent_buffer *eb; in replace_path() local
1023 eb = btrfs_lock_root_node(dest); in replace_path()
1024 level = btrfs_header_level(eb); in replace_path()
1027 btrfs_tree_unlock(eb); in replace_path()
1028 free_extent_buffer(eb); in replace_path()
1033 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1036 btrfs_tree_unlock(eb); in replace_path()
1037 free_extent_buffer(eb); in replace_path()
1048 parent = eb; in replace_path()
1067 eb = path->nodes[level]; in replace_path()
1068 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1070 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1089 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1090 if (IS_ERR(eb)) { in replace_path()
1091 ret = PTR_ERR(eb); in replace_path()
1094 btrfs_tree_lock(eb); in replace_path()
1096 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1097 slot, &eb, in replace_path()
1100 btrfs_tree_unlock(eb); in replace_path()
1101 free_extent_buffer(eb); in replace_path()
1109 parent = eb; in replace_path()
1237 struct extent_buffer *eb; in walk_up_reloc_tree() local
1250 eb = path->nodes[i]; in walk_up_reloc_tree()
1251 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1254 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1274 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1283 eb = path->nodes[i]; in walk_down_reloc_tree()
1284 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1286 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1302 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1303 if (IS_ERR(eb)) in walk_down_reloc_tree()
1304 return PTR_ERR(eb); in walk_down_reloc_tree()
1305 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1306 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2185 struct extent_buffer *eb; in do_relocation() local
2195 ASSERT(!lowest || !node->eb); in do_relocation()
2209 if (upper->eb && !upper->locked) { in do_relocation()
2211 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2215 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2216 if (node->eb->start == bytenr) in do_relocation()
2222 if (!upper->eb) { in do_relocation()
2232 if (!upper->eb) { in do_relocation()
2233 upper->eb = path->nodes[upper->level]; in do_relocation()
2236 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2245 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2251 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2257 upper->eb->start); in do_relocation()
2262 if (node->eb->start == bytenr) in do_relocation()
2267 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2268 if (IS_ERR(eb)) { in do_relocation()
2269 ret = PTR_ERR(eb); in do_relocation()
2272 btrfs_tree_lock(eb); in do_relocation()
2274 if (!node->eb) { in do_relocation()
2275 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2276 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2277 btrfs_tree_unlock(eb); in do_relocation()
2278 free_extent_buffer(eb); in do_relocation()
2285 ASSERT(node->eb == eb); in do_relocation()
2289 .bytenr = node->eb->start, in do_relocation()
2291 .parent = upper->eb->start, in do_relocation()
2292 .owning_root = btrfs_header_owner(upper->eb), in do_relocation()
2293 .ref_root = btrfs_header_owner(upper->eb), in do_relocation()
2296 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2297 node->eb->start); in do_relocation()
2298 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2300 btrfs_mark_buffer_dirty(trans, upper->eb); in do_relocation()
2306 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2307 upper->eb); in do_relocation()
2343 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2425 struct extent_buffer *eb; in get_tree_block_key() local
2427 eb = read_tree_block(fs_info, block->bytenr, &check); in get_tree_block_key()
2428 if (IS_ERR(eb)) in get_tree_block_key()
2429 return PTR_ERR(eb); in get_tree_block_key()
2430 if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2431 free_extent_buffer(eb); in get_tree_block_key()
2435 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2437 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2438 free_extent_buffer(eb); in get_tree_block_key()
3077 struct extent_buffer *eb; in add_tree_block() local
3087 eb = path->nodes[0]; in add_tree_block()
3088 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3094 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3099 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3105 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3122 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3123 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3130 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3135 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3138 btrfs_print_leaf(eb); in add_tree_block()
3141 eb->start, path->slots[0]); in add_tree_block()
3348 struct extent_buffer *eb; in add_data_references() local
3350 eb = read_tree_block(ctx.fs_info, ref_node->val, &check); in add_data_references()
3351 if (IS_ERR(eb)) { in add_data_references()
3352 ret = PTR_ERR(eb); in add_data_references()
3355 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3357 free_extent_buffer(eb); in add_data_references()
4345 node->eb = cow; in btrfs_reloc_cow_block()