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
116 *116 *
117 * 7.27117 * 7.27
118 * - add FUSE_ABORT_ERROR118 * - add FUSE_ABORT_ERROR
119 *
120 * 7.28
121 * - add FUSE_COPY_FILE_RANGE
119 */122 */
120 123
121#ifndef _LINUX_FUSE_H124#ifndef _LINUX_FUSE_H
@@ -151,7 +154,7 @@ · 29 unmodified lines
151#define FUSE_KERNEL_VERSION 7154#define FUSE_KERNEL_VERSION 7
152 155
153/** Minor version number of this interface */156/** Minor version number of this interface */
154#define FUSE_KERNEL_MINOR_VERSION 27157#define FUSE_KERNEL_MINOR_VERSION 28
155 158
156/** The node ID of the root inode */159/** The node ID of the root inode */
157#define FUSE_ROOT_ID 1160#define FUSE_ROOT_ID 1
@@ -337,53 +340,54 @@ struct fuse_file_lock { · 179 unmodified lines
337#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)340#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
338 341
339enum fuse_opcode {342enum fuse_opcode {
340 FUSE_LOOKUP = 1,343 FUSE_LOOKUP = 1,
341 FUSE_FORGET = 2, /* no reply */344 FUSE_FORGET = 2, /* no reply */
342 FUSE_GETATTR = 3,345 FUSE_GETATTR = 3,
343 FUSE_SETATTR = 4,346 FUSE_SETATTR = 4,
344 FUSE_READLINK = 5,347 FUSE_READLINK = 5,
345 FUSE_SYMLINK = 6,348 FUSE_SYMLINK = 6,
346 FUSE_MKNOD = 8,349 FUSE_MKNOD = 8,
347 FUSE_MKDIR = 9,350 FUSE_MKDIR = 9,
348 FUSE_UNLINK = 10,351 FUSE_UNLINK = 10,
349 FUSE_RMDIR = 11,352 FUSE_RMDIR = 11,
350 FUSE_RENAME = 12,353 FUSE_RENAME = 12,
351 FUSE_LINK = 13,354 FUSE_LINK = 13,
352 FUSE_OPEN = 14,355 FUSE_OPEN = 14,
353 FUSE_READ = 15,356 FUSE_READ = 15,
354 FUSE_WRITE = 16,357 FUSE_WRITE = 16,
355 FUSE_STATFS = 17,358 FUSE_STATFS = 17,
356 FUSE_RELEASE = 18,359 FUSE_RELEASE = 18,
357 FUSE_FSYNC = 20,360 FUSE_FSYNC = 20,
358 FUSE_SETXATTR = 21,361 FUSE_SETXATTR = 21,
359 FUSE_GETXATTR = 22,362 FUSE_GETXATTR = 22,
360 FUSE_LISTXATTR = 23,363 FUSE_LISTXATTR = 23,
361 FUSE_REMOVEXATTR = 24,364 FUSE_REMOVEXATTR = 24,
362 FUSE_FLUSH = 25,365 FUSE_FLUSH = 25,
363 FUSE_INIT = 26,366 FUSE_INIT = 26,
364 FUSE_OPENDIR = 27,367 FUSE_OPENDIR = 27,
365 FUSE_READDIR = 28,368 FUSE_READDIR = 28,
366 FUSE_RELEASEDIR = 29,369 FUSE_RELEASEDIR = 29,
367 FUSE_FSYNCDIR = 30,370 FUSE_FSYNCDIR = 30,
368 FUSE_GETLK = 31,371 FUSE_GETLK = 31,
369 FUSE_SETLK = 32,372 FUSE_SETLK = 32,
370 FUSE_SETLKW = 33,373 FUSE_SETLKW = 33,
371 FUSE_ACCESS = 34,374 FUSE_ACCESS = 34,
372 FUSE_CREATE = 35,375 FUSE_CREATE = 35,
373 FUSE_INTERRUPT = 36,376 FUSE_INTERRUPT = 36,
374 FUSE_BMAP = 37,377 FUSE_BMAP = 37,
375 FUSE_DESTROY = 38,378 FUSE_DESTROY = 38,
376 FUSE_IOCTL = 39,379 FUSE_IOCTL = 39,
377 FUSE_POLL = 40,380 FUSE_POLL = 40,
378 FUSE_NOTIFY_REPLY = 41,381 FUSE_NOTIFY_REPLY = 41,
379 FUSE_BATCH_FORGET = 42,382 FUSE_BATCH_FORGET = 42,
380 FUSE_FALLOCATE = 43,383 FUSE_FALLOCATE = 43,
381 FUSE_READDIRPLUS = 44,384 FUSE_READDIRPLUS = 44,
382 FUSE_RENAME2 = 45,385 FUSE_RENAME2 = 45,
383 FUSE_LSEEK = 46,386 FUSE_LSEEK = 46,
387 FUSE_COPY_FILE_RANGE = 47,
384 388
385 /* CUSE specific operations */389 /* CUSE specific operations */
386 CUSE_INIT = 4096,390 CUSE_INIT = 4096,
387};391};
388 392
389enum fuse_notify_code {393enum fuse_notify_code {
@@ -792,4 +796,14 @@ struct fuse_lseek_out { · 402 unmodified lines
792 uint64_t offset;796 uint64_t offset;
793};797};
794 798
799struct 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
795#endif /* _LINUX_FUSE_H */809#endif /* _LINUX_FUSE_H */