Lines Matching refs:eb

737 	struct extent_buffer *eb;  in create_reloc_root()  local
755 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
778 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
791 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
792 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
802 btrfs_tree_unlock(eb); in create_reloc_root()
803 free_extent_buffer(eb); in create_reloc_root()
1178 int memcmp_node_keys(struct extent_buffer *eb, int slot, in memcmp_node_keys() argument
1183 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1204 struct extent_buffer *eb; in replace_path() local
1227 eb = btrfs_lock_root_node(dest); in replace_path()
1228 level = btrfs_header_level(eb); in replace_path()
1231 btrfs_tree_unlock(eb); in replace_path()
1232 free_extent_buffer(eb); in replace_path()
1237 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1240 btrfs_tree_unlock(eb); in replace_path()
1241 free_extent_buffer(eb); in replace_path()
1252 parent = eb; in replace_path()
1271 eb = path->nodes[level]; in replace_path()
1272 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1274 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1293 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1294 if (IS_ERR(eb)) { in replace_path()
1295 ret = PTR_ERR(eb); in replace_path()
1298 btrfs_tree_lock(eb); in replace_path()
1300 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1301 slot, &eb, in replace_path()
1304 btrfs_tree_unlock(eb); in replace_path()
1305 free_extent_buffer(eb); in replace_path()
1313 parent = eb; in replace_path()
1428 struct extent_buffer *eb; in walk_up_reloc_tree() local
1441 eb = path->nodes[i]; in walk_up_reloc_tree()
1442 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1445 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1465 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1474 eb = path->nodes[i]; in walk_down_reloc_tree()
1475 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1477 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1493 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1494 if (IS_ERR(eb)) in walk_down_reloc_tree()
1495 return PTR_ERR(eb); in walk_down_reloc_tree()
1496 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1497 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2368 struct extent_buffer *eb; in do_relocation() local
2378 ASSERT(!lowest || !node->eb); in do_relocation()
2394 if (upper->eb && !upper->locked) { in do_relocation()
2396 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2400 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2401 if (node->eb->start == bytenr) in do_relocation()
2407 if (!upper->eb) { in do_relocation()
2417 if (!upper->eb) { in do_relocation()
2418 upper->eb = path->nodes[upper->level]; in do_relocation()
2421 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2430 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2436 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2442 upper->eb->start); in do_relocation()
2447 if (node->eb->start == bytenr) in do_relocation()
2452 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2453 if (IS_ERR(eb)) { in do_relocation()
2454 ret = PTR_ERR(eb); in do_relocation()
2457 btrfs_tree_lock(eb); in do_relocation()
2459 if (!node->eb) { in do_relocation()
2460 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2461 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2462 btrfs_tree_unlock(eb); in do_relocation()
2463 free_extent_buffer(eb); in do_relocation()
2470 ASSERT(node->eb == eb); in do_relocation()
2472 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2473 node->eb->start); in do_relocation()
2474 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2476 btrfs_mark_buffer_dirty(upper->eb); in do_relocation()
2479 node->eb->start, blocksize, in do_relocation()
2480 upper->eb->start); in do_relocation()
2482 btrfs_header_owner(upper->eb), in do_relocation()
2486 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2487 upper->eb); in do_relocation()
2523 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2600 struct extent_buffer *eb; in get_tree_block_key() local
2602 eb = read_tree_block(fs_info, block->bytenr, block->owner, in get_tree_block_key()
2604 if (IS_ERR(eb)) in get_tree_block_key()
2605 return PTR_ERR(eb); in get_tree_block_key()
2606 if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2607 free_extent_buffer(eb); in get_tree_block_key()
2611 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2613 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2614 free_extent_buffer(eb); in get_tree_block_key()
3139 struct extent_buffer *eb; in add_tree_block() local
3149 eb = path->nodes[0]; in add_tree_block()
3150 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3156 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3161 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3167 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3184 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3185 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3192 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3197 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3200 btrfs_print_v0_err(eb->fs_info); in add_tree_block()
3201 btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL); in add_tree_block()
3406 struct extent_buffer *eb; in add_data_references() local
3408 eb = read_tree_block(fs_info, ref_node->val, 0, 0, 0, NULL); in add_data_references()
3409 if (IS_ERR(eb)) { in add_data_references()
3410 ret = PTR_ERR(eb); in add_data_references()
3413 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3415 free_extent_buffer(eb); in add_data_references()
4396 node->eb = cow; in btrfs_reloc_cow_block()