Lines Matching refs:path
65 struct btrfs_path *path, struct btrfs_root_item *root_item, in btrfs_find_root() argument
73 ret = btrfs_search_slot(NULL, root, search_key, path, 0, 0); in btrfs_find_root()
82 if (path->slots[0] == 0) in btrfs_find_root()
84 path->slots[0]--; in btrfs_find_root()
88 l = path->nodes[0]; in btrfs_find_root()
89 slot = path->slots[0]; in btrfs_find_root()
103 btrfs_release_path(path); in btrfs_find_root()
123 struct btrfs_path *path; in btrfs_update_root() local
130 path = btrfs_alloc_path(); in btrfs_update_root()
131 if (!path) in btrfs_update_root()
134 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
148 l = path->nodes[0]; in btrfs_update_root()
149 slot = path->slots[0]; in btrfs_update_root()
159 btrfs_release_path(path); in btrfs_update_root()
160 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
167 ret = btrfs_del_item(trans, root, path); in btrfs_update_root()
172 btrfs_release_path(path); in btrfs_update_root()
173 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root()
179 l = path->nodes[0]; in btrfs_update_root()
180 slot = path->slots[0]; in btrfs_update_root()
191 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_update_root()
193 btrfs_free_path(path); in btrfs_update_root()
211 struct btrfs_path *path; in btrfs_find_orphan_roots() local
217 path = btrfs_alloc_path(); in btrfs_find_orphan_roots()
218 if (!path) in btrfs_find_orphan_roots()
228 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); in btrfs_find_orphan_roots()
234 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
235 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_find_orphan_roots()
236 ret = btrfs_next_leaf(tree_root, path); in btrfs_find_orphan_roots()
241 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
244 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_find_orphan_roots()
245 btrfs_release_path(path); in btrfs_find_orphan_roots()
261 btrfs_release_path(path); in btrfs_find_orphan_roots()
304 btrfs_free_path(path); in btrfs_find_orphan_roots()
313 struct btrfs_path *path; in btrfs_del_root() local
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()
325 ret = btrfs_del_item(trans, root, path); in btrfs_del_root()
327 btrfs_free_path(path); in btrfs_del_root()
337 struct btrfs_path *path; in btrfs_del_root_ref() local
345 path = btrfs_alloc_path(); in btrfs_del_root_ref()
346 if (!path) in btrfs_del_root_ref()
353 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1); in btrfs_del_root_ref()
358 leaf = path->nodes[0]; in btrfs_del_root_ref()
359 ref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_del_root_ref()
370 ret = btrfs_del_item(trans, tree_root, path); in btrfs_del_root_ref()
379 btrfs_release_path(path); in btrfs_del_root_ref()
387 btrfs_free_path(path); in btrfs_del_root_ref()
413 struct btrfs_path *path; in btrfs_add_root_ref() local
418 path = btrfs_alloc_path(); in btrfs_add_root_ref()
419 if (!path) in btrfs_add_root_ref()
426 ret = btrfs_insert_empty_item(trans, tree_root, path, &key, in btrfs_add_root_ref()
430 btrfs_free_path(path); in btrfs_add_root_ref()
434 leaf = path->nodes[0]; in btrfs_add_root_ref()
435 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref); in btrfs_add_root_ref()
444 btrfs_release_path(path); in btrfs_add_root_ref()
451 btrfs_free_path(path); in btrfs_add_root_ref()