Lines Matching refs:clone_root
70 struct clone_root { struct
99 struct clone_root *clone_roots;
1246 const struct clone_root *cr = elt; in __clone_root_cmp_bsearch()
1257 const struct clone_root *cr1 = e1; in __clone_root_cmp_sort()
1258 const struct clone_root *cr2 = e2; in __clone_root_cmp_sort()
1274 struct clone_root *found; in __iterate_backrefs()
1279 sizeof(struct clone_root), in __iterate_backrefs()
1343 struct clone_root **found) in find_extent_clone()
1356 struct clone_root *cur_clone_root; in find_extent_clone()
5119 struct clone_root *clone_root) in send_clone() argument
5127 offset, len, clone_root->root->root_key.objectid, in send_clone()
5128 clone_root->ino, clone_root->offset); in send_clone()
5146 if (clone_root->root == sctx->send_root) { in send_clone()
5147 ret = get_inode_gen(sctx->send_root, clone_root->ino, &gen); in send_clone()
5150 ret = get_cur_path(sctx, clone_root->ino, gen, p); in send_clone()
5152 ret = get_inode_path(clone_root->root, clone_root->ino, p); in send_clone()
5166 if (!btrfs_is_empty_uuid(clone_root->root->root_item.received_uuid)) in send_clone()
5168 clone_root->root->root_item.received_uuid); in send_clone()
5171 clone_root->root->root_item.uuid); in send_clone()
5173 btrfs_root_ctransid(&clone_root->root->root_item)); in send_clone()
5176 clone_root->offset); in send_clone()
5620 struct clone_root *clone_root, const u64 disk_byte, in clone_range() argument
5644 if (clone_root->offset == 0 && in clone_range()
5656 ret = get_inode_info(clone_root->root, clone_root->ino, &info); in clone_range()
5684 key.objectid = clone_root->ino; in clone_range()
5686 key.offset = clone_root->offset; in clone_range()
5687 ret = btrfs_search_slot(NULL, clone_root->root, &key, path, 0, 0); in clone_range()
5692 if (key.objectid == clone_root->ino && in clone_range()
5708 ret = btrfs_next_leaf(clone_root->root, path); in clone_range()
5722 if (key.objectid != clone_root->ino || in clone_range()
5735 if (key.offset + ext_len <= clone_root->offset) in clone_range()
5738 if (key.offset > clone_root->offset) { in clone_range()
5740 u64 hole_len = key.offset - clone_root->offset; in clone_range()
5753 clone_root->offset += hole_len; in clone_range()
5757 if (key.offset >= clone_root->offset + len) in clone_range()
5770 clone_root->offset = key.offset; in clone_range()
5778 clone_root->offset += extent_offset; in clone_range()
5786 const u64 src_end = clone_root->offset + clone_len; in clone_range()
5812 slen = ALIGN_DOWN(src_end - clone_root->offset, in clone_range()
5816 clone_root); in clone_range()
5825 clone_root); in clone_range()
5858 clone_root->offset += clone_len; in clone_range()
5869 if (clone_root->root == sctx->send_root && in clone_range()
5870 clone_root->ino == sctx->cur_ino && in clone_range()
5871 clone_root->offset >= sctx->cur_inode_next_write_offset) in clone_range()
5891 struct clone_root *clone_root) in send_write_or_clone() argument
5902 if (clone_root && IS_ALIGNED(end, bs)) { in send_write_or_clone()
5911 ret = clone_range(sctx, path, clone_root, disk_byte, in send_write_or_clone()
6253 struct clone_root *found_clone = NULL; in process_extent()
7806 struct btrfs_root *clone_root; in btrfs_ioctl_send() local
7845 ULONG_MAX / sizeof(struct clone_root) - 1) { in btrfs_ioctl_send()
7963 clone_root = btrfs_get_fs_root(fs_info, in btrfs_ioctl_send()
7965 if (IS_ERR(clone_root)) { in btrfs_ioctl_send()
7966 ret = PTR_ERR(clone_root); in btrfs_ioctl_send()
7969 spin_lock(&clone_root->root_item_lock); in btrfs_ioctl_send()
7970 if (!btrfs_root_readonly(clone_root) || in btrfs_ioctl_send()
7971 btrfs_root_dead(clone_root)) { in btrfs_ioctl_send()
7972 spin_unlock(&clone_root->root_item_lock); in btrfs_ioctl_send()
7973 btrfs_put_root(clone_root); in btrfs_ioctl_send()
7977 if (clone_root->dedupe_in_progress) { in btrfs_ioctl_send()
7978 dedupe_in_progress_warn(clone_root); in btrfs_ioctl_send()
7979 spin_unlock(&clone_root->root_item_lock); in btrfs_ioctl_send()
7980 btrfs_put_root(clone_root); in btrfs_ioctl_send()
7984 clone_root->send_in_progress++; in btrfs_ioctl_send()
7985 spin_unlock(&clone_root->root_item_lock); in btrfs_ioctl_send()
7987 sctx->clone_roots[i].root = clone_root; in btrfs_ioctl_send()