aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ioctl.h')
-rw-r--r--fs/btrfs/ioctl.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h
index f1923e0260e3..2d64a65842f3 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -99,6 +99,35 @@ struct btrfs_ioctl_clone_range_args {
99 __u64 dest_offset; 99 __u64 dest_offset;
100}; 100};
101 101
102/* flags for the defrag range ioctl */
103#define BTRFS_DEFRAG_RANGE_COMPRESS 1
104#define BTRFS_DEFRAG_RANGE_START_IO 2
105
106struct btrfs_ioctl_defrag_range_args {
107 /* start of the defrag operation */
108 __u64 start;
109
110 /* number of bytes to defrag, use (u64)-1 to say all */
111 __u64 len;
112
113 /*
114 * flags for the operation, which can include turning
115 * on compression for this one defrag
116 */
117 __u64 flags;
118
119 /*
120 * any extent bigger than this will be considered
121 * already defragged. Use 0 to take the kernel default
122 * Use 1 to say every single extent must be rewritten
123 */
124 __u32 extent_thresh;
125
126 /* spare for later */
127 __u32 unused[5];
128};
129
130
102#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ 131#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
103 struct btrfs_ioctl_vol_args) 132 struct btrfs_ioctl_vol_args)
104#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ 133#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -130,6 +159,8 @@ struct btrfs_ioctl_clone_range_args {
130 struct btrfs_ioctl_vol_args) 159 struct btrfs_ioctl_vol_args)
131#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \ 160#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \
132 struct btrfs_ioctl_vol_args) 161 struct btrfs_ioctl_vol_args)
162#define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, \
163 struct btrfs_ioctl_defrag_range_args)
133#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \ 164#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
134 struct btrfs_ioctl_search_args) 165 struct btrfs_ioctl_search_args)
135#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \ 166#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \