Lines Matching refs:eb
736 struct extent_buffer *eb; in create_reloc_root() local
754 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
777 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
790 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
791 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
801 btrfs_tree_unlock(eb); in create_reloc_root()
802 free_extent_buffer(eb); in create_reloc_root()
1177 int memcmp_node_keys(struct extent_buffer *eb, int slot, in memcmp_node_keys() argument
1182 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1203 struct extent_buffer *eb; in replace_path() local
1226 eb = btrfs_lock_root_node(dest); in replace_path()
1227 level = btrfs_header_level(eb); in replace_path()
1230 btrfs_tree_unlock(eb); in replace_path()
1231 free_extent_buffer(eb); in replace_path()
1236 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1239 btrfs_tree_unlock(eb); in replace_path()
1240 free_extent_buffer(eb); in replace_path()
1251 parent = eb; in replace_path()
1270 eb = path->nodes[level]; in replace_path()
1271 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1273 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1292 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1293 if (IS_ERR(eb)) { in replace_path()
1294 ret = PTR_ERR(eb); in replace_path()
1297 btrfs_tree_lock(eb); in replace_path()
1299 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1300 slot, &eb, in replace_path()
1303 btrfs_tree_unlock(eb); in replace_path()
1304 free_extent_buffer(eb); in replace_path()
1312 parent = eb; in replace_path()
1425 struct extent_buffer *eb; in walk_up_reloc_tree() local
1438 eb = path->nodes[i]; in walk_up_reloc_tree()
1439 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1442 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1462 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1471 eb = path->nodes[i]; in walk_down_reloc_tree()
1472 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1474 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1490 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1491 if (IS_ERR(eb)) in walk_down_reloc_tree()
1492 return PTR_ERR(eb); in walk_down_reloc_tree()
1493 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1494 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2364 struct extent_buffer *eb; in do_relocation() local
2374 ASSERT(!lowest || !node->eb); in do_relocation()
2390 if (upper->eb && !upper->locked) { in do_relocation()
2392 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2396 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2397 if (node->eb->start == bytenr) in do_relocation()
2403 if (!upper->eb) { in do_relocation()
2413 if (!upper->eb) { in do_relocation()
2414 upper->eb = path->nodes[upper->level]; in do_relocation()
2417 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2426 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2432 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2438 upper->eb->start); in do_relocation()
2443 if (node->eb->start == bytenr) in do_relocation()
2448 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2449 if (IS_ERR(eb)) { in do_relocation()
2450 ret = PTR_ERR(eb); in do_relocation()
2453 btrfs_tree_lock(eb); in do_relocation()
2455 if (!node->eb) { in do_relocation()
2456 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2457 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2458 btrfs_tree_unlock(eb); in do_relocation()
2459 free_extent_buffer(eb); in do_relocation()
2466 ASSERT(node->eb == eb); in do_relocation()
2468 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2469 node->eb->start); in do_relocation()
2470 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2472 btrfs_mark_buffer_dirty(upper->eb); in do_relocation()
2475 node->eb->start, blocksize, in do_relocation()
2476 upper->eb->start); in do_relocation()
2478 btrfs_header_owner(upper->eb), in do_relocation()
2482 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2483 upper->eb); in do_relocation()
2519 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2596 struct extent_buffer *eb; in get_tree_block_key() local
2598 eb = read_tree_block(fs_info, block->bytenr, block->owner, in get_tree_block_key()
2600 if (IS_ERR(eb)) { in get_tree_block_key()
2601 return PTR_ERR(eb); in get_tree_block_key()
2602 } else if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2603 free_extent_buffer(eb); in get_tree_block_key()
2607 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2609 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2610 free_extent_buffer(eb); in get_tree_block_key()
3141 struct extent_buffer *eb; in add_tree_block() local
3151 eb = path->nodes[0]; in add_tree_block()
3152 item_size = btrfs_item_size_nr(eb, path->slots[0]); in add_tree_block()
3158 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3163 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3169 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3186 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3187 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3194 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3199 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3202 btrfs_print_v0_err(eb->fs_info); in add_tree_block()
3203 btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL); in add_tree_block()
3408 struct extent_buffer *eb; in add_data_references() local
3410 eb = read_tree_block(fs_info, ref_node->val, 0, 0, 0, NULL); in add_data_references()
3411 if (IS_ERR(eb)) { in add_data_references()
3412 ret = PTR_ERR(eb); in add_data_references()
3415 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3417 free_extent_buffer(eb); in add_data_references()
4382 node->eb = cow; in btrfs_reloc_cow_block()