diff options
Diffstat (limited to 'include/fuse.h')
-rw-r--r-- | include/fuse.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/fuse.h b/include/fuse.h index 24e04bc..d3644ad 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -750,6 +750,23 @@ struct fuse_operations { */ int (*fallocate) (const char *, int, off_t, off_t, struct fuse_file_info *); + + /** + * Copy a range of data from one file to another + * + * Performs an optimized copy between two file descriptors without the + * additional cost of transferring data through the FUSE kernel module + * to user space (glibc) and then back into the FUSE filesystem again. + * + * In case this method is not implemented, glibc falls back to reading + * data from the source and writing to the destination. Effectively + * doing an inefficient copy of the data. + */ + ssize_t (*copy_file_range) (const char *path_in, + struct fuse_file_info *fi_in, + off_t offset_in, const char *path_out, + struct fuse_file_info *fi_out, + off_t offset_out, size_t size, int flags); }; /** Extra context that may be needed by some filesystems @@ -1165,6 +1182,11 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path, unsigned *reventsp); int fuse_fs_fallocate(struct fuse_fs *fs, const char *path, int mode, off_t offset, off_t length, struct fuse_file_info *fi); +ssize_t fuse_fs_copy_file_range(struct fuse_fs *fs, const char *path_in, + struct fuse_file_info *fi_in, off_t off_in, + const char *path_out, + struct fuse_file_info *fi_out, off_t off_out, + size_t len, int flags); void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn, struct fuse_config *cfg); void fuse_fs_destroy(struct fuse_fs *fs); |