Lines Matching full:eb

587 	struct extent_buffer *eb;  in create_reloc_root()  local
622 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
645 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
657 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
658 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
668 btrfs_tree_unlock(eb); in create_reloc_root()
669 free_extent_buffer(eb); in create_reloc_root()
986 static noinline_for_stack int memcmp_node_keys(const struct extent_buffer *eb, in memcmp_node_keys() argument
992 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1013 struct extent_buffer *eb; in replace_path() local
1036 eb = btrfs_lock_root_node(dest); in replace_path()
1037 level = btrfs_header_level(eb); in replace_path()
1040 btrfs_tree_unlock(eb); in replace_path()
1041 free_extent_buffer(eb); in replace_path()
1046 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1049 btrfs_tree_unlock(eb); in replace_path()
1050 free_extent_buffer(eb); in replace_path()
1061 parent = eb; in replace_path()
1080 eb = path->nodes[level]; in replace_path()
1081 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1083 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1102 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1103 if (IS_ERR(eb)) { in replace_path()
1104 ret = PTR_ERR(eb); in replace_path()
1107 btrfs_tree_lock(eb); in replace_path()
1109 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1110 slot, &eb, in replace_path()
1113 btrfs_tree_unlock(eb); in replace_path()
1114 free_extent_buffer(eb); in replace_path()
1122 parent = eb; in replace_path()
1250 struct extent_buffer *eb; in walk_up_reloc_tree() local
1263 eb = path->nodes[i]; in walk_up_reloc_tree()
1264 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1267 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1287 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1296 eb = path->nodes[i]; in walk_down_reloc_tree()
1297 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1299 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1315 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1316 if (IS_ERR(eb)) in walk_down_reloc_tree()
1317 return PTR_ERR(eb); in walk_down_reloc_tree()
1318 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1319 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2197 struct extent_buffer *eb; in do_relocation() local
2205 * block, and thus shouldn't have an eb associated with it yet. in do_relocation()
2207 ASSERT(!lowest || !node->eb); in do_relocation()
2221 if (upper->eb && !upper->locked) { in do_relocation()
2223 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2227 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2228 if (node->eb->start == bytenr) in do_relocation()
2234 if (!upper->eb) { in do_relocation()
2244 if (!upper->eb) { in do_relocation()
2245 upper->eb = path->nodes[upper->level]; in do_relocation()
2248 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2257 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2263 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2269 upper->eb->start); in do_relocation()
2274 if (node->eb->start == bytenr) in do_relocation()
2279 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2280 if (IS_ERR(eb)) { in do_relocation()
2281 ret = PTR_ERR(eb); in do_relocation()
2284 btrfs_tree_lock(eb); in do_relocation()
2286 if (!node->eb) { in do_relocation()
2287 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2288 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2289 btrfs_tree_unlock(eb); in do_relocation()
2290 free_extent_buffer(eb); in do_relocation()
2297 ASSERT(node->eb == eb); in do_relocation()
2301 .bytenr = node->eb->start, in do_relocation()
2303 .parent = upper->eb->start, in do_relocation()
2304 .owning_root = btrfs_header_owner(upper->eb), in do_relocation()
2305 .ref_root = btrfs_header_owner(upper->eb), in do_relocation()
2308 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2309 node->eb->start); in do_relocation()
2310 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2312 btrfs_mark_buffer_dirty(trans, upper->eb); in do_relocation()
2318 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2319 upper->eb); in do_relocation()
2355 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2437 struct extent_buffer *eb; in get_tree_block_key() local
2439 eb = read_tree_block(fs_info, block->bytenr, &check); in get_tree_block_key()
2440 if (IS_ERR(eb)) in get_tree_block_key()
2441 return PTR_ERR(eb); in get_tree_block_key()
2442 if (unlikely(!extent_buffer_uptodate(eb))) { in get_tree_block_key()
2443 free_extent_buffer(eb); in get_tree_block_key()
2447 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2449 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2450 free_extent_buffer(eb); in get_tree_block_key()
3044 struct extent_buffer *eb; in add_tree_block() local
3054 eb = path->nodes[0]; in add_tree_block()
3055 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3061 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3066 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3072 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3089 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3090 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3097 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3102 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3105 btrfs_print_leaf(eb); in add_tree_block()
3108 eb->start, path->slots[0]); in add_tree_block()
3312 struct extent_buffer *eb; in add_data_references() local
3314 eb = read_tree_block(ctx.fs_info, ref_node->val, &check); in add_data_references()
3315 if (IS_ERR(eb)) { in add_data_references()
3316 ret = PTR_ERR(eb); in add_data_references()
3319 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3321 free_extent_buffer(eb); in add_data_references()
4303 node->eb = cow; in btrfs_reloc_cow_block()