Merge pull request #27440 from yuwata/reflink-follow-ups

copy: follow ups for reflink()
This commit is contained in:
Luca Boccassi 2023-04-28 11:34:41 +01:00 committed by GitHub
commit 91010bd6cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -6,15 +6,15 @@
#define RENAME_NOREPLACE (1 << 0)
#endif
#ifndef BLKGETDISKSEQ
#ifndef BLKGETDISKSEQ /* 7957d93bf32bc211415827e44fdd9cdf1388df59 (5.15) */
#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
#endif
#ifndef FICLONE
#ifndef FICLONE /* 04b38d601239b4d9be641b412cf4b7456a041c67 (4.5) */
#define FICLONE _IOW(0x94, 9, int)
#endif
#ifndef FICLONERANGE
#ifndef FICLONERANGE /* 04b38d601239b4d9be641b412cf4b7456a041c67 (4.5) */
#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
#endif

View file

@ -69,7 +69,7 @@ static int copy_cluster(
ssize_t l;
int r;
r = reflink_full(sfd, soffset, dfd, doffset, cluster_size);
r = reflink_range(sfd, soffset, dfd, doffset, cluster_size);
if (r >= 0)
return r;

View file

@ -203,7 +203,7 @@ int copy_bytes_full(
if (foffset == 0 && toffset == 0 && max_bytes == UINT64_MAX)
r = reflink(fdf, fdt); /* full file reflink */
else
r = reflink_full(fdf, foffset, fdt, toffset, max_bytes == UINT64_MAX ? 0 : max_bytes); /* partial reflink */
r = reflink_range(fdf, foffset, fdt, toffset, max_bytes == UINT64_MAX ? 0 : max_bytes); /* partial reflink */
if (r >= 0) {
off_t t;
@ -1621,7 +1621,7 @@ int reflink(int infd, int outfd) {
assert_cc(sizeof(struct file_clone_range) == sizeof(struct btrfs_ioctl_clone_range_args));
int reflink_full(int infd, uint64_t in_offset, int outfd, uint64_t out_offset, uint64_t sz) {
int reflink_range(int infd, uint64_t in_offset, int outfd, uint64_t out_offset, uint64_t sz) {
struct file_clone_range args = {
.src_fd = infd,
.src_offset = in_offset,

View file

@ -106,4 +106,4 @@ static inline int copy_rights(int fdf, int fdt) {
int copy_xattr(int df, const char *from, int dt, const char *to, CopyFlags copy_flags);
int reflink(int infd, int outfd);
int reflink_full(int infd, uint64_t in_offset, int outfd, uint64_t out_offset, uint64_t sz);
int reflink_range(int infd, uint64_t in_offset, int outfd, uint64_t out_offset, uint64_t sz);