summaryrefslogtreecommitdiff
path: root/netfs/fuse/fuseFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/fuse/fuseFiles.cpp')
-rw-r--r--netfs/fuse/fuseFiles.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp
index c166e46..48b3f87 100644
--- a/netfs/fuse/fuseFiles.cpp
+++ b/netfs/fuse/fuseFiles.cpp
@@ -204,6 +204,23 @@ FuseApp::write(const char *, const char * buf, size_t s, off_t o, struct fuse_fi
}
}
+ssize_t
+FuseApp::copy_file_range(const char *, struct fuse_file_info *fi_in, off_t offset_in, const char *, struct fuse_file_info *fi_out, off_t offset_out, size_t size, int flags)
+{
+ try {
+ auto of_in = getProxy<OpenFilePtr>(fi_in->fh);
+ auto of_out = getProxy<OpenFilePtr>(fi_out->fh);
+ auto remote_in = of_in->remote;
+ auto remote_out = of_out->remote;
+ of_in->wait();
+ of_out->wait();
+ return remote_in->copyrange(remote_out, offset_in, offset_out, size, flags);
+ }
+ catch (SystemError & e) {
+ return -e.syserrno;
+ }
+}
+
int
FuseApp::truncate(const char * p, off_t o, fuse_file_info * fi)
{