Lines Matching refs:eb
746 struct extent_buffer *eb; in create_reloc_root() local
764 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
787 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
800 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
801 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
811 btrfs_tree_unlock(eb); in create_reloc_root()
812 free_extent_buffer(eb); in create_reloc_root()
1190 int memcmp_node_keys(struct extent_buffer *eb, int slot, in memcmp_node_keys() argument
1195 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1216 struct extent_buffer *eb; in replace_path() local
1239 eb = btrfs_lock_root_node(dest); in replace_path()
1240 level = btrfs_header_level(eb); in replace_path()
1243 btrfs_tree_unlock(eb); in replace_path()
1244 free_extent_buffer(eb); in replace_path()
1249 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1252 btrfs_tree_unlock(eb); in replace_path()
1253 free_extent_buffer(eb); in replace_path()
1264 parent = eb; in replace_path()
1283 eb = path->nodes[level]; in replace_path()
1284 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1286 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1305 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1306 if (IS_ERR(eb)) { in replace_path()
1307 ret = PTR_ERR(eb); in replace_path()
1310 btrfs_tree_lock(eb); in replace_path()
1312 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1313 slot, &eb, in replace_path()
1316 btrfs_tree_unlock(eb); in replace_path()
1317 free_extent_buffer(eb); in replace_path()
1325 parent = eb; in replace_path()
1440 struct extent_buffer *eb; in walk_up_reloc_tree() local
1453 eb = path->nodes[i]; in walk_up_reloc_tree()
1454 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1457 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1477 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1486 eb = path->nodes[i]; in walk_down_reloc_tree()
1487 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1489 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1505 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1506 if (IS_ERR(eb)) in walk_down_reloc_tree()
1507 return PTR_ERR(eb); in walk_down_reloc_tree()
1508 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1509 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2382 struct extent_buffer *eb; in do_relocation() local
2392 ASSERT(!lowest || !node->eb); in do_relocation()
2408 if (upper->eb && !upper->locked) { in do_relocation()
2410 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2414 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2415 if (node->eb->start == bytenr) in do_relocation()
2421 if (!upper->eb) { in do_relocation()
2431 if (!upper->eb) { in do_relocation()
2432 upper->eb = path->nodes[upper->level]; in do_relocation()
2435 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2444 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2450 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2456 upper->eb->start); in do_relocation()
2461 if (node->eb->start == bytenr) in do_relocation()
2466 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2467 if (IS_ERR(eb)) { in do_relocation()
2468 ret = PTR_ERR(eb); in do_relocation()
2471 btrfs_tree_lock(eb); in do_relocation()
2473 if (!node->eb) { in do_relocation()
2474 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2475 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2476 btrfs_tree_unlock(eb); in do_relocation()
2477 free_extent_buffer(eb); in do_relocation()
2484 ASSERT(node->eb == eb); in do_relocation()
2486 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2487 node->eb->start); in do_relocation()
2488 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2490 btrfs_mark_buffer_dirty(upper->eb); in do_relocation()
2493 node->eb->start, blocksize, in do_relocation()
2494 upper->eb->start); in do_relocation()
2496 btrfs_header_owner(upper->eb), in do_relocation()
2500 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2501 upper->eb); in do_relocation()
2537 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2619 struct extent_buffer *eb; in get_tree_block_key() local
2621 eb = read_tree_block(fs_info, block->bytenr, &check); in get_tree_block_key()
2622 if (IS_ERR(eb)) in get_tree_block_key()
2623 return PTR_ERR(eb); in get_tree_block_key()
2624 if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2625 free_extent_buffer(eb); in get_tree_block_key()
2629 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2631 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2632 free_extent_buffer(eb); in get_tree_block_key()
3164 struct extent_buffer *eb; in add_tree_block() local
3174 eb = path->nodes[0]; in add_tree_block()
3175 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3181 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3186 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3192 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3209 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3210 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3217 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3222 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3225 btrfs_print_v0_err(eb->fs_info); in add_tree_block()
3226 btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL); in add_tree_block()
3435 struct extent_buffer *eb; in add_data_references() local
3437 eb = read_tree_block(ctx.fs_info, ref_node->val, &check); in add_data_references()
3438 if (IS_ERR(eb)) { in add_data_references()
3439 ret = PTR_ERR(eb); in add_data_references()
3442 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3444 free_extent_buffer(eb); in add_data_references()
4424 node->eb = cow; in btrfs_reloc_cow_block()