Lines Matching refs:path

818 static noinline int btrfs_mksubvol(struct path *parent,  in btrfs_mksubvol()
922 struct btrfs_path *path; in find_new_extents() local
930 path = btrfs_alloc_path(); in find_new_extents()
931 if (!path) in find_new_extents()
939 ret = btrfs_search_forward(root, &min_key, path, newer_than); in find_new_extents()
948 leaf = path->nodes[0]; in find_new_extents()
949 extent = btrfs_item_ptr(leaf, path->slots[0], in find_new_extents()
957 btrfs_free_path(path); in find_new_extents()
961 path->slots[0]++; in find_new_extents()
962 if (path->slots[0] < btrfs_header_nritems(leaf)) { in find_new_extents()
963 btrfs_item_key_to_cpu(leaf, &min_key, path->slots[0]); in find_new_extents()
971 btrfs_release_path(path); in find_new_extents()
974 btrfs_free_path(path); in find_new_extents()
1855 struct btrfs_path *path; in may_destroy_subvol() local
1861 path = btrfs_alloc_path(); in may_destroy_subvol()
1862 if (!path) in may_destroy_subvol()
1867 di = btrfs_lookup_dir_item(NULL, root->fs_info->tree_root, path, in may_destroy_subvol()
1870 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &key); in may_destroy_subvol()
1877 btrfs_release_path(path); in may_destroy_subvol()
1885 &key, path, 0, 0); in may_destroy_subvol()
1891 if (path->slots[0] > 0) { in may_destroy_subvol()
1892 path->slots[0]--; in may_destroy_subvol()
1893 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in may_destroy_subvol()
1899 btrfs_free_path(path); in may_destroy_subvol()
1928 struct btrfs_path *path, in copy_to_sk() argument
1946 leaf = path->nodes[0]; in copy_to_sk()
1947 slot = path->slots[0]; in copy_to_sk()
2053 struct btrfs_path *path; in search_ioctl() local
2064 path = btrfs_alloc_path(); in search_ioctl()
2065 if (!path) in search_ioctl()
2079 btrfs_free_path(path); in search_ioctl()
2089 ret = btrfs_search_forward(root, &key, path, sk->min_transid); in search_ioctl()
2095 ret = copy_to_sk(root, path, &key, sk, buf_size, ubuf, in search_ioctl()
2097 btrfs_release_path(path); in search_ioctl()
2106 btrfs_free_path(path); in search_ioctl()
2199 struct btrfs_path *path; in btrfs_search_path_in_tree() local
2206 path = btrfs_alloc_path(); in btrfs_search_path_in_tree()
2207 if (!path) in btrfs_search_path_in_tree()
2227 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_search_path_in_tree()
2231 ret = btrfs_previous_item(root, path, dirid, in btrfs_search_path_in_tree()
2241 l = path->nodes[0]; in btrfs_search_path_in_tree()
2242 slot = path->slots[0]; in btrfs_search_path_in_tree()
2260 btrfs_release_path(path); in btrfs_search_path_in_tree()
2269 btrfs_free_path(path); in btrfs_search_path_in_tree()
2744 strncpy(di_args->path, name->str, sizeof(di_args->path)); in btrfs_ioctl_dev_info()
2746 di_args->path[sizeof(di_args->path) - 1] = 0; in btrfs_ioctl_dev_info()
2748 di_args->path[0] = '\0'; in btrfs_ioctl_dev_info()
3118 const struct btrfs_path *path, in clone_update_extent_map() argument
3133 if (path) { in clone_update_extent_map()
3136 fi = btrfs_item_ptr(path->nodes[0], path->slots[0], in clone_update_extent_map()
3138 btrfs_extent_item_to_extent_map(inode, path, fi, false, em); in clone_update_extent_map()
3140 if (btrfs_file_extent_type(path->nodes[0], fi) == in clone_update_extent_map()
3201 struct btrfs_path *path, in clone_copy_inline_extent() argument
3221 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in clone_copy_inline_extent()
3225 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in clone_copy_inline_extent()
3226 ret = btrfs_next_leaf(root, path); in clone_copy_inline_extent()
3232 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in clone_copy_inline_extent()
3247 ei = btrfs_item_ptr(path->nodes[0], path->slots[0], in clone_copy_inline_extent()
3253 if (btrfs_file_extent_type(path->nodes[0], ei) == in clone_copy_inline_extent()
3257 ext_len = btrfs_file_extent_num_bytes(path->nodes[0], ei); in clone_copy_inline_extent()
3261 ret = btrfs_next_item(root, path); in clone_copy_inline_extent()
3265 btrfs_item_key_to_cpu(path->nodes[0], &key, in clone_copy_inline_extent()
3266 path->slots[0]); in clone_copy_inline_extent()
3294 btrfs_release_path(path); in clone_copy_inline_extent()
3298 ret = btrfs_insert_empty_item(trans, root, path, new_key, size); in clone_copy_inline_extent()
3308 write_extent_buffer(path->nodes[0], inline_data, in clone_copy_inline_extent()
3309 btrfs_item_ptr_offset(path->nodes[0], in clone_copy_inline_extent()
3310 path->slots[0]), in clone_copy_inline_extent()
3333 struct btrfs_path *path = NULL; in btrfs_clone() local
3351 path = btrfs_alloc_path(); in btrfs_clone()
3352 if (!path) { in btrfs_clone()
3357 path->reada = 2; in btrfs_clone()
3370 path->leave_spinning = 1; in btrfs_clone()
3371 ret = btrfs_search_slot(NULL, BTRFS_I(src)->root, &key, path, in btrfs_clone()
3380 if (key.offset == off && ret > 0 && path->slots[0] > 0) { in btrfs_clone()
3381 btrfs_item_key_to_cpu(path->nodes[0], &key, in btrfs_clone()
3382 path->slots[0] - 1); in btrfs_clone()
3384 path->slots[0]--; in btrfs_clone()
3387 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_clone()
3390 if (path->slots[0] >= nritems) { in btrfs_clone()
3391 ret = btrfs_next_leaf(BTRFS_I(src)->root, path); in btrfs_clone()
3396 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_clone()
3398 leaf = path->nodes[0]; in btrfs_clone()
3399 slot = path->slots[0]; in btrfs_clone()
3441 path->slots[0]++; in btrfs_clone()
3452 btrfs_release_path(path); in btrfs_clone()
3453 path->leave_spinning = 0; in btrfs_clone()
3514 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_clone()
3523 leaf = path->nodes[0]; in btrfs_clone()
3524 slot = path->slots[0]; in btrfs_clone()
3601 trans, path, in btrfs_clone()
3614 leaf = path->nodes[0]; in btrfs_clone()
3615 slot = path->slots[0]; in btrfs_clone()
3624 clone_update_extent_map(inode, trans, path, 0, 0); in btrfs_clone()
3627 btrfs_release_path(path); in btrfs_clone()
3639 btrfs_release_path(path); in btrfs_clone()
3649 btrfs_release_path(path); in btrfs_clone()
3675 btrfs_free_path(path); in btrfs_clone()
3908 struct btrfs_path *path; in btrfs_ioctl_default_subvol() local
3940 path = btrfs_alloc_path(); in btrfs_ioctl_default_subvol()
3941 if (!path) { in btrfs_ioctl_default_subvol()
3945 path->leave_spinning = 1; in btrfs_ioctl_default_subvol()
3949 btrfs_free_path(path); in btrfs_ioctl_default_subvol()
3955 di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path, in btrfs_ioctl_default_subvol()
3958 btrfs_free_path(path); in btrfs_ioctl_default_subvol()
3967 btrfs_set_dir_item_key(path->nodes[0], di, &disk_key); in btrfs_ioctl_default_subvol()
3968 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_ioctl_default_subvol()
3969 btrfs_free_path(path); in btrfs_ioctl_default_subvol()
4345 struct btrfs_path *path; in btrfs_ioctl_ino_to_path() local
4350 path = btrfs_alloc_path(); in btrfs_ioctl_ino_to_path()
4351 if (!path) { in btrfs_ioctl_ino_to_path()
4364 ipath = init_ipath(size, root, path); in btrfs_ioctl_ino_to_path()
4389 btrfs_free_path(path); in btrfs_ioctl_ino_to_path()
4423 struct btrfs_path *path = NULL; in btrfs_ioctl_logical_to_ino() local
4435 path = btrfs_alloc_path(); in btrfs_ioctl_logical_to_ino()
4436 if (!path) { in btrfs_ioctl_logical_to_ino()
4449 ret = iterate_inodes_from_logical(loi->logical, root->fs_info, path, in btrfs_ioctl_logical_to_ino()
4462 btrfs_free_path(path); in btrfs_ioctl_logical_to_ino()