Lines Matching refs:eb
735 struct extent_buffer *eb; in create_reloc_root() local
751 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
772 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root()
778 btrfs_set_root_bytenr(root_item, eb->start); in create_reloc_root()
779 btrfs_set_root_level(root_item, btrfs_header_level(eb)); in create_reloc_root()
789 btrfs_tree_unlock(eb); in create_reloc_root()
790 free_extent_buffer(eb); in create_reloc_root()
1149 int memcmp_node_keys(struct extent_buffer *eb, int slot, in memcmp_node_keys() argument
1154 btrfs_node_key(eb, &key1, slot); in memcmp_node_keys()
1175 struct extent_buffer *eb; in replace_path() local
1198 eb = btrfs_lock_root_node(dest); in replace_path()
1199 btrfs_set_lock_blocking_write(eb); in replace_path()
1200 level = btrfs_header_level(eb); in replace_path()
1203 btrfs_tree_unlock(eb); in replace_path()
1204 free_extent_buffer(eb); in replace_path()
1209 ret = btrfs_cow_block(trans, dest, eb, NULL, 0, &eb, in replace_path()
1213 btrfs_set_lock_blocking_write(eb); in replace_path()
1221 parent = eb; in replace_path()
1243 eb = path->nodes[level]; in replace_path()
1244 new_bytenr = btrfs_node_blockptr(eb, in replace_path()
1246 new_ptr_gen = btrfs_node_ptr_generation(eb, in replace_path()
1265 eb = read_tree_block(fs_info, old_bytenr, old_ptr_gen, in replace_path()
1267 if (IS_ERR(eb)) { in replace_path()
1268 ret = PTR_ERR(eb); in replace_path()
1270 } else if (!extent_buffer_uptodate(eb)) { in replace_path()
1272 free_extent_buffer(eb); in replace_path()
1275 btrfs_tree_lock(eb); in replace_path()
1277 ret = btrfs_cow_block(trans, dest, eb, parent, in replace_path()
1278 slot, &eb, in replace_path()
1282 btrfs_set_lock_blocking_write(eb); in replace_path()
1287 parent = eb; in replace_path()
1384 struct extent_buffer *eb; in walk_up_reloc_tree() local
1397 eb = path->nodes[i]; in walk_up_reloc_tree()
1398 nritems = btrfs_header_nritems(eb); in walk_up_reloc_tree()
1401 if (btrfs_node_ptr_generation(eb, path->slots[i]) <= in walk_up_reloc_tree()
1422 struct extent_buffer *eb = NULL; in walk_down_reloc_tree() local
1434 eb = path->nodes[i]; in walk_down_reloc_tree()
1435 nritems = btrfs_header_nritems(eb); in walk_down_reloc_tree()
1437 ptr_gen = btrfs_node_ptr_generation(eb, path->slots[i]); in walk_down_reloc_tree()
1453 bytenr = btrfs_node_blockptr(eb, path->slots[i]); in walk_down_reloc_tree()
1454 btrfs_node_key_to_cpu(eb, &first_key, path->slots[i]); in walk_down_reloc_tree()
1455 eb = read_tree_block(fs_info, bytenr, ptr_gen, i - 1, in walk_down_reloc_tree()
1457 if (IS_ERR(eb)) { in walk_down_reloc_tree()
1458 return PTR_ERR(eb); in walk_down_reloc_tree()
1459 } else if (!extent_buffer_uptodate(eb)) { in walk_down_reloc_tree()
1460 free_extent_buffer(eb); in walk_down_reloc_tree()
1463 BUG_ON(btrfs_header_level(eb) != i - 1); in walk_down_reloc_tree()
1464 path->nodes[i - 1] = eb; in walk_down_reloc_tree()
2213 struct extent_buffer *eb; in do_relocation() local
2221 BUG_ON(lowest && node->eb); in do_relocation()
2235 if (upper->eb && !upper->locked) { in do_relocation()
2237 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2243 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2244 if (node->eb->start == bytenr) in do_relocation()
2250 if (!upper->eb) { in do_relocation()
2262 if (!upper->eb) { in do_relocation()
2263 upper->eb = path->nodes[upper->level]; in do_relocation()
2266 BUG_ON(upper->eb != path->nodes[upper->level]); in do_relocation()
2275 ret = btrfs_bin_search(upper->eb, key, &slot); in do_relocation()
2283 bytenr = btrfs_node_blockptr(upper->eb, slot); in do_relocation()
2289 upper->eb->start); in do_relocation()
2294 if (node->eb->start == bytenr) in do_relocation()
2299 generation = btrfs_node_ptr_generation(upper->eb, slot); in do_relocation()
2300 btrfs_node_key_to_cpu(upper->eb, &first_key, slot); in do_relocation()
2301 eb = read_tree_block(fs_info, bytenr, generation, in do_relocation()
2303 if (IS_ERR(eb)) { in do_relocation()
2304 err = PTR_ERR(eb); in do_relocation()
2306 } else if (!extent_buffer_uptodate(eb)) { in do_relocation()
2307 free_extent_buffer(eb); in do_relocation()
2311 btrfs_tree_lock(eb); in do_relocation()
2312 btrfs_set_lock_blocking_write(eb); in do_relocation()
2314 if (!node->eb) { in do_relocation()
2315 ret = btrfs_cow_block(trans, root, eb, upper->eb, in do_relocation()
2316 slot, &eb, BTRFS_NESTING_COW); in do_relocation()
2317 btrfs_tree_unlock(eb); in do_relocation()
2318 free_extent_buffer(eb); in do_relocation()
2323 BUG_ON(node->eb != eb); in do_relocation()
2325 btrfs_set_node_blockptr(upper->eb, slot, in do_relocation()
2326 node->eb->start); in do_relocation()
2327 btrfs_set_node_ptr_generation(upper->eb, slot, in do_relocation()
2329 btrfs_mark_buffer_dirty(upper->eb); in do_relocation()
2332 node->eb->start, blocksize, in do_relocation()
2333 upper->eb->start); in do_relocation()
2336 btrfs_header_owner(upper->eb)); in do_relocation()
2340 ret = btrfs_drop_subtree(trans, root, eb, upper->eb); in do_relocation()
2370 btrfs_node_key_to_cpu(node->eb, &key, 0); in link_to_upper()
2447 struct extent_buffer *eb; in get_tree_block_key() local
2449 eb = read_tree_block(fs_info, block->bytenr, block->key.offset, in get_tree_block_key()
2451 if (IS_ERR(eb)) { in get_tree_block_key()
2452 return PTR_ERR(eb); in get_tree_block_key()
2453 } else if (!extent_buffer_uptodate(eb)) { in get_tree_block_key()
2454 free_extent_buffer(eb); in get_tree_block_key()
2458 btrfs_item_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2460 btrfs_node_key_to_cpu(eb, &block->key, 0); in get_tree_block_key()
2461 free_extent_buffer(eb); in get_tree_block_key()
2848 struct extent_buffer *eb; in add_tree_block() local
2857 eb = path->nodes[0]; in add_tree_block()
2858 item_size = btrfs_item_size_nr(eb, path->slots[0]); in add_tree_block()
2862 ei = btrfs_item_ptr(eb, path->slots[0], in add_tree_block()
2866 level = btrfs_tree_block_level(eb, bi); in add_tree_block()
2870 generation = btrfs_extent_generation(eb, ei); in add_tree_block()
2872 btrfs_print_v0_err(eb->fs_info); in add_tree_block()
2873 btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL); in add_tree_block()
3072 struct extent_buffer *eb; in add_data_references() local
3074 eb = read_tree_block(fs_info, ref_node->val, 0, 0, NULL); in add_data_references()
3075 if (IS_ERR(eb)) { in add_data_references()
3076 ret = PTR_ERR(eb); in add_data_references()
3079 ret = delete_v1_space_cache(eb, rc->block_group, in add_data_references()
3081 free_extent_buffer(eb); in add_data_references()
3959 node->eb = cow; in btrfs_reloc_cow_block()