History

fuse: add support for copy_file_range()

There are several FUSE filesystems that can implement server-side copy or other efficient copy/duplication/clone methods. The copy_file_range() syscall is the standard interface that users have access to while not depending on external libraries that bypass FUSE.

Niels de Vos committed 8 years ago

Commit 88bc7d51 parent 908a5723 files · +140 −46Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/fuse.h+60−46
@@ -116,6 +116,9 @@ · 115 unmodified lines
116116 *
117117 * 7.27
118118 * - add FUSE_ABORT_ERROR
119+ *
120+ * 7.28
121+ * - add FUSE_COPY_FILE_RANGE
119122 */
120123
121124 #ifndef _LINUX_FUSE_H
@@ -151,7 +154,7 @@ · 29 unmodified lines
151154 #define FUSE_KERNEL_VERSION 7
152155
153156 /** Minor version number of this interface */
154−#define FUSE_KERNEL_MINOR_VERSION 27
157+#define FUSE_KERNEL_MINOR_VERSION 28
155158
156159 /** The node ID of the root inode */
157160 #define FUSE_ROOT_ID 1
@@ -337,53 +340,54 @@ struct fuse_file_lock { · 179 unmodified lines
337340 #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
338341
339342 enum fuse_opcode {
340− FUSE_LOOKUP = 1,
341− FUSE_FORGET = 2, /* no reply */
342− FUSE_GETATTR = 3,
343− FUSE_SETATTR = 4,
344− FUSE_READLINK = 5,
345− FUSE_SYMLINK = 6,
346− FUSE_MKNOD = 8,
347− FUSE_MKDIR = 9,
348− FUSE_UNLINK = 10,
349− FUSE_RMDIR = 11,
350− FUSE_RENAME = 12,
351− FUSE_LINK = 13,
352− FUSE_OPEN = 14,
353− FUSE_READ = 15,
354− FUSE_WRITE = 16,
355− FUSE_STATFS = 17,
356− FUSE_RELEASE = 18,
357− FUSE_FSYNC = 20,
358− FUSE_SETXATTR = 21,
359− FUSE_GETXATTR = 22,
360− FUSE_LISTXATTR = 23,
361− FUSE_REMOVEXATTR = 24,
362− FUSE_FLUSH = 25,
363− FUSE_INIT = 26,
364− FUSE_OPENDIR = 27,
365− FUSE_READDIR = 28,
366− FUSE_RELEASEDIR = 29,
367− FUSE_FSYNCDIR = 30,
368− FUSE_GETLK = 31,
369− FUSE_SETLK = 32,
370− FUSE_SETLKW = 33,
371− FUSE_ACCESS = 34,
372− FUSE_CREATE = 35,
373− FUSE_INTERRUPT = 36,
374− FUSE_BMAP = 37,
375− FUSE_DESTROY = 38,
376− FUSE_IOCTL = 39,
377− FUSE_POLL = 40,
378− FUSE_NOTIFY_REPLY = 41,
379− FUSE_BATCH_FORGET = 42,
380− FUSE_FALLOCATE = 43,
381− FUSE_READDIRPLUS = 44,
382− FUSE_RENAME2 = 45,
383− FUSE_LSEEK = 46,
343+ FUSE_LOOKUP = 1,
344+ FUSE_FORGET = 2, /* no reply */
345+ FUSE_GETATTR = 3,
346+ FUSE_SETATTR = 4,
347+ FUSE_READLINK = 5,
348+ FUSE_SYMLINK = 6,
349+ FUSE_MKNOD = 8,
350+ FUSE_MKDIR = 9,
351+ FUSE_UNLINK = 10,
352+ FUSE_RMDIR = 11,
353+ FUSE_RENAME = 12,
354+ FUSE_LINK = 13,
355+ FUSE_OPEN = 14,
356+ FUSE_READ = 15,
357+ FUSE_WRITE = 16,
358+ FUSE_STATFS = 17,
359+ FUSE_RELEASE = 18,
360+ FUSE_FSYNC = 20,
361+ FUSE_SETXATTR = 21,
362+ FUSE_GETXATTR = 22,
363+ FUSE_LISTXATTR = 23,
364+ FUSE_REMOVEXATTR = 24,
365+ FUSE_FLUSH = 25,
366+ FUSE_INIT = 26,
367+ FUSE_OPENDIR = 27,
368+ FUSE_READDIR = 28,
369+ FUSE_RELEASEDIR = 29,
370+ FUSE_FSYNCDIR = 30,
371+ FUSE_GETLK = 31,
372+ FUSE_SETLK = 32,
373+ FUSE_SETLKW = 33,
374+ FUSE_ACCESS = 34,
375+ FUSE_CREATE = 35,
376+ FUSE_INTERRUPT = 36,
377+ FUSE_BMAP = 37,
378+ FUSE_DESTROY = 38,
379+ FUSE_IOCTL = 39,
380+ FUSE_POLL = 40,
381+ FUSE_NOTIFY_REPLY = 41,
382+ FUSE_BATCH_FORGET = 42,
383+ FUSE_FALLOCATE = 43,
384+ FUSE_READDIRPLUS = 44,
385+ FUSE_RENAME2 = 45,
386+ FUSE_LSEEK = 46,
387+ FUSE_COPY_FILE_RANGE = 47,
384388
385389 /* CUSE specific operations */
386− CUSE_INIT = 4096,
390+ CUSE_INIT = 4096,
387391 };
388392
389393 enum fuse_notify_code {
@@ -792,4 +796,14 @@ struct fuse_lseek_out { · 402 unmodified lines
792796 uint64_t offset;
793797 };
794798
799+struct fuse_copy_file_range_in {
800+ uint64_t fh_in;
801+ uint64_t off_in;
802+ uint64_t nodeid_out;
803+ uint64_t fh_out;
804+ uint64_t off_out;
805+ uint64_t len;
806+ uint64_t flags;
807+};
808+
795809 #endif /* _LINUX_FUSE_H */