mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-18 12:52:45 +08:00
fall back to other file copy methods in clonefile
This commit is contained in:
parent
8bd09628ef
commit
2a075ead92
|
@ -37,22 +37,23 @@ copydata(const int src_fd_,
|
|||
{
|
||||
int rv;
|
||||
|
||||
rv = fs::ftruncate(dst_fd_,count_);
|
||||
if(rv == -1)
|
||||
return -1;
|
||||
|
||||
rv = fs::ficlone(src_fd_,dst_fd_);
|
||||
if(rv != -1)
|
||||
return rv;
|
||||
|
||||
fs::fadvise_willneed(src_fd_,0,count_);
|
||||
fs::fadvise_sequential(src_fd_,0,count_);
|
||||
|
||||
fs::fallocate(dst_fd_,0,0,count_);
|
||||
fs::ftruncate(dst_fd_,count_);
|
||||
|
||||
rv = fs::ficlone(src_fd_,dst_fd_);
|
||||
if((rv != -1) || ((rv == -1) && (errno != EOPNOTSUPP)))
|
||||
return rv;
|
||||
|
||||
rv = fs::copy_file_range(src_fd_,dst_fd_,count_);
|
||||
if((rv != -1) || ((rv == -1) && (errno != EOPNOTSUPP)))
|
||||
if(rv != -1)
|
||||
return rv;
|
||||
|
||||
rv = fs::sendfile(src_fd_,dst_fd_,count_);
|
||||
if((rv != -1) || ((rv == -1) && (errno != EINVAL) && (errno != ENOSYS)))
|
||||
if(rv != -1)
|
||||
return rv;
|
||||
|
||||
return fs::copyfile(src_fd_,dst_fd_);
|
||||
|
|
Loading…
Reference in New Issue
Block a user