copy: Introduce reflink() and reflink_full()

The kernel has had filesystem independent reflink ioctls for a
while now, let's try to use them and fall back to the btrfs specific
ones if they're not supported.
This commit is contained in:
Daan De Meyer
2023-04-28 00:57:03 +01:00
committed by Luca Boccassi
parent fafded0ce0
commit b640e274a7
8 changed files with 66 additions and 43 deletions
+8
View File
@@ -10,6 +10,14 @@
#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
#endif
#ifndef FICLONE
#define FICLONE _IOW(0x94, 9, int)
#endif
#ifndef FICLONERANGE
#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
#endif
/* linux/fs.h or sys/mount.h */
#ifndef MS_MOVE
#define MS_MOVE 8192