aboutsummaryrefslogtreecommitdiffstats
path: root/ioctl.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-06-03 16:42:51 +0200
committerDavid Sterba <dsterba@suse.cz>2015-06-03 19:33:43 +0200
commit5adf7070280aca29b617d10f4ab90803badae03e (patch)
tree9ec201e925211a3aba13174fe125a113badc510d /ioctl.h
parent493f979c1556fa12656985557983fec4364197ff (diff)
downloadbtrfs-progs-5adf7070280aca29b617d10f4ab90803badae03e.tar.gz
btrfs-progs-5adf7070280aca29b617d10f4ab90803badae03e.tar.xz
btrfs-progs-5adf7070280aca29b617d10f4ab90803badae03e.zip
btrfs-progs: ioctl.h: add EXTENT_SAME ioctl and structures
Copied from uapi/linux/btrfs.h. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'ioctl.h')
-rw-r--r--ioctl.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/ioctl.h b/ioctl.h
index df7933e..9ef833c 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -328,6 +328,31 @@ struct btrfs_ioctl_clone_range_args {
#define BTRFS_DEFRAG_RANGE_COMPRESS 1
#define BTRFS_DEFRAG_RANGE_START_IO 2
+#define BTRFS_SAME_DATA_DIFFERS 1
+/* For extent-same ioctl */
+struct btrfs_ioctl_same_extent_info {
+ __s64 fd; /* in - destination file */
+ __u64 logical_offset; /* in - start of extent in destination */
+ __u64 bytes_deduped; /* out - total # of bytes we were able
+ * to dedupe from this file */
+ /* status of this dedupe operation:
+ * 0 if dedup succeeds
+ * < 0 for error
+ * == BTRFS_SAME_DATA_DIFFERS if data differs
+ */
+ __s32 status; /* out - see above description */
+ __u32 reserved;
+};
+
+struct btrfs_ioctl_same_args {
+ __u64 logical_offset; /* in - start of extent in source */
+ __u64 length; /* in - length of extent */
+ __u16 dest_count; /* in - total elements in info array */
+ __u16 reserved1;
+ __u32 reserved2;
+ struct btrfs_ioctl_same_extent_info info[0];
+};
+
struct btrfs_ioctl_defrag_range_args {
/* start of the defrag operation */
__u64 start;
@@ -633,6 +658,8 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
struct btrfs_ioctl_get_dev_stats)
#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
struct btrfs_ioctl_dev_replace_args)
+#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
+ struct btrfs_ioctl_same_args)
#define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
struct btrfs_ioctl_feature_flags)
#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \