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()
141 btrfs_print_leaf(path->nodes[0]); in btrfs_update_root()
147 l = path->nodes[0]; in btrfs_update_root()
148 slot = path->slots[0]; in btrfs_update_root()
158 btrfs_release_path(path); in btrfs_update_root()
159 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
166 ret = btrfs_del_item(trans, root, path); in btrfs_update_root()
171 btrfs_release_path(path); in btrfs_update_root()
172 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root()
178 l = path->nodes[0]; in btrfs_update_root()
179 slot = path->slots[0]; in btrfs_update_root()
190 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_update_root()
192 btrfs_free_path(path); in btrfs_update_root()
210 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()
229 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); in btrfs_find_orphan_roots()
235 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
236 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_find_orphan_roots()
237 ret = btrfs_next_leaf(tree_root, path); in btrfs_find_orphan_roots()
242 leaf = path->nodes[0]; in btrfs_find_orphan_roots()
245 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_find_orphan_roots()
246 btrfs_release_path(path); in btrfs_find_orphan_roots()
278 btrfs_release_path(path); in btrfs_find_orphan_roots()
317 btrfs_free_path(path); in btrfs_find_orphan_roots()
326 struct btrfs_path *path; in btrfs_del_root() local
329 path = btrfs_alloc_path(); in btrfs_del_root()
330 if (!path) in btrfs_del_root()
332 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
338 ret = btrfs_del_item(trans, root, path); in btrfs_del_root()
340 btrfs_free_path(path); in btrfs_del_root()
350 struct btrfs_path *path; in btrfs_del_root_ref() local
358 path = btrfs_alloc_path(); in btrfs_del_root_ref()
359 if (!path) in btrfs_del_root_ref()
366 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1); in btrfs_del_root_ref()
369 leaf = path->nodes[0]; in btrfs_del_root_ref()
370 ref = btrfs_item_ptr(leaf, path->slots[0], in btrfs_del_root_ref()
379 ret = btrfs_del_item(trans, tree_root, path); in btrfs_del_root_ref()
388 btrfs_release_path(path); in btrfs_del_root_ref()
396 btrfs_free_path(path); in btrfs_del_root_ref()
422 struct btrfs_path *path; in btrfs_add_root_ref() local
427 path = btrfs_alloc_path(); in btrfs_add_root_ref()
428 if (!path) in btrfs_add_root_ref()
435 ret = btrfs_insert_empty_item(trans, tree_root, path, &key, in btrfs_add_root_ref()
439 btrfs_free_path(path); in btrfs_add_root_ref()
443 leaf = path->nodes[0]; in btrfs_add_root_ref()
444 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref); in btrfs_add_root_ref()
453 btrfs_release_path(path); in btrfs_add_root_ref()
460 btrfs_free_path(path); in btrfs_add_root_ref()