Lines Matching refs:path
220 struct btrfs_path *path; in cache_block_group() local
235 path = btrfs_alloc_path(); in cache_block_group()
236 if (!path) in cache_block_group()
239 path->reada = 2; in cache_block_group()
245 path->skip_locking = 1; in cache_block_group()
250 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in cache_block_group()
255 leaf = path->nodes[0]; in cache_block_group()
256 slot = path->slots[0]; in cache_block_group()
258 ret = btrfs_next_leaf(root, path); in cache_block_group()
281 path->slots[0]++; in cache_block_group()
292 btrfs_free_path(path); in cache_block_group()
424 struct btrfs_path *path; in btrfs_lookup_extent() local
426 path = btrfs_alloc_path(); in btrfs_lookup_extent()
427 BUG_ON(!path); in btrfs_lookup_extent()
431 ret = btrfs_search_slot(NULL, root->fs_info->extent_root, &key, path, in btrfs_lookup_extent()
433 btrfs_free_path(path); in btrfs_lookup_extent()
518 struct btrfs_path *path, in lookup_extent_backref() argument
533 ret = btrfs_search_slot(trans, root, &key, path, del ? -1 : 0, 1); in lookup_extent_backref()
541 leaf = path->nodes[0]; in lookup_extent_backref()
542 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_ref); in lookup_extent_backref()
563 struct btrfs_path *path, in update_backrefs() argument
583 ret = btrfs_search_slot(trans, extent_root, &key, path, 0, 1); in update_backrefs()
586 leaf = path->nodes[0]; in update_backrefs()
589 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_ref); in update_backrefs()
609 ret = btrfs_set_item_key_safe(trans, extent_root, path, &key); in update_backrefs()
611 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_ref); in update_backrefs()
622 btrfs_mark_buffer_dirty(path->nodes[0]); in update_backrefs()
623 btrfs_release_path(extent_root, path); in update_backrefs()
629 path->slots[0]++; in update_backrefs()
630 while (path->slots[0] < btrfs_header_nritems(leaf)) { in update_backrefs()
631 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in update_backrefs()
635 path->slots[0]++; in update_backrefs()
638 btrfs_mark_buffer_dirty(path->nodes[0]); in update_backrefs()
639 btrfs_release_path(extent_root, path); in update_backrefs()
648 struct btrfs_path *path, in insert_extents() argument
692 ret = btrfs_insert_some_items(trans, extent_root, path, in insert_extents()
699 leaf = path->nodes[0]; in insert_extents()
712 itm = btrfs_item_ptr(leaf, path->slots[0] + c, in insert_extents()
714 btrfs_set_extent_refs(path->nodes[0], itm, 1); in insert_extents()
719 ref = btrfs_item_ptr(leaf, path->slots[0] + c, in insert_extents()
750 btrfs_release_path(extent_root, path); in insert_extents()
809 struct btrfs_path *path, in insert_extent_backref() argument
824 ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*ref)); in insert_extent_backref()
826 leaf = path->nodes[0]; in insert_extent_backref()
827 ref = btrfs_item_ptr(leaf, path->slots[0], in insert_extent_backref()
836 leaf = path->nodes[0]; in insert_extent_backref()
837 ref = btrfs_item_ptr(leaf, path->slots[0], in insert_extent_backref()
860 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_extent_backref()
862 btrfs_release_path(root, path); in insert_extent_backref()
868 struct btrfs_path *path) in remove_extent_backref() argument
875 leaf = path->nodes[0]; in remove_extent_backref()
876 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_ref); in remove_extent_backref()
881 ret = btrfs_del_item(trans, root, path); in remove_extent_backref()
886 btrfs_release_path(root, path); in remove_extent_backref()
935 struct btrfs_path *path; in free_extents() local
945 path = btrfs_alloc_path(); in free_extents()
946 if (!path) in free_extents()
948 path->reada = 1; in free_extents()
954 ret = lookup_extent_backref(trans, extent_root, path, op->bytenr, in free_extents()
964 btrfs_print_leaf(extent_root, path->nodes[0]); in free_extents()
969 extent_slot = path->slots[0]; in free_extents()
979 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in free_extents()
998 ret = remove_extent_backref(trans, extent_root, path); in free_extents()
1000 btrfs_release_path(extent_root, path); in free_extents()
1001 ret = btrfs_search_slot(trans, extent_root, &key, path, -1, 1); in free_extents()
1003 extent_slot = path->slots[0]; in free_extents()
1007 leaf = path->nodes[0]; in free_extents()
1031 path->slots[0] = extent_slot; in free_extents()
1113 ret = btrfs_del_items(trans, extent_root, path, in free_extents()
1114 path->slots[0], num_to_del); in free_extents()
1147 ret = remove_extent_backref(trans, extent_root, path); in free_extents()
1166 btrfs_release_path(extent_root, path); in free_extents()
1171 btrfs_free_path(path); in free_extents()
1184 struct btrfs_path *path; in __btrfs_update_extent_ref() local
1231 path = btrfs_alloc_path(); in __btrfs_update_extent_ref()
1232 if (!path) in __btrfs_update_extent_ref()
1234 ret = lookup_extent_backref(trans, extent_root, path, in __btrfs_update_extent_ref()
1239 ret = remove_extent_backref(trans, extent_root, path); in __btrfs_update_extent_ref()
1242 ret = insert_extent_backref(trans, extent_root, path, bytenr, in __btrfs_update_extent_ref()
1249 btrfs_free_path(path); in __btrfs_update_extent_ref()
1277 struct btrfs_path *path; in __btrfs_inc_extent_ref() local
1284 path = btrfs_alloc_path(); in __btrfs_inc_extent_ref()
1285 if (!path) in __btrfs_inc_extent_ref()
1288 path->reada = 1; in __btrfs_inc_extent_ref()
1293 ret = btrfs_search_slot(trans, root->fs_info->extent_root, &key, path, in __btrfs_inc_extent_ref()
1297 BUG_ON(ret == 0 || path->slots[0] == 0); in __btrfs_inc_extent_ref()
1299 path->slots[0]--; in __btrfs_inc_extent_ref()
1300 l = path->nodes[0]; in __btrfs_inc_extent_ref()
1302 btrfs_item_key_to_cpu(l, &key, path->slots[0]); in __btrfs_inc_extent_ref()
1304 btrfs_print_leaf(root->fs_info->extent_root, path->nodes[0]); in __btrfs_inc_extent_ref()
1312 item = btrfs_item_ptr(l, path->slots[0], struct btrfs_extent_item); in __btrfs_inc_extent_ref()
1315 btrfs_mark_buffer_dirty(path->nodes[0]); in __btrfs_inc_extent_ref()
1317 btrfs_release_path(root->fs_info->extent_root, path); in __btrfs_inc_extent_ref()
1319 path->reada = 1; in __btrfs_inc_extent_ref()
1321 path, bytenr, parent, in __btrfs_inc_extent_ref()
1328 btrfs_free_path(path); in __btrfs_inc_extent_ref()
1377 struct btrfs_path *path; in btrfs_lookup_extent_ref() local
1384 path = btrfs_alloc_path(); in btrfs_lookup_extent_ref()
1385 path->reada = 1; in btrfs_lookup_extent_ref()
1389 ret = btrfs_search_slot(trans, root->fs_info->extent_root, &key, path, in btrfs_lookup_extent_ref()
1394 btrfs_print_leaf(root, path->nodes[0]); in btrfs_lookup_extent_ref()
1399 l = path->nodes[0]; in btrfs_lookup_extent_ref()
1400 item = btrfs_item_ptr(l, path->slots[0], struct btrfs_extent_item); in btrfs_lookup_extent_ref()
1403 btrfs_free_path(path); in btrfs_lookup_extent_ref()
1411 struct btrfs_path *path; in btrfs_cross_ref_exist() local
1425 path = btrfs_alloc_path(); in btrfs_cross_ref_exist()
1426 ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0); in btrfs_cross_ref_exist()
1432 if (path->slots[0] == 0) in btrfs_cross_ref_exist()
1435 path->slots[0]--; in btrfs_cross_ref_exist()
1436 leaf = path->nodes[0]; in btrfs_cross_ref_exist()
1437 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_cross_ref_exist()
1445 leaf = path->nodes[0]; in btrfs_cross_ref_exist()
1447 if (path->slots[0] >= nritems) { in btrfs_cross_ref_exist()
1448 ret = btrfs_next_leaf(extent_root, path); in btrfs_cross_ref_exist()
1455 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_cross_ref_exist()
1460 path->slots[0]++; in btrfs_cross_ref_exist()
1464 ref_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_cross_ref_exist()
1478 path->slots[0]++; in btrfs_cross_ref_exist()
1482 btrfs_free_path(path); in btrfs_cross_ref_exist()
1814 struct btrfs_path *path, in write_one_cache_group() argument
1823 ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1); in write_one_cache_group()
1828 leaf = path->nodes[0]; in write_one_cache_group()
1829 bi = btrfs_item_ptr_offset(leaf, path->slots[0]); in write_one_cache_group()
1832 btrfs_release_path(extent_root, path); in write_one_cache_group()
1851 struct btrfs_path *path; in btrfs_write_dirty_block_groups() local
1854 path = btrfs_alloc_path(); in btrfs_write_dirty_block_groups()
1855 if (!path) in btrfs_write_dirty_block_groups()
1879 path, cache); in btrfs_write_dirty_block_groups()
1890 btrfs_free_path(path); in btrfs_write_dirty_block_groups()
2485 struct btrfs_path *path; in finish_current_insert() local
2491 path = btrfs_alloc_path(); in finish_current_insert()
2571 ret = update_backrefs(trans, extent_root, path, &update_list); in finish_current_insert()
2638 ret = insert_extents(trans, extent_root, path, &insert_list, in finish_current_insert()
2660 btrfs_free_path(path); in finish_current_insert()
2715 struct btrfs_path *path; in __free_extent() local
2730 path = btrfs_alloc_path(); in __free_extent()
2731 if (!path) in __free_extent()
2734 path->reada = 1; in __free_extent()
2735 ret = lookup_extent_backref(trans, extent_root, path, in __free_extent()
2740 extent_slot = path->slots[0]; in __free_extent()
2743 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in __free_extent()
2752 if (path->slots[0] - extent_slot > 5) in __free_extent()
2756 ret = remove_extent_backref(trans, extent_root, path); in __free_extent()
2758 btrfs_release_path(extent_root, path); in __free_extent()
2760 &key, path, -1, 1); in __free_extent()
2765 btrfs_print_leaf(extent_root, path->nodes[0]); in __free_extent()
2768 extent_slot = path->slots[0]; in __free_extent()
2771 btrfs_print_leaf(extent_root, path->nodes[0]); in __free_extent()
2781 leaf = path->nodes[0]; in __free_extent()
2791 if (refs == 0 && found_extent && path->slots[0] == extent_slot + 1) { in __free_extent()
2793 ref = btrfs_item_ptr(leaf, path->slots[0], in __free_extent()
2799 path->slots[0] = extent_slot; in __free_extent()
2803 ret = remove_extent_backref(trans, extent_root, path); in __free_extent()
2807 btrfs_release_path(extent_root, path); in __free_extent()
2808 ret = btrfs_search_slot(trans, extent_root, &key, path, in __free_extent()
2838 ret = btrfs_del_items(trans, extent_root, path, path->slots[0], in __free_extent()
2841 btrfs_release_path(extent_root, path); in __free_extent()
2852 btrfs_free_path(path); in __free_extent()
3490 struct btrfs_path *path; in __btrfs_alloc_reserved_extent() local
3540 path = btrfs_alloc_path(); in __btrfs_alloc_reserved_extent()
3541 BUG_ON(!path); in __btrfs_alloc_reserved_extent()
3543 ret = btrfs_insert_empty_items(trans, extent_root, path, keys, in __btrfs_alloc_reserved_extent()
3547 extent_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in __btrfs_alloc_reserved_extent()
3549 btrfs_set_extent_refs(path->nodes[0], extent_item, 1); in __btrfs_alloc_reserved_extent()
3550 ref = btrfs_item_ptr(path->nodes[0], path->slots[0] + 1, in __btrfs_alloc_reserved_extent()
3553 btrfs_set_ref_root(path->nodes[0], ref, root_objectid); in __btrfs_alloc_reserved_extent()
3554 btrfs_set_ref_generation(path->nodes[0], ref, ref_generation); in __btrfs_alloc_reserved_extent()
3555 btrfs_set_ref_objectid(path->nodes[0], ref, owner); in __btrfs_alloc_reserved_extent()
3556 btrfs_set_ref_num_refs(path->nodes[0], ref, 1); in __btrfs_alloc_reserved_extent()
3558 btrfs_mark_buffer_dirty(path->nodes[0]); in __btrfs_alloc_reserved_extent()
3562 btrfs_free_path(path); in __btrfs_alloc_reserved_extent()
3905 struct btrfs_path *path) in drop_level_one_refs() argument
3910 struct extent_buffer *eb = path->nodes[1]; in drop_level_one_refs()
3918 int slot = path->slots[1]; in drop_level_one_refs()
4031 path->slots[1] = nritems; in drop_level_one_refs()
4041 struct btrfs_path *path, int *level) in walk_down_tree() argument
4056 ret = drop_snap_lookup_refcount(root, path->nodes[*level]->start, in walk_down_tree()
4057 path->nodes[*level]->len, &refs); in walk_down_tree()
4068 cur = path->nodes[*level]; in walk_down_tree()
4073 if (path->slots[*level] >= in walk_down_tree()
4098 ret = drop_level_one_refs(trans, root, path); in walk_down_tree()
4103 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_tree()
4104 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_tree()
4117 parent = path->nodes[*level]; in walk_down_tree()
4120 path->slots[*level]++; in walk_down_tree()
4141 if (path->nodes[*level-1]) in walk_down_tree()
4142 free_extent_buffer(path->nodes[*level-1]); in walk_down_tree()
4143 path->nodes[*level-1] = next; in walk_down_tree()
4145 path->slots[*level] = 0; in walk_down_tree()
4152 if (path->nodes[*level] == root->node) { in walk_down_tree()
4153 parent = path->nodes[*level]; in walk_down_tree()
4154 bytenr = path->nodes[*level]->start; in walk_down_tree()
4156 parent = path->nodes[*level + 1]; in walk_down_tree()
4157 bytenr = btrfs_node_blockptr(parent, path->slots[*level + 1]); in walk_down_tree()
4171 free_extent_buffer(path->nodes[*level]); in walk_down_tree()
4172 path->nodes[*level] = NULL; in walk_down_tree()
4188 struct btrfs_path *path, int *level) in walk_down_subtree() argument
4199 cur = path->nodes[*level]; in walk_down_subtree()
4207 cur = path->nodes[*level]; in walk_down_subtree()
4214 if (path->slots[*level] >= btrfs_header_nritems(cur)) { in walk_down_subtree()
4219 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_subtree()
4221 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_subtree()
4231 parent = path->nodes[*level]; in walk_down_subtree()
4238 path->slots[*level]++; in walk_down_subtree()
4245 path->nodes[*level] = next; in walk_down_subtree()
4246 path->slots[*level] = 0; in walk_down_subtree()
4247 path->locks[*level] = 1; in walk_down_subtree()
4251 parent = path->nodes[*level + 1]; in walk_down_subtree()
4252 bytenr = path->nodes[*level]->start; in walk_down_subtree()
4253 blocksize = path->nodes[*level]->len; in walk_down_subtree()
4260 if (path->locks[*level]) { in walk_down_subtree()
4261 btrfs_tree_unlock(path->nodes[*level]); in walk_down_subtree()
4262 path->locks[*level] = 0; in walk_down_subtree()
4264 free_extent_buffer(path->nodes[*level]); in walk_down_subtree()
4265 path->nodes[*level] = NULL; in walk_down_subtree()
4278 struct btrfs_path *path, in walk_up_tree() argument
4288 for (i = *level; i < max_level && path->nodes[i]; i++) { in walk_up_tree()
4289 slot = path->slots[i]; in walk_up_tree()
4290 if (slot < btrfs_header_nritems(path->nodes[i]) - 1) { in walk_up_tree()
4300 node = path->nodes[i]; in walk_up_tree()
4301 path->slots[i]++; in walk_up_tree()
4304 btrfs_node_key(node, &disk_key, path->slots[i]); in walk_up_tree()
4316 if (path->nodes[*level] == root->node) in walk_up_tree()
4317 parent = path->nodes[*level]; in walk_up_tree()
4319 parent = path->nodes[*level + 1]; in walk_up_tree()
4324 clean_tree_block(trans, root, path->nodes[*level]); in walk_up_tree()
4326 path->nodes[*level]->start, in walk_up_tree()
4327 path->nodes[*level]->len, in walk_up_tree()
4331 if (path->locks[*level]) { in walk_up_tree()
4332 btrfs_tree_unlock(path->nodes[*level]); in walk_up_tree()
4333 path->locks[*level] = 0; in walk_up_tree()
4335 free_extent_buffer(path->nodes[*level]); in walk_up_tree()
4336 path->nodes[*level] = NULL; in walk_up_tree()
4354 struct btrfs_path *path; in btrfs_drop_snapshot() local
4360 path = btrfs_alloc_path(); in btrfs_drop_snapshot()
4361 BUG_ON(!path); in btrfs_drop_snapshot()
4366 path->nodes[level] = root->node; in btrfs_drop_snapshot()
4368 path->slots[level] = 0; in btrfs_drop_snapshot()
4376 path->lowest_level = level; in btrfs_drop_snapshot()
4377 wret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_drop_snapshot()
4382 node = path->nodes[level]; in btrfs_drop_snapshot()
4383 btrfs_node_key(node, &found_key, path->slots[level]); in btrfs_drop_snapshot()
4391 if (path->nodes[i] && path->locks[i]) { in btrfs_drop_snapshot()
4392 path->locks[i] = 0; in btrfs_drop_snapshot()
4393 btrfs_tree_unlock(path->nodes[i]); in btrfs_drop_snapshot()
4398 wret = walk_down_tree(trans, root, path, &level); in btrfs_drop_snapshot()
4404 wret = walk_up_tree(trans, root, path, &level, in btrfs_drop_snapshot()
4418 if (path->nodes[i]) { in btrfs_drop_snapshot()
4419 free_extent_buffer(path->nodes[i]); in btrfs_drop_snapshot()
4420 path->nodes[i] = NULL; in btrfs_drop_snapshot()
4424 btrfs_free_path(path); in btrfs_drop_snapshot()
4433 struct btrfs_path *path; in btrfs_drop_subtree() local
4439 path = btrfs_alloc_path(); in btrfs_drop_subtree()
4440 BUG_ON(!path); in btrfs_drop_subtree()
4445 path->nodes[parent_level] = parent; in btrfs_drop_subtree()
4446 path->slots[parent_level] = btrfs_header_nritems(parent); in btrfs_drop_subtree()
4451 path->nodes[level] = node; in btrfs_drop_subtree()
4452 path->slots[level] = 0; in btrfs_drop_subtree()
4455 wret = walk_down_subtree(trans, root, path, &level); in btrfs_drop_subtree()
4461 wret = walk_up_tree(trans, root, path, &level, parent_level); in btrfs_drop_subtree()
4468 btrfs_free_path(path); in btrfs_drop_subtree()
4651 struct btrfs_path *path; in __next_ref_path() local
4660 path = btrfs_alloc_path(); in __next_ref_path()
4661 if (!path) in __next_ref_path()
4692 ret = btrfs_search_slot(trans, extent_root, &key, path, 0, 0); in __next_ref_path()
4697 leaf = path->nodes[0]; in __next_ref_path()
4699 if (path->slots[0] >= nritems) { in __next_ref_path()
4700 ret = btrfs_next_leaf(extent_root, path); in __next_ref_path()
4705 leaf = path->nodes[0]; in __next_ref_path()
4708 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in __next_ref_path()
4717 btrfs_release_path(extent_root, path); in __next_ref_path()
4739 ret = btrfs_search_slot(trans, extent_root, &key, path, 0, 0); in __next_ref_path()
4743 leaf = path->nodes[0]; in __next_ref_path()
4745 if (path->slots[0] >= nritems) { in __next_ref_path()
4746 ret = btrfs_next_leaf(extent_root, path); in __next_ref_path()
4753 btrfs_release_path(extent_root, path); in __next_ref_path()
4756 leaf = path->nodes[0]; in __next_ref_path()
4759 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in __next_ref_path()
4767 btrfs_release_path(extent_root, path); in __next_ref_path()
4771 ref = btrfs_item_ptr(leaf, path->slots[0], in __next_ref_path()
4829 btrfs_release_path(extent_root, path); in __next_ref_path()
4835 btrfs_free_path(path); in __next_ref_path()
4864 struct btrfs_path *path; in get_new_locations() local
4884 path = btrfs_alloc_path(); in get_new_locations()
4885 BUG_ON(!path); in get_new_locations()
4889 ret = btrfs_lookup_file_extent(NULL, root, path, reloc_inode->i_ino, in get_new_locations()
4899 leaf = path->nodes[0]; in get_new_locations()
4901 if (path->slots[0] >= nritems) { in get_new_locations()
4902 ret = btrfs_next_leaf(root, path); in get_new_locations()
4907 leaf = path->nodes[0]; in get_new_locations()
4910 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in get_new_locations()
4916 fi = btrfs_item_ptr(leaf, path->slots[0], in get_new_locations()
4957 path->slots[0]++; in get_new_locations()
4967 btrfs_free_path(path); in get_new_locations()
4980 struct btrfs_path *path, in replace_one_extent() argument
5014 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in replace_one_extent()
5018 leaf = path->nodes[0]; in replace_one_extent()
5031 if (path->slots[0] >= nritems) { in replace_one_extent()
5036 ret = btrfs_next_leaf(root, path); in replace_one_extent()
5041 leaf = path->nodes[0]; in replace_one_extent()
5045 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in replace_one_extent()
5057 btrfs_release_path(root, path); in replace_one_extent()
5065 path->slots[0]++; in replace_one_extent()
5069 fi = btrfs_item_ptr(leaf, path->slots[0], in replace_one_extent()
5076 path->slots[0]++; in replace_one_extent()
5102 btrfs_release_path(root, path); in replace_one_extent()
5133 btrfs_release_path(root, path); in replace_one_extent()
5185 btrfs_release_path(root, path); in replace_one_extent()
5197 btrfs_release_path(root, path); in replace_one_extent()
5212 path, &key, in replace_one_extent()
5216 leaf = path->nodes[0]; in replace_one_extent()
5217 fi = btrfs_item_ptr(leaf, path->slots[0], in replace_one_extent()
5254 btrfs_release_path(root, path); in replace_one_extent()
5283 btrfs_release_path(root, path); in replace_one_extent()
5664 struct btrfs_path *path, in relocate_one_path() argument
5683 path->lowest_level = lowest_level; in relocate_one_path()
5684 ret = btrfs_search_slot(trans, root, first_key, path, 0, 1); in relocate_one_path()
5686 path->lowest_level = 0; in relocate_one_path()
5687 btrfs_release_path(root, path); in relocate_one_path()
5707 path->lowest_level = lowest_level; in relocate_one_path()
5708 ret = btrfs_search_slot(trans, reloc_root, first_key, path, in relocate_one_path()
5712 eb = path->nodes[level]; in relocate_one_path()
5723 eb = path->nodes[0]; in relocate_one_path()
5728 btrfs_release_path(reloc_root, path); in relocate_one_path()
5743 ret = btrfs_search_slot(trans, reloc_root, first_key, path, in relocate_one_path()
5746 extent_buffer_get(path->nodes[0]); in relocate_one_path()
5747 eb = path->nodes[0]; in relocate_one_path()
5748 btrfs_release_path(reloc_root, path); in relocate_one_path()
5755 path->lowest_level = 0; in relocate_one_path()
5761 struct btrfs_path *path, in relocate_tree_block() argument
5767 ret = relocate_one_path(trans, root, path, first_key, in relocate_tree_block()
5779 struct btrfs_path *path, in del_extent_zero() argument
5784 ret = btrfs_search_slot(trans, extent_root, extent_key, path, -1, 1); in del_extent_zero()
5787 ret = btrfs_del_item(trans, extent_root, path); in del_extent_zero()
5789 btrfs_release_path(extent_root, path); in del_extent_zero()
5809 struct btrfs_path *path, in relocate_one_extent() argument
5830 ret = del_extent_zero(trans, extent_root, path, extent_key); in relocate_one_extent()
5914 path, &first_key, ref_path, in relocate_one_extent()
5938 path, extent_key, in relocate_one_extent()
5942 ret = relocate_tree_block(trans, found_root, path, in relocate_one_extent()
6032 struct btrfs_path *path; in __insert_orphan_inode() local
6037 path = btrfs_alloc_path(); in __insert_orphan_inode()
6038 if (!path) in __insert_orphan_inode()
6041 ret = btrfs_insert_empty_inode(trans, root, path, objectid); in __insert_orphan_inode()
6045 leaf = path->nodes[0]; in __insert_orphan_inode()
6046 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_inode_item); in __insert_orphan_inode()
6053 btrfs_release_path(root, path); in __insert_orphan_inode()
6055 btrfs_free_path(path); in __insert_orphan_inode()
6160 struct btrfs_path *path; in btrfs_relocate_block_group() local
6183 path = btrfs_alloc_path(); in btrfs_relocate_block_group()
6184 BUG_ON(!path); in btrfs_relocate_block_group()
6212 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_relocate_block_group()
6216 leaf = path->nodes[0]; in btrfs_relocate_block_group()
6218 if (path->slots[0] >= nritems) { in btrfs_relocate_block_group()
6219 ret = btrfs_next_leaf(root, path); in btrfs_relocate_block_group()
6226 leaf = path->nodes[0]; in btrfs_relocate_block_group()
6230 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_relocate_block_group()
6237 btrfs_release_path(root, path); in btrfs_relocate_block_group()
6246 path->slots[0]++; in btrfs_relocate_block_group()
6252 btrfs_release_path(root, path); in btrfs_relocate_block_group()
6255 ret = relocate_one_extent(root, path, &key, block_group, in btrfs_relocate_block_group()
6266 btrfs_release_path(root, path); in btrfs_relocate_block_group()
6300 btrfs_free_path(path); in btrfs_relocate_block_group()
6305 struct btrfs_path *path, struct btrfs_key *key) in find_first_block_group() argument
6312 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in find_first_block_group()
6317 slot = path->slots[0]; in find_first_block_group()
6318 leaf = path->nodes[0]; in find_first_block_group()
6320 ret = btrfs_next_leaf(root, path); in find_first_block_group()
6334 path->slots[0]++; in find_first_block_group()
6388 struct btrfs_path *path; in btrfs_read_block_groups() local
6401 path = btrfs_alloc_path(); in btrfs_read_block_groups()
6402 if (!path) in btrfs_read_block_groups()
6406 ret = find_first_block_group(root, path, &key); in btrfs_read_block_groups()
6414 leaf = path->nodes[0]; in btrfs_read_block_groups()
6415 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_read_block_groups()
6428 btrfs_item_ptr_offset(leaf, path->slots[0]), in btrfs_read_block_groups()
6433 btrfs_release_path(root, path); in btrfs_read_block_groups()
6454 btrfs_free_path(path); in btrfs_read_block_groups()
6514 struct btrfs_path *path; in btrfs_remove_block_group() local
6527 path = btrfs_alloc_path(); in btrfs_remove_block_group()
6528 BUG_ON(!path); in btrfs_remove_block_group()
6548 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_remove_block_group()
6554 ret = btrfs_del_item(trans, root, path); in btrfs_remove_block_group()
6556 btrfs_free_path(path); in btrfs_remove_block_group()