Lines Matching refs:path

137 				struct btrfs_path *path, int extent_inserted,  in insert_inline_extent()  argument
167 path->leave_spinning = 1; in insert_inline_extent()
168 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_inline_extent()
175 leaf = path->nodes[0]; in insert_inline_extent()
176 ei = btrfs_item_ptr(leaf, path->slots[0], in insert_inline_extent()
214 btrfs_release_path(path); in insert_inline_extent()
252 struct btrfs_path *path; in cow_file_range_inline() local
269 path = btrfs_alloc_path(); in cow_file_range_inline()
270 if (!path) in cow_file_range_inline()
275 btrfs_free_path(path); in cow_file_range_inline()
287 ret = __btrfs_drop_extents(trans, root, inode, path, in cow_file_range_inline()
297 ret = insert_inline_extent(trans, path, extent_inserted, in cow_file_range_inline()
313 btrfs_free_path(path); in cow_file_range_inline()
1213 struct btrfs_path *path; in run_delalloc_nocow() local
1232 path = btrfs_alloc_path(); in run_delalloc_nocow()
1233 if (!path) { in run_delalloc_nocow()
1259 btrfs_free_path(path); in run_delalloc_nocow()
1268 ret = btrfs_lookup_file_extent(trans, root, path, ino, in run_delalloc_nocow()
1272 if (ret > 0 && path->slots[0] > 0 && check_prev) { in run_delalloc_nocow()
1273 leaf = path->nodes[0]; in run_delalloc_nocow()
1275 path->slots[0] - 1); in run_delalloc_nocow()
1278 path->slots[0]--; in run_delalloc_nocow()
1282 leaf = path->nodes[0]; in run_delalloc_nocow()
1283 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in run_delalloc_nocow()
1284 ret = btrfs_next_leaf(root, path); in run_delalloc_nocow()
1289 leaf = path->nodes[0]; in run_delalloc_nocow()
1295 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in run_delalloc_nocow()
1301 path->slots[0]++; in run_delalloc_nocow()
1314 fi = btrfs_item_ptr(leaf, path->slots[0], in run_delalloc_nocow()
1328 path->slots[0]++; in run_delalloc_nocow()
1368 path->slots[0], fi); in run_delalloc_nocow()
1375 path->slots[0]++; in run_delalloc_nocow()
1386 path->slots[0]++; in run_delalloc_nocow()
1390 btrfs_release_path(path); in run_delalloc_nocow()
1464 btrfs_release_path(path); in run_delalloc_nocow()
1491 btrfs_free_path(path); in run_delalloc_nocow()
2060 struct btrfs_path *path; in insert_reserved_file_extent() local
2066 path = btrfs_alloc_path(); in insert_reserved_file_extent()
2067 if (!path) in insert_reserved_file_extent()
2079 ret = __btrfs_drop_extents(trans, root, inode, path, file_pos, in insert_reserved_file_extent()
2090 path->leave_spinning = 1; in insert_reserved_file_extent()
2091 ret = btrfs_insert_empty_item(trans, root, path, &ins, in insert_reserved_file_extent()
2096 leaf = path->nodes[0]; in insert_reserved_file_extent()
2097 fi = btrfs_item_ptr(leaf, path->slots[0], in insert_reserved_file_extent()
2111 btrfs_release_path(path); in insert_reserved_file_extent()
2122 btrfs_free_path(path); in insert_reserved_file_extent()
2153 struct btrfs_path *path; member
2228 struct btrfs_path *path = new->path; in record_one_backref() local
2265 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in record_one_backref()
2273 leaf = path->nodes[0]; in record_one_backref()
2274 slot = path->slots[0]; in record_one_backref()
2277 ret = btrfs_next_leaf(root, path); in record_one_backref()
2287 path->slots[0]++; in record_one_backref()
2337 btrfs_release_path(path); in record_one_backref()
2342 static noinline bool record_extent_backrefs(struct btrfs_path *path, in record_extent_backrefs() argument
2349 new->path = path; in record_extent_backrefs()
2354 path, record_one_backref, in record_extent_backrefs()
2395 static noinline int relink_extent_backref(struct btrfs_path *path, in relink_extent_backref() argument
2481 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in relink_extent_backref()
2489 extent = btrfs_item_ptr(path->nodes[0], path->slots[0], in relink_extent_backref()
2492 if (btrfs_file_extent_generation(path->nodes[0], extent) != in relink_extent_backref()
2496 btrfs_release_path(path); in relink_extent_backref()
2516 path->leave_spinning = 1; in relink_extent_backref()
2522 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in relink_extent_backref()
2526 path->slots[0]--; in relink_extent_backref()
2527 leaf = path->nodes[0]; in relink_extent_backref()
2528 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in relink_extent_backref()
2530 fi = btrfs_item_ptr(leaf, path->slots[0], in relink_extent_backref()
2545 btrfs_release_path(path); in relink_extent_backref()
2550 ret = btrfs_insert_empty_item(trans, root, path, &key, in relink_extent_backref()
2557 leaf = path->nodes[0]; in relink_extent_backref()
2558 item = btrfs_item_ptr(leaf, path->slots[0], in relink_extent_backref()
2573 btrfs_release_path(path); in relink_extent_backref()
2586 btrfs_release_path(path); in relink_extent_backref()
2587 path->leave_spinning = 0; in relink_extent_backref()
2612 struct btrfs_path *path; in relink_file_extents() local
2623 path = btrfs_alloc_path(); in relink_file_extents()
2624 if (!path) in relink_file_extents()
2627 if (!record_extent_backrefs(path, new)) { in relink_file_extents()
2628 btrfs_free_path(path); in relink_file_extents()
2631 btrfs_release_path(path); in relink_file_extents()
2641 ret = relink_extent_backref(path, prev, backref); in relink_file_extents()
2654 btrfs_free_path(path); in relink_file_extents()
2667 struct btrfs_path *path; in record_old_file_extents() local
2686 path = btrfs_alloc_path(); in record_old_file_extents()
2687 if (!path) in record_old_file_extents()
2694 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in record_old_file_extents()
2697 if (ret > 0 && path->slots[0] > 0) in record_old_file_extents()
2698 path->slots[0]--; in record_old_file_extents()
2711 l = path->nodes[0]; in record_old_file_extents()
2712 slot = path->slots[0]; in record_old_file_extents()
2715 ret = btrfs_next_leaf(root, path); in record_old_file_extents()
2759 path->slots[0]++; in record_old_file_extents()
2763 btrfs_free_path(path); in record_old_file_extents()
2769 btrfs_free_path(path); in record_old_file_extents()
3302 struct btrfs_path *path; in btrfs_orphan_cleanup() local
3313 path = btrfs_alloc_path(); in btrfs_orphan_cleanup()
3314 if (!path) { in btrfs_orphan_cleanup()
3318 path->reada = -1; in btrfs_orphan_cleanup()
3325 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_orphan_cleanup()
3336 if (path->slots[0] == 0) in btrfs_orphan_cleanup()
3338 path->slots[0]--; in btrfs_orphan_cleanup()
3342 leaf = path->nodes[0]; in btrfs_orphan_cleanup()
3343 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_orphan_cleanup()
3352 btrfs_release_path(path); in btrfs_orphan_cleanup()
3472 btrfs_release_path(path); in btrfs_orphan_cleanup()
3496 btrfs_free_path(path); in btrfs_orphan_cleanup()
3574 struct btrfs_path *path; in btrfs_read_locked_inode() local
3590 path = btrfs_alloc_path(); in btrfs_read_locked_inode()
3591 if (!path) in btrfs_read_locked_inode()
3596 ret = btrfs_lookup_inode(NULL, root, path, &location, 0); in btrfs_read_locked_inode()
3600 leaf = path->nodes[0]; in btrfs_read_locked_inode()
3605 inode_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_read_locked_inode()
3653 path->slots[0]++; in btrfs_read_locked_inode()
3655 path->slots[0] >= btrfs_header_nritems(leaf)) in btrfs_read_locked_inode()
3658 btrfs_item_key_to_cpu(leaf, &location, path->slots[0]); in btrfs_read_locked_inode()
3662 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in btrfs_read_locked_inode()
3680 maybe_acls = acls_after_inode_item(leaf, path->slots[0], in btrfs_read_locked_inode()
3683 path->slots[0] = first_xattr_slot; in btrfs_read_locked_inode()
3684 ret = btrfs_load_inode_props(inode, path); in btrfs_read_locked_inode()
3691 btrfs_free_path(path); in btrfs_read_locked_inode()
3724 btrfs_free_path(path); in btrfs_read_locked_inode()
3785 struct btrfs_path *path; in btrfs_update_inode_item() local
3789 path = btrfs_alloc_path(); in btrfs_update_inode_item()
3790 if (!path) in btrfs_update_inode_item()
3793 path->leave_spinning = 1; in btrfs_update_inode_item()
3794 ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location, in btrfs_update_inode_item()
3802 leaf = path->nodes[0]; in btrfs_update_inode_item()
3803 inode_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_update_inode_item()
3811 btrfs_free_path(path); in btrfs_update_inode_item()
3866 struct btrfs_path *path; in __btrfs_unlink_inode() local
3875 path = btrfs_alloc_path(); in __btrfs_unlink_inode()
3876 if (!path) { in __btrfs_unlink_inode()
3881 path->leave_spinning = 1; in __btrfs_unlink_inode()
3882 di = btrfs_lookup_dir_item(trans, root, path, dir_ino, in __btrfs_unlink_inode()
3892 leaf = path->nodes[0]; in __btrfs_unlink_inode()
3894 ret = btrfs_delete_one_dir_name(trans, root, path, di); in __btrfs_unlink_inode()
3897 btrfs_release_path(path); in __btrfs_unlink_inode()
3947 btrfs_free_path(path); in __btrfs_unlink_inode()
4053 struct btrfs_path *path; in btrfs_unlink_subvol() local
4061 path = btrfs_alloc_path(); in btrfs_unlink_subvol()
4062 if (!path) in btrfs_unlink_subvol()
4065 di = btrfs_lookup_dir_item(trans, root, path, dir_ino, in btrfs_unlink_subvol()
4075 leaf = path->nodes[0]; in btrfs_unlink_subvol()
4078 ret = btrfs_delete_one_dir_name(trans, root, path, di); in btrfs_unlink_subvol()
4083 btrfs_release_path(path); in btrfs_unlink_subvol()
4093 di = btrfs_search_dir_index_item(root, path, dir_ino, in btrfs_unlink_subvol()
4104 leaf = path->nodes[0]; in btrfs_unlink_subvol()
4105 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_unlink_subvol()
4106 btrfs_release_path(path); in btrfs_unlink_subvol()
4109 btrfs_release_path(path); in btrfs_unlink_subvol()
4124 btrfs_free_path(path); in btrfs_unlink_subvol()
4184 struct btrfs_path *path, in truncate_inline_extent() argument
4189 struct extent_buffer *leaf = path->nodes[0]; in truncate_inline_extent()
4190 int slot = path->slots[0]; in truncate_inline_extent()
4210 btrfs_release_path(path); in truncate_inline_extent()
4216 btrfs_truncate_item(root, path, size, 1); in truncate_inline_extent()
4240 struct btrfs_path *path; in btrfs_truncate_inode_items() local
4274 path = btrfs_alloc_path(); in btrfs_truncate_inode_items()
4275 if (!path) in btrfs_truncate_inode_items()
4277 path->reada = -1; in btrfs_truncate_inode_items()
4316 path->leave_spinning = 1; in btrfs_truncate_inode_items()
4317 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_truncate_inode_items()
4327 if (path->slots[0] == 0) in btrfs_truncate_inode_items()
4329 path->slots[0]--; in btrfs_truncate_inode_items()
4334 leaf = path->nodes[0]; in btrfs_truncate_inode_items()
4335 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_truncate_inode_items()
4346 fi = btrfs_item_ptr(leaf, path->slots[0], in btrfs_truncate_inode_items()
4354 path->slots[0], fi); in btrfs_truncate_inode_items()
4428 err = btrfs_del_items(trans, root, path, in btrfs_truncate_inode_items()
4440 err = truncate_inline_extent(inode, path, in btrfs_truncate_inode_items()
4458 pending_del_slot = path->slots[0]; in btrfs_truncate_inode_items()
4461 path->slots[0] + 1 == pending_del_slot) { in btrfs_truncate_inode_items()
4464 pending_del_slot = path->slots[0]; in btrfs_truncate_inode_items()
4476 btrfs_set_path_blocking(path); in btrfs_truncate_inode_items()
4501 if (path->slots[0] == 0 || in btrfs_truncate_inode_items()
4502 path->slots[0] != pending_del_slot || in btrfs_truncate_inode_items()
4505 ret = btrfs_del_items(trans, root, path, in btrfs_truncate_inode_items()
4515 btrfs_release_path(path); in btrfs_truncate_inode_items()
4535 path->slots[0]--; in btrfs_truncate_inode_items()
4540 ret = btrfs_del_items(trans, root, path, pending_del_slot, in btrfs_truncate_inode_items()
4550 btrfs_free_path(path); in btrfs_truncate_inode_items()
5245 struct btrfs_path *path; in btrfs_inode_by_name() local
5249 path = btrfs_alloc_path(); in btrfs_inode_by_name()
5250 if (!path) in btrfs_inode_by_name()
5253 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(dir), name, in btrfs_inode_by_name()
5261 btrfs_dir_item_key_to_cpu(path->nodes[0], di, location); in btrfs_inode_by_name()
5263 btrfs_free_path(path); in btrfs_inode_by_name()
5281 struct btrfs_path *path; in fixup_tree_root_location() local
5289 path = btrfs_alloc_path(); in fixup_tree_root_location()
5290 if (!path) { in fixup_tree_root_location()
5300 ret = btrfs_search_slot(NULL, root->fs_info->tree_root, &key, path, in fixup_tree_root_location()
5308 leaf = path->nodes[0]; in fixup_tree_root_location()
5309 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref); in fixup_tree_root_location()
5320 btrfs_release_path(path); in fixup_tree_root_location()
5334 btrfs_free_path(path); in fixup_tree_root_location()
5653 struct btrfs_path *path; in btrfs_real_readdir() local
5678 path = btrfs_alloc_path(); in btrfs_real_readdir()
5679 if (!path) in btrfs_real_readdir()
5682 path->reada = 1; in btrfs_real_readdir()
5694 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_real_readdir()
5700 leaf = path->nodes[0]; in btrfs_real_readdir()
5701 slot = path->slots[0]; in btrfs_real_readdir()
5703 ret = btrfs_next_leaf(root, path); in btrfs_real_readdir()
5785 path->slots[0]++; in btrfs_real_readdir()
5836 btrfs_free_path(path); in btrfs_real_readdir()
5933 struct btrfs_path *path; in btrfs_set_inode_index_count() local
5941 path = btrfs_alloc_path(); in btrfs_set_inode_index_count()
5942 if (!path) in btrfs_set_inode_index_count()
5945 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_set_inode_index_count()
5959 if (path->slots[0] == 0) { in btrfs_set_inode_index_count()
5964 path->slots[0]--; in btrfs_set_inode_index_count()
5966 leaf = path->nodes[0]; in btrfs_set_inode_index_count()
5967 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_set_inode_index_count()
5977 btrfs_free_path(path); in btrfs_set_inode_index_count()
6025 struct btrfs_path *path; in btrfs_new_inode() local
6033 path = btrfs_alloc_path(); in btrfs_new_inode()
6034 if (!path) in btrfs_new_inode()
6039 btrfs_free_path(path); in btrfs_new_inode()
6061 btrfs_free_path(path); in btrfs_new_inode()
6116 path->leave_spinning = 1; in btrfs_new_inode()
6117 ret = btrfs_insert_empty_items(trans, root, path, key, sizes, nitems); in btrfs_new_inode()
6129 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_new_inode()
6131 memset_extent_buffer(path->nodes[0], 0, (unsigned long)inode_item, in btrfs_new_inode()
6133 fill_inode_item(trans, path->nodes[0], inode_item, inode); in btrfs_new_inode()
6136 ref = btrfs_item_ptr(path->nodes[0], path->slots[0] + 1, in btrfs_new_inode()
6138 btrfs_set_inode_ref_name_len(path->nodes[0], ref, name_len); in btrfs_new_inode()
6139 btrfs_set_inode_ref_index(path->nodes[0], ref, *index); in btrfs_new_inode()
6141 write_extent_buffer(path->nodes[0], name, ptr, name_len); in btrfs_new_inode()
6144 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_new_inode()
6145 btrfs_free_path(path); in btrfs_new_inode()
6177 btrfs_free_path(path); in btrfs_new_inode()
6631 static noinline int uncompress_inline(struct btrfs_path *path, in uncompress_inline() argument
6637 struct extent_buffer *leaf = path->nodes[0]; in uncompress_inline()
6648 btrfs_item_nr(path->slots[0])); in uncompress_inline()
6682 struct btrfs_path *path = NULL; in btrfs_get_extent() local
6719 if (!path) { in btrfs_get_extent()
6720 path = btrfs_alloc_path(); in btrfs_get_extent()
6721 if (!path) { in btrfs_get_extent()
6729 path->reada = 1; in btrfs_get_extent()
6732 ret = btrfs_lookup_file_extent(trans, root, path, in btrfs_get_extent()
6740 if (path->slots[0] == 0) in btrfs_get_extent()
6742 path->slots[0]--; in btrfs_get_extent()
6745 leaf = path->nodes[0]; in btrfs_get_extent()
6746 item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_get_extent()
6749 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_get_extent()
6771 size = btrfs_file_extent_inline_len(leaf, path->slots[0], item); in btrfs_get_extent()
6776 path->slots[0]++; in btrfs_get_extent()
6777 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_get_extent()
6778 ret = btrfs_next_leaf(root, path); in btrfs_get_extent()
6785 leaf = path->nodes[0]; in btrfs_get_extent()
6787 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_get_extent()
6801 btrfs_extent_item_to_extent_map(inode, path, item, new_inline, em); in btrfs_get_extent()
6816 size = btrfs_file_extent_inline_len(leaf, path->slots[0], item); in btrfs_get_extent()
6828 ret = uncompress_inline(path, inode, page, in btrfs_get_extent()
6854 btrfs_release_path(path); in btrfs_get_extent()
6879 btrfs_release_path(path); in btrfs_get_extent()
6928 if (path) in btrfs_get_extent()
6929 btrfs_free_path(path); in btrfs_get_extent()
7112 struct btrfs_path *path; in can_nocow_extent() local
7127 path = btrfs_alloc_path(); in can_nocow_extent()
7128 if (!path) in can_nocow_extent()
7131 ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(inode), in can_nocow_extent()
7136 slot = path->slots[0]; in can_nocow_extent()
7146 leaf = path->nodes[0]; in can_nocow_extent()
7207 btrfs_release_path(path); in can_nocow_extent()
7244 btrfs_free_path(path); in can_nocow_extent()
9503 struct btrfs_path *path; in btrfs_symlink() local
9562 path = btrfs_alloc_path(); in btrfs_symlink()
9563 if (!path) { in btrfs_symlink()
9571 err = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_symlink()
9574 btrfs_free_path(path); in btrfs_symlink()
9577 leaf = path->nodes[0]; in btrfs_symlink()
9578 ei = btrfs_item_ptr(leaf, path->slots[0], in btrfs_symlink()
9591 btrfs_free_path(path); in btrfs_symlink()