Lines Matching refs:path

819 static noinline int btrfs_mksubvol(struct path *parent,  in btrfs_mksubvol()
923 struct btrfs_path *path; in find_new_extents() local
931 path = btrfs_alloc_path(); in find_new_extents()
932 if (!path) in find_new_extents()
940 ret = btrfs_search_forward(root, &min_key, path, newer_than); in find_new_extents()
949 leaf = path->nodes[0]; in find_new_extents()
950 extent = btrfs_item_ptr(leaf, path->slots[0], in find_new_extents()
958 btrfs_free_path(path); in find_new_extents()
962 path->slots[0]++; in find_new_extents()
963 if (path->slots[0] < btrfs_header_nritems(leaf)) { in find_new_extents()
964 btrfs_item_key_to_cpu(leaf, &min_key, path->slots[0]); in find_new_extents()
972 btrfs_release_path(path); in find_new_extents()
975 btrfs_free_path(path); in find_new_extents()
1864 struct btrfs_path *path; in may_destroy_subvol() local
1870 path = btrfs_alloc_path(); in may_destroy_subvol()
1871 if (!path) in may_destroy_subvol()
1876 di = btrfs_lookup_dir_item(NULL, root->fs_info->tree_root, path, in may_destroy_subvol()
1879 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &key); in may_destroy_subvol()
1886 btrfs_release_path(path); in may_destroy_subvol()
1894 &key, path, 0, 0); in may_destroy_subvol()
1900 if (path->slots[0] > 0) { in may_destroy_subvol()
1901 path->slots[0]--; in may_destroy_subvol()
1902 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in may_destroy_subvol()
1908 btrfs_free_path(path); in may_destroy_subvol()
1937 struct btrfs_path *path, in copy_to_sk() argument
1956 leaf = path->nodes[0]; in copy_to_sk()
1957 slot = path->slots[0]; in copy_to_sk()
2068 struct btrfs_path *path; in search_ioctl() local
2079 path = btrfs_alloc_path(); in search_ioctl()
2080 if (!path) in search_ioctl()
2094 btrfs_free_path(path); in search_ioctl()
2104 ret = btrfs_search_forward(root, &key, path, sk->min_transid); in search_ioctl()
2110 ret = copy_to_sk(root, path, &key, sk, buf_size, ubuf, in search_ioctl()
2112 btrfs_release_path(path); in search_ioctl()
2121 btrfs_free_path(path); in search_ioctl()
2214 struct btrfs_path *path; in btrfs_search_path_in_tree() local
2221 path = btrfs_alloc_path(); in btrfs_search_path_in_tree()
2222 if (!path) in btrfs_search_path_in_tree()
2242 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_search_path_in_tree()
2246 ret = btrfs_previous_item(root, path, dirid, in btrfs_search_path_in_tree()
2256 l = path->nodes[0]; in btrfs_search_path_in_tree()
2257 slot = path->slots[0]; in btrfs_search_path_in_tree()
2275 btrfs_release_path(path); in btrfs_search_path_in_tree()
2284 btrfs_free_path(path); in btrfs_search_path_in_tree()
2770 strncpy(di_args->path, name->str, sizeof(di_args->path)); in btrfs_ioctl_dev_info()
2772 di_args->path[sizeof(di_args->path) - 1] = 0; in btrfs_ioctl_dev_info()
2774 di_args->path[0] = '\0'; in btrfs_ioctl_dev_info()
3317 const struct btrfs_path *path, in clone_update_extent_map() argument
3332 if (path) { in clone_update_extent_map()
3335 fi = btrfs_item_ptr(path->nodes[0], path->slots[0], in clone_update_extent_map()
3337 btrfs_extent_item_to_extent_map(inode, path, fi, false, em); in clone_update_extent_map()
3339 if (btrfs_file_extent_type(path->nodes[0], fi) == in clone_update_extent_map()
3400 struct btrfs_path *path, in clone_copy_inline_extent() argument
3420 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in clone_copy_inline_extent()
3424 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in clone_copy_inline_extent()
3425 ret = btrfs_next_leaf(root, path); in clone_copy_inline_extent()
3431 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in clone_copy_inline_extent()
3446 ei = btrfs_item_ptr(path->nodes[0], path->slots[0], in clone_copy_inline_extent()
3452 if (btrfs_file_extent_type(path->nodes[0], ei) == in clone_copy_inline_extent()
3456 ext_len = btrfs_file_extent_num_bytes(path->nodes[0], ei); in clone_copy_inline_extent()
3460 ret = btrfs_next_item(root, path); in clone_copy_inline_extent()
3464 btrfs_item_key_to_cpu(path->nodes[0], &key, in clone_copy_inline_extent()
3465 path->slots[0]); in clone_copy_inline_extent()
3493 btrfs_release_path(path); in clone_copy_inline_extent()
3497 ret = btrfs_insert_empty_item(trans, root, path, new_key, size); in clone_copy_inline_extent()
3507 write_extent_buffer(path->nodes[0], inline_data, in clone_copy_inline_extent()
3508 btrfs_item_ptr_offset(path->nodes[0], in clone_copy_inline_extent()
3509 path->slots[0]), in clone_copy_inline_extent()
3532 struct btrfs_path *path = NULL; in btrfs_clone() local
3548 path = btrfs_alloc_path(); in btrfs_clone()
3549 if (!path) { in btrfs_clone()
3554 path->reada = 2; in btrfs_clone()
3567 path->leave_spinning = 1; in btrfs_clone()
3568 ret = btrfs_search_slot(NULL, BTRFS_I(src)->root, &key, path, in btrfs_clone()
3577 if (key.offset == off && ret > 0 && path->slots[0] > 0) { in btrfs_clone()
3578 btrfs_item_key_to_cpu(path->nodes[0], &key, in btrfs_clone()
3579 path->slots[0] - 1); in btrfs_clone()
3581 path->slots[0]--; in btrfs_clone()
3584 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_clone()
3586 if (path->slots[0] >= nritems) { in btrfs_clone()
3587 ret = btrfs_next_leaf(BTRFS_I(src)->root, path); in btrfs_clone()
3592 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_clone()
3594 leaf = path->nodes[0]; in btrfs_clone()
3595 slot = path->slots[0]; in btrfs_clone()
3637 path->slots[0]++; in btrfs_clone()
3648 btrfs_release_path(path); in btrfs_clone()
3649 path->leave_spinning = 0; in btrfs_clone()
3710 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_clone()
3719 leaf = path->nodes[0]; in btrfs_clone()
3720 slot = path->slots[0]; in btrfs_clone()
3775 trans, path, in btrfs_clone()
3788 leaf = path->nodes[0]; in btrfs_clone()
3789 slot = path->slots[0]; in btrfs_clone()
3798 clone_update_extent_map(inode, trans, path, 0, 0); in btrfs_clone()
3801 btrfs_release_path(path); in btrfs_clone()
3814 btrfs_release_path(path); in btrfs_clone()
3824 btrfs_release_path(path); in btrfs_clone()
3850 btrfs_free_path(path); in btrfs_clone()
4073 struct btrfs_path *path; in btrfs_ioctl_default_subvol() local
4105 path = btrfs_alloc_path(); in btrfs_ioctl_default_subvol()
4106 if (!path) { in btrfs_ioctl_default_subvol()
4110 path->leave_spinning = 1; in btrfs_ioctl_default_subvol()
4114 btrfs_free_path(path); in btrfs_ioctl_default_subvol()
4120 di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path, in btrfs_ioctl_default_subvol()
4123 btrfs_free_path(path); in btrfs_ioctl_default_subvol()
4132 btrfs_set_dir_item_key(path->nodes[0], di, &disk_key); in btrfs_ioctl_default_subvol()
4133 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_ioctl_default_subvol()
4134 btrfs_free_path(path); in btrfs_ioctl_default_subvol()
4510 struct btrfs_path *path; in btrfs_ioctl_ino_to_path() local
4515 path = btrfs_alloc_path(); in btrfs_ioctl_ino_to_path()
4516 if (!path) { in btrfs_ioctl_ino_to_path()
4529 ipath = init_ipath(size, root, path); in btrfs_ioctl_ino_to_path()
4554 btrfs_free_path(path); in btrfs_ioctl_ino_to_path()
4588 struct btrfs_path *path = NULL; in btrfs_ioctl_logical_to_ino() local
4600 path = btrfs_alloc_path(); in btrfs_ioctl_logical_to_ino()
4601 if (!path) { in btrfs_ioctl_logical_to_ino()
4614 ret = iterate_inodes_from_logical(loi->logical, root->fs_info, path, in btrfs_ioctl_logical_to_ino()
4627 btrfs_free_path(path); in btrfs_ioctl_logical_to_ino()