Lines Matching refs:eb

747 	struct extent_buffer *eb;  in create_reloc_root()  local
765 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
788 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
801 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
802 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
812 btrfs_tree_unlock(eb); in create_reloc_root()
813 free_extent_buffer(eb); in create_reloc_root()
1191 int memcmp_node_keys(struct extent_buffer *eb, int slot, in memcmp_node_keys() argument
1196 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1217 struct extent_buffer *eb; in replace_path() local
1240 eb = btrfs_lock_root_node(dest); in replace_path()
1241 level = btrfs_header_level(eb); in replace_path()
1244 btrfs_tree_unlock(eb); in replace_path()
1245 free_extent_buffer(eb); in replace_path()
1250 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1253 btrfs_tree_unlock(eb); in replace_path()
1254 free_extent_buffer(eb); in replace_path()
1265 parent = eb; in replace_path()
1284 eb = path->nodes[level]; in replace_path()
1285 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1287 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1306 eb = btrfs_read_node_slot(parent, slot); in replace_path()
1307 if (IS_ERR(eb)) { in replace_path()
1308 ret = PTR_ERR(eb); in replace_path()
1311 btrfs_tree_lock(eb); in replace_path()
1313 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1314 slot, &eb, in replace_path()
1317 btrfs_tree_unlock(eb); in replace_path()
1318 free_extent_buffer(eb); in replace_path()
1326 parent = eb; in replace_path()
1441 struct extent_buffer *eb; in walk_up_reloc_tree() local
1454 eb = path->nodes[i]; in walk_up_reloc_tree()
1455 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1458 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1478 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1487 eb = path->nodes[i]; in walk_down_reloc_tree()
1488 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1490 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1506 eb = btrfs_read_node_slot(eb, path->slots[i]); in walk_down_reloc_tree()
1507 if (IS_ERR(eb)) in walk_down_reloc_tree()
1508 return PTR_ERR(eb); in walk_down_reloc_tree()
1509 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1510 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2412 struct extent_buffer *eb; in do_relocation() local
2422 ASSERT(!lowest || !node->eb); in do_relocation()
2438 if (upper->eb && !upper->locked) { in do_relocation()
2440 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2444 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2445 if (node->eb->start == bytenr) in do_relocation()
2451 if (!upper->eb) { in do_relocation()
2461 if (!upper->eb) { in do_relocation()
2462 upper->eb = path->nodes[upper->level]; in do_relocation()
2465 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2474 ret = btrfs_bin_search(upper->eb, 0, key, &slot); in do_relocation()
2480 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2486 upper->eb->start); in do_relocation()
2491 if (node->eb->start == bytenr) in do_relocation()
2496 eb = btrfs_read_node_slot(upper->eb, slot); in do_relocation()
2497 if (IS_ERR(eb)) { in do_relocation()
2498 ret = PTR_ERR(eb); in do_relocation()
2501 btrfs_tree_lock(eb); in do_relocation()
2503 if (!node->eb) { in do_relocation()
2504 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2505 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2506 btrfs_tree_unlock(eb); in do_relocation()
2507 free_extent_buffer(eb); in do_relocation()
2514 ASSERT(node->eb == eb); in do_relocation()
2516 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2517 node->eb->start); in do_relocation()
2518 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2520 btrfs_mark_buffer_dirty(trans, upper->eb); in do_relocation()
2523 node->eb->start, blocksize, in do_relocation()
2524 upper->eb->start); in do_relocation()
2526 btrfs_header_owner(upper->eb), in do_relocation()
2530 ret = btrfs_drop_subtree(trans, root, eb, in do_relocation()
2531 upper->eb); in do_relocation()
2567 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2649 struct extent_buffer *eb; in get_tree_block_key() local
2651 eb = read_tree_block(fs_info, block->bytenr, &check); in get_tree_block_key()
2652 if (IS_ERR(eb)) in get_tree_block_key()
2653 return PTR_ERR(eb); in get_tree_block_key()
2654 if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2655 free_extent_buffer(eb); in get_tree_block_key()
2659 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2661 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2662 free_extent_buffer(eb); in get_tree_block_key()
3200 struct extent_buffer *eb; in add_tree_block() local
3210 eb = path->nodes[0]; in add_tree_block()
3211 item_size = btrfs_item_size(eb, path->slots[0]); in add_tree_block()
3217 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
3222 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
3228 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
3245 if (btrfs_extent_refs(eb, ei) == 1 && in add_tree_block()
3246 !(btrfs_extent_flags(eb, ei) & in add_tree_block()
3253 type = btrfs_get_extent_inline_ref_type(eb, iref, in add_tree_block()
3258 owner = btrfs_extent_inline_ref_offset(eb, iref); in add_tree_block()
3261 btrfs_print_leaf(eb); in add_tree_block()
3264 eb->start, path->slots[0]); in add_tree_block()
3472 struct extent_buffer *eb; in add_data_references() local
3474 eb = read_tree_block(ctx.fs_info, ref_node->val, &check); in add_data_references()
3475 if (IS_ERR(eb)) { in add_data_references()
3476 ret = PTR_ERR(eb); in add_data_references()
3479 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3481 free_extent_buffer(eb); in add_data_references()
4456 node->eb = cow; in btrfs_reloc_cow_block()