Lines Matching refs:path
68 struct btrfs_path *path, struct btrfs_root_item *root_item, in btrfs_find_root() argument
76 ret = btrfs_search_slot(NULL, root, search_key, path, 0, 0); in btrfs_find_root()
92 if (path->slots[0] == 0) in btrfs_find_root()
94 path->slots[0]--; in btrfs_find_root()
98 l = path->nodes[0]; in btrfs_find_root()
99 slot = path->slots[0]; in btrfs_find_root()
113 btrfs_release_path(path); in btrfs_find_root()
133 BTRFS_PATH_AUTO_FREE(path); in btrfs_update_root()
140 path = btrfs_alloc_path(); in btrfs_update_root()
141 if (!path) in btrfs_update_root()
144 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
157 l = path->nodes[0]; in btrfs_update_root()
158 slot = path->slots[0]; in btrfs_update_root()
168 btrfs_release_path(path); in btrfs_update_root()
169 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
176 ret = btrfs_del_item(trans, root, path); in btrfs_update_root()
181 btrfs_release_path(path); in btrfs_update_root()
182 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root()
188 l = path->nodes[0]; in btrfs_update_root()
189 slot = path->slots[0]; in btrfs_update_root()
217 BTRFS_PATH_AUTO_FREE(path); in btrfs_find_orphan_roots()
221 path = btrfs_alloc_path(); in btrfs_find_orphan_roots()
222 if (!path) in btrfs_find_orphan_roots()
233 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); in btrfs_find_orphan_roots()
237 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
238 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_find_orphan_roots()
239 ret = btrfs_next_leaf(tree_root, path); in btrfs_find_orphan_roots()
244 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
247 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_find_orphan_roots()
248 btrfs_release_path(path); in btrfs_find_orphan_roots()
313 BTRFS_PATH_AUTO_FREE(path); in btrfs_del_root()
316 path = btrfs_alloc_path(); in btrfs_del_root()
317 if (!path) in btrfs_del_root()
319 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
326 return btrfs_del_item(trans, root, path); in btrfs_del_root()
334 BTRFS_PATH_AUTO_FREE(path); in btrfs_del_root_ref()
341 path = btrfs_alloc_path(); in btrfs_del_root_ref()
342 if (!path) in btrfs_del_root_ref()
349 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1); in btrfs_del_root_ref()
353 leaf = path->nodes[0]; in btrfs_del_root_ref()
354 ref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_del_root_ref()
364 ret = btrfs_del_item(trans, tree_root, path); in btrfs_del_root_ref()
372 btrfs_release_path(path); in btrfs_del_root_ref()
404 BTRFS_PATH_AUTO_FREE(path); in btrfs_add_root_ref()
409 path = btrfs_alloc_path(); in btrfs_add_root_ref()
410 if (!path) in btrfs_add_root_ref()
417 ret = btrfs_insert_empty_item(trans, tree_root, path, &key, in btrfs_add_root_ref()
424 leaf = path->nodes[0]; in btrfs_add_root_ref()
425 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref); in btrfs_add_root_ref()
433 btrfs_release_path(path); in btrfs_add_root_ref()