Lines Matching refs:eb

673 	struct extent_buffer *eb;  in create_reloc_root()  local
691 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
714 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
727 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
728 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
738 btrfs_tree_unlock(eb); in create_reloc_root()
739 free_extent_buffer(eb); in create_reloc_root()
1071 static noinline_for_stack int memcmp_node_keys(const struct extent_buffer *eb, in memcmp_node_keys() argument
1077 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1098 struct extent_buffer *eb; in replace_path() local
1121 eb = btrfs_lock_root_node(dest); in replace_path()
1122 level = btrfs_header_level(eb); in replace_path()
1125 btrfs_tree_unlock(eb); in replace_path()
1126 free_extent_buffer(eb); in replace_path()
1131 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1134 btrfs_tree_unlock(eb); in replace_path()
1135 free_extent_buffer(eb); in replace_path()
1146 parent = eb; in replace_path()
1165 eb = path->nodes[level]; in replace_path()
1166 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1168 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1187 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1188 if (IS_ERR(eb)) { in replace_path()
1189 ret = PTR_ERR(eb); in replace_path()
1192 btrfs_tree_lock(eb); in replace_path()
1194 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1195 slot, &eb, in replace_path()
1198 btrfs_tree_unlock(eb); in replace_path()
1199 free_extent_buffer(eb); in replace_path()
1207 parent = eb; in replace_path()
1337 struct extent_buffer *eb; in walk_up_reloc_tree() local
1350 eb = path->nodes[i]; in walk_up_reloc_tree()
1351 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1354 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1374 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1383 eb = path->nodes[i]; in walk_down_reloc_tree()
1384 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1386 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1402 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1403 if (IS_ERR(eb)) in walk_down_reloc_tree()
1404 return PTR_ERR(eb); in walk_down_reloc_tree()
1405 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1406 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2308 struct extent_buffer *eb; in do_relocation() local
2318 ASSERT(!lowest || !node->eb); in do_relocation()
2332 if (upper->eb && !upper->locked) { in do_relocation()
2334 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2338 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2339 if (node->eb->start == bytenr) in do_relocation()
2345 if (!upper->eb) { in do_relocation()
2355 if (!upper->eb) { in do_relocation()
2356 upper->eb = path->nodes[upper->level]; in do_relocation()
2359 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2368 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2374 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2380 upper->eb->start); in do_relocation()
2385 if (node->eb->start == bytenr) in do_relocation()
2390 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2391 if (IS_ERR(eb)) { in do_relocation()
2392 ret = PTR_ERR(eb); in do_relocation()
2395 btrfs_tree_lock(eb); in do_relocation()
2397 if (!node->eb) { in do_relocation()
2398 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2399 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2400 btrfs_tree_unlock(eb); in do_relocation()
2401 free_extent_buffer(eb); in do_relocation()
2408 ASSERT(node->eb == eb); in do_relocation()
2412 .bytenr = node->eb->start, in do_relocation()
2414 .parent = upper->eb->start, in do_relocation()
2415 .owning_root = btrfs_header_owner(upper->eb), in do_relocation()
2416 .ref_root = btrfs_header_owner(upper->eb), in do_relocation()
2419 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2420 node->eb->start); in do_relocation()
2421 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2423 btrfs_mark_buffer_dirty(trans, upper->eb); in do_relocation()
2429 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2430 upper->eb); in do_relocation()
2466 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2548 struct extent_buffer *eb; in get_tree_block_key() local
2550 eb = read_tree_block(fs_info, block->bytenr, &check); in get_tree_block_key()
2551 if (IS_ERR(eb)) in get_tree_block_key()
2552 return PTR_ERR(eb); in get_tree_block_key()
2553 if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2554 free_extent_buffer(eb); in get_tree_block_key()
2558 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2560 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2561 free_extent_buffer(eb); in get_tree_block_key()
3148 struct extent_buffer *eb; in add_tree_block() local
3158 eb = path->nodes[0]; in add_tree_block()
3159 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3165 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3170 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3176 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3193 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3194 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3201 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3206 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3209 btrfs_print_leaf(eb); in add_tree_block()
3212 eb->start, path->slots[0]); in add_tree_block()
3419 struct extent_buffer *eb; in add_data_references() local
3421 eb = read_tree_block(ctx.fs_info, ref_node->val, &check); in add_data_references()
3422 if (IS_ERR(eb)) { in add_data_references()
3423 ret = PTR_ERR(eb); in add_data_references()
3426 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3428 free_extent_buffer(eb); in add_data_references()
4407 node->eb = cow; in btrfs_reloc_cow_block()