Lines Matching refs:path
498 struct btrfs_path *path; in alloc_path_for_send() local
500 path = btrfs_alloc_path(); in alloc_path_for_send()
501 if (!path) in alloc_path_for_send()
503 path->search_commit_root = 1; in alloc_path_for_send()
504 path->skip_locking = 1; in alloc_path_for_send()
505 path->need_commit_sem = 1; in alloc_path_for_send()
506 return path; in alloc_path_for_send()
718 struct fs_path *path, struct fs_path *lnk) in send_link() argument
722 verbose_printk("btrfs: send_link %s -> %s\n", path->start, lnk->start); in send_link()
728 TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, path); in send_link()
741 static int send_unlink(struct send_ctx *sctx, struct fs_path *path) in send_unlink() argument
745 verbose_printk("btrfs: send_unlink %s\n", path->start); in send_unlink()
751 TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, path); in send_unlink()
763 static int send_rmdir(struct send_ctx *sctx, struct fs_path *path) in send_rmdir() argument
767 verbose_printk("btrfs: send_rmdir %s\n", path->start); in send_rmdir()
773 TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, path); in send_rmdir()
785 static int __get_inode_info(struct btrfs_root *root, struct btrfs_path *path, in __get_inode_info() argument
796 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in __get_inode_info()
803 ii = btrfs_item_ptr(path->nodes[0], path->slots[0], in __get_inode_info()
806 *size = btrfs_inode_size(path->nodes[0], ii); in __get_inode_info()
808 *gen = btrfs_inode_generation(path->nodes[0], ii); in __get_inode_info()
810 *mode = btrfs_inode_mode(path->nodes[0], ii); in __get_inode_info()
812 *uid = btrfs_inode_uid(path->nodes[0], ii); in __get_inode_info()
814 *gid = btrfs_inode_gid(path->nodes[0], ii); in __get_inode_info()
816 *rdev = btrfs_inode_rdev(path->nodes[0], ii); in __get_inode_info()
826 struct btrfs_path *path; in get_inode_info() local
829 path = alloc_path_for_send(); in get_inode_info()
830 if (!path) in get_inode_info()
832 ret = __get_inode_info(root, path, ino, size, gen, mode, uid, gid, in get_inode_info()
834 btrfs_free_path(path); in get_inode_info()
850 static int iterate_inode_ref(struct btrfs_root *root, struct btrfs_path *path, in iterate_inode_ref() argument
854 struct extent_buffer *eb = path->nodes[0]; in iterate_inode_ref()
862 int slot = path->slots[0]; in iterate_inode_ref()
970 static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path, in iterate_dir_item() argument
1003 eb = path->nodes[0]; in iterate_dir_item()
1004 slot = path->slots[0]; in iterate_dir_item()
1102 u64 ino, struct fs_path *path) in get_inode_path() argument
1112 fs_path_reset(path); in get_inode_path()
1134 __copy_first_ref, path); in get_inode_path()
1147 struct btrfs_path *path; member
1218 ret = __get_inode_info(found->root, bctx->path, ino, &i_size, NULL, NULL, in __iterate_backrefs()
1220 btrfs_release_path(bctx->path); in __iterate_backrefs()
1274 struct btrfs_path *path, in find_extent_clone() argument
1287 struct extent_buffer *eb = path->nodes[0]; in find_extent_clone()
1308 backref_ctx->path = tmp_path; in find_extent_clone()
1320 fi = btrfs_item_ptr(eb, path->slots[0], in find_extent_clone()
1447 struct btrfs_path *path; in read_symlink() local
1455 path = alloc_path_for_send(); in read_symlink()
1456 if (!path) in read_symlink()
1462 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in read_symlink()
1481 ei = btrfs_item_ptr(path->nodes[0], path->slots[0], in read_symlink()
1483 type = btrfs_file_extent_type(path->nodes[0], ei); in read_symlink()
1484 compression = btrfs_file_extent_compression(path->nodes[0], ei); in read_symlink()
1489 len = btrfs_file_extent_inline_len(path->nodes[0], path->slots[0], ei); in read_symlink()
1491 ret = fs_path_add_from_extent_buffer(dest, path->nodes[0], off, len); in read_symlink()
1494 btrfs_free_path(path); in read_symlink()
1507 struct btrfs_path *path; in gen_unique_name() local
1513 path = alloc_path_for_send(); in gen_unique_name()
1514 if (!path) in gen_unique_name()
1523 path, BTRFS_FIRST_FREE_OBJECTID, in gen_unique_name()
1525 btrfs_release_path(path); in gen_unique_name()
1543 path, BTRFS_FIRST_FREE_OBJECTID, in gen_unique_name()
1545 btrfs_release_path(path); in gen_unique_name()
1562 btrfs_free_path(path); in gen_unique_name()
1670 struct btrfs_path *path; in lookup_dir_item_inode() local
1672 path = alloc_path_for_send(); in lookup_dir_item_inode()
1673 if (!path) in lookup_dir_item_inode()
1676 di = btrfs_lookup_dir_item(NULL, root, path, in lookup_dir_item_inode()
1686 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &key); in lookup_dir_item_inode()
1692 *found_type = btrfs_dir_type(path->nodes[0], di); in lookup_dir_item_inode()
1695 btrfs_free_path(path); in lookup_dir_item_inode()
1709 struct btrfs_path *path; in get_first_ref() local
1713 path = alloc_path_for_send(); in get_first_ref()
1714 if (!path) in get_first_ref()
1721 ret = btrfs_search_slot_for_read(root, &key, path, 1, 0); in get_first_ref()
1725 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in get_first_ref()
1726 path->slots[0]); in get_first_ref()
1736 iref = btrfs_item_ptr(path->nodes[0], path->slots[0], in get_first_ref()
1738 len = btrfs_inode_ref_name_len(path->nodes[0], iref); in get_first_ref()
1739 ret = fs_path_add_from_extent_buffer(name, path->nodes[0], in get_first_ref()
1745 extref = btrfs_item_ptr(path->nodes[0], path->slots[0], in get_first_ref()
1747 len = btrfs_inode_extref_name_len(path->nodes[0], extref); in get_first_ref()
1748 ret = fs_path_add_from_extent_buffer(name, path->nodes[0], in get_first_ref()
1750 parent_dir = btrfs_inode_extref_parent(path->nodes[0], extref); in get_first_ref()
1754 btrfs_release_path(path); in get_first_ref()
1766 btrfs_free_path(path); in get_first_ref()
2287 struct btrfs_path *path; in send_subvol_begin() local
2294 path = btrfs_alloc_path(); in send_subvol_begin()
2295 if (!path) in send_subvol_begin()
2300 btrfs_free_path(path); in send_subvol_begin()
2309 &key, path, 1, 0); in send_subvol_begin()
2317 leaf = path->nodes[0]; in send_subvol_begin()
2318 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in send_subvol_begin()
2324 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref); in send_subvol_begin()
2327 btrfs_release_path(path); in send_subvol_begin()
2355 btrfs_free_path(path); in send_subvol_begin()
2453 struct btrfs_path *path = NULL; in send_utimes() local
2464 path = alloc_path_for_send(); in send_utimes()
2465 if (!path) { in send_utimes()
2473 ret = btrfs_search_slot(NULL, sctx->send_root, &key, path, 0, 0); in send_utimes()
2477 eb = path->nodes[0]; in send_utimes()
2478 slot = path->slots[0]; in send_utimes()
2499 btrfs_free_path(path); in send_utimes()
2595 struct btrfs_path *path = NULL; in did_create_dir() local
2603 path = alloc_path_for_send(); in did_create_dir()
2604 if (!path) { in did_create_dir()
2612 ret = btrfs_search_slot(NULL, sctx->send_root, &key, path, 0, 0); in did_create_dir()
2617 eb = path->nodes[0]; in did_create_dir()
2618 slot = path->slots[0]; in did_create_dir()
2620 ret = btrfs_next_leaf(sctx->send_root, path); in did_create_dir()
2646 path->slots[0]++; in did_create_dir()
2650 btrfs_free_path(path); in did_create_dir()
2699 u64 dir_gen, struct fs_path *path) in __record_ref() argument
2709 ref->full_path = path; in __record_ref()
2764 struct fs_path *path) in orphanize_inode() argument
2777 ret = send_rename(sctx, path, orphan); in orphanize_inode()
2859 struct btrfs_path *path; in can_rmdir() local
2871 path = alloc_path_for_send(); in can_rmdir()
2872 if (!path) in can_rmdir()
2878 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in can_rmdir()
2885 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in can_rmdir()
2886 ret = btrfs_next_leaf(root, path); in can_rmdir()
2893 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in can_rmdir()
2894 path->slots[0]); in can_rmdir()
2899 di = btrfs_item_ptr(path->nodes[0], path->slots[0], in can_rmdir()
2901 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &loc); in can_rmdir()
2923 path->slots[0]++; in can_rmdir()
2929 btrfs_free_path(path); in can_rmdir()
3289 struct btrfs_path *path; in wait_for_dest_dir_move() local
3300 path = alloc_path_for_send(); in wait_for_dest_dir_move()
3301 if (!path) in wait_for_dest_dir_move()
3308 ret = btrfs_search_slot(NULL, sctx->parent_root, &key, path, 0, 0); in wait_for_dest_dir_move()
3316 di = btrfs_match_dir_item_name(sctx->parent_root, path, in wait_for_dest_dir_move()
3330 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &di_key); in wait_for_dest_dir_move()
3366 btrfs_free_path(path); in wait_for_dest_dir_move()
3893 struct btrfs_path *path, in find_iref() argument
3906 ret = iterate_inode_ref(root, path, key, 0, __find_iref, &ctx); in find_iref()
3989 struct btrfs_path *path; in process_all_refs() local
3997 path = alloc_path_for_send(); in process_all_refs()
3998 if (!path) in process_all_refs()
4017 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in process_all_refs()
4022 eb = path->nodes[0]; in process_all_refs()
4023 slot = path->slots[0]; in process_all_refs()
4025 ret = btrfs_next_leaf(root, path); in process_all_refs()
4040 ret = iterate_inode_ref(root, path, &found_key, 0, cb, sctx); in process_all_refs()
4044 path->slots[0]++; in process_all_refs()
4046 btrfs_release_path(path); in process_all_refs()
4053 btrfs_free_path(path); in process_all_refs()
4058 struct fs_path *path, in send_set_xattr() argument
4068 TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, path); in send_set_xattr()
4080 struct fs_path *path, in send_remove_xattr() argument
4089 TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, path); in send_remove_xattr()
4212 struct btrfs_path *path, in find_xattr() argument
4226 ret = iterate_dir_item(root, path, key, __find_xattr, &ctx); in find_xattr()
4310 struct btrfs_path *path; in process_all_new_xattrs() local
4316 path = alloc_path_for_send(); in process_all_new_xattrs()
4317 if (!path) in process_all_new_xattrs()
4325 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in process_all_new_xattrs()
4330 eb = path->nodes[0]; in process_all_new_xattrs()
4331 slot = path->slots[0]; in process_all_new_xattrs()
4333 ret = btrfs_next_leaf(root, path); in process_all_new_xattrs()
4350 ret = iterate_dir_item(root, path, &found_key, in process_all_new_xattrs()
4355 path->slots[0]++; in process_all_new_xattrs()
4359 btrfs_free_path(path); in process_all_new_xattrs()
4608 struct btrfs_path *path, in send_write_or_clone() argument
4621 ei = btrfs_item_ptr(path->nodes[0], path->slots[0], in send_write_or_clone()
4623 type = btrfs_file_extent_type(path->nodes[0], ei); in send_write_or_clone()
4625 len = btrfs_file_extent_inline_len(path->nodes[0], in send_write_or_clone()
4626 path->slots[0], ei); in send_write_or_clone()
4634 len = btrfs_file_extent_num_bytes(path->nodes[0], ei); in send_write_or_clone()
4672 struct btrfs_path *path = NULL; in is_extent_unchanged() local
4689 path = alloc_path_for_send(); in is_extent_unchanged()
4690 if (!path) in is_extent_unchanged()
4731 ret = btrfs_search_slot_for_read(sctx->parent_root, &key, path, 0, 0); in is_extent_unchanged()
4742 eb = path->nodes[0]; in is_extent_unchanged()
4743 slot = path->slots[0]; in is_extent_unchanged()
4801 ret = btrfs_next_item(sctx->parent_root, path); in is_extent_unchanged()
4805 eb = path->nodes[0]; in is_extent_unchanged()
4806 slot = path->slots[0]; in is_extent_unchanged()
4832 btrfs_free_path(path); in is_extent_unchanged()
4838 struct btrfs_path *path; in get_last_extent() local
4846 path = alloc_path_for_send(); in get_last_extent()
4847 if (!path) in get_last_extent()
4855 ret = btrfs_search_slot_for_read(root, &key, path, 0, 1); in get_last_extent()
4859 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in get_last_extent()
4863 fi = btrfs_item_ptr(path->nodes[0], path->slots[0], in get_last_extent()
4865 type = btrfs_file_extent_type(path->nodes[0], fi); in get_last_extent()
4867 u64 size = btrfs_file_extent_inline_len(path->nodes[0], in get_last_extent()
4868 path->slots[0], fi); in get_last_extent()
4873 btrfs_file_extent_num_bytes(path->nodes[0], fi); in get_last_extent()
4877 btrfs_free_path(path); in get_last_extent()
4881 static int maybe_send_hole(struct send_ctx *sctx, struct btrfs_path *path, in maybe_send_hole() argument
4898 fi = btrfs_item_ptr(path->nodes[0], path->slots[0], in maybe_send_hole()
4900 type = btrfs_file_extent_type(path->nodes[0], fi); in maybe_send_hole()
4902 u64 size = btrfs_file_extent_inline_len(path->nodes[0], in maybe_send_hole()
4903 path->slots[0], fi); in maybe_send_hole()
4908 btrfs_file_extent_num_bytes(path->nodes[0], fi); in maybe_send_hole()
4911 if (path->slots[0] == 0 && in maybe_send_hole()
4932 struct btrfs_path *path, in process_extent() argument
4942 ret = is_extent_unchanged(sctx, path, key); in process_extent()
4953 ei = btrfs_item_ptr(path->nodes[0], path->slots[0], in process_extent()
4955 type = btrfs_file_extent_type(path->nodes[0], ei); in process_extent()
4970 if (btrfs_file_extent_disk_bytenr(path->nodes[0], ei) == 0) { in process_extent()
4977 ret = find_extent_clone(sctx, path, key->objectid, key->offset, in process_extent()
4982 ret = send_write_or_clone(sctx, path, key, found_clone); in process_extent()
4986 ret = maybe_send_hole(sctx, path, key); in process_extent()
4995 struct btrfs_path *path; in process_all_extents() local
5002 path = alloc_path_for_send(); in process_all_extents()
5003 if (!path) in process_all_extents()
5009 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in process_all_extents()
5014 eb = path->nodes[0]; in process_all_extents()
5015 slot = path->slots[0]; in process_all_extents()
5018 ret = btrfs_next_leaf(root, path); in process_all_extents()
5036 ret = process_extent(sctx, path, &found_key); in process_all_extents()
5040 path->slots[0]++; in process_all_extents()
5044 btrfs_free_path(path); in process_all_extents()
5433 static int compare_refs(struct send_ctx *sctx, struct btrfs_path *path, in compare_refs() argument
5453 leaf = path->nodes[0]; in compare_refs()
5454 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in compare_refs()
5455 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in compare_refs()
5538 struct btrfs_path *path; in full_send_tree() local
5542 path = alloc_path_for_send(); in full_send_tree()
5543 if (!path) in full_send_tree()
5550 ret = btrfs_search_slot_for_read(send_root, &key, path, 1, 0); in full_send_tree()
5557 eb = path->nodes[0]; in full_send_tree()
5558 slot = path->slots[0]; in full_send_tree()
5561 ret = changed_cb(send_root, NULL, path, NULL, in full_send_tree()
5570 ret = btrfs_next_item(send_root, path); in full_send_tree()
5583 btrfs_free_path(path); in full_send_tree()