1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_LINUX_BTRFS_H
20 #define _UAPI_LINUX_BTRFS_H
21 #include <linux/types.h>
22 #include <linux/ioctl.h>
23 #define BTRFS_IOCTL_MAGIC 0x94
24 #define BTRFS_VOL_NAME_MAX 255
25 #define BTRFS_LABEL_SIZE 256
26 #define BTRFS_PATH_NAME_MAX 4087
27 struct btrfs_ioctl_vol_args {
28   __s64 fd;
29   char name[BTRFS_PATH_NAME_MAX + 1];
30 };
31 #define BTRFS_DEVICE_PATH_NAME_MAX 1024
32 #define BTRFS_SUBVOL_NAME_MAX 4039
33 #define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
34 #define BTRFS_SUBVOL_RDONLY (1ULL << 1)
35 #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
36 #define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
37 #define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
38 #define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED (BTRFS_SUBVOL_RDONLY | BTRFS_SUBVOL_QGROUP_INHERIT | BTRFS_DEVICE_SPEC_BY_ID | BTRFS_SUBVOL_SPEC_BY_ID)
39 #define BTRFS_FSID_SIZE 16
40 #define BTRFS_UUID_SIZE 16
41 #define BTRFS_UUID_UNPARSED_SIZE 37
42 #define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0)
43 #define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1)
44 #define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2)
45 #define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3)
46 #define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4)
47 #define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5)
48 struct btrfs_qgroup_limit {
49   __u64 flags;
50   __u64 max_rfer;
51   __u64 max_excl;
52   __u64 rsv_rfer;
53   __u64 rsv_excl;
54 };
55 #define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
56 struct btrfs_qgroup_inherit {
57   __u64 flags;
58   __u64 num_qgroups;
59   __u64 num_ref_copies;
60   __u64 num_excl_copies;
61   struct btrfs_qgroup_limit lim;
62   __u64 qgroups[0];
63 };
64 struct btrfs_ioctl_qgroup_limit_args {
65   __u64 qgroupid;
66   struct btrfs_qgroup_limit lim;
67 };
68 #define BTRFS_DEVICE_REMOVE_ARGS_MASK (BTRFS_DEVICE_SPEC_BY_ID)
69 #define BTRFS_SUBVOL_CREATE_ARGS_MASK (BTRFS_SUBVOL_RDONLY | BTRFS_SUBVOL_QGROUP_INHERIT)
70 #define BTRFS_SUBVOL_DELETE_ARGS_MASK (BTRFS_SUBVOL_SPEC_BY_ID)
71 struct btrfs_ioctl_vol_args_v2 {
72   __s64 fd;
73   __u64 transid;
74   __u64 flags;
75   union {
76     struct {
77       __u64 size;
78       struct btrfs_qgroup_inherit __user * qgroup_inherit;
79     };
80     __u64 unused[4];
81   };
82   union {
83     char name[BTRFS_SUBVOL_NAME_MAX + 1];
84     __u64 devid;
85     __u64 subvolid;
86   };
87 };
88 struct btrfs_scrub_progress {
89   __u64 data_extents_scrubbed;
90   __u64 tree_extents_scrubbed;
91   __u64 data_bytes_scrubbed;
92   __u64 tree_bytes_scrubbed;
93   __u64 read_errors;
94   __u64 csum_errors;
95   __u64 verify_errors;
96   __u64 no_csum;
97   __u64 csum_discards;
98   __u64 super_errors;
99   __u64 malloc_errors;
100   __u64 uncorrectable_errors;
101   __u64 corrected_errors;
102   __u64 last_physical;
103   __u64 unverified_errors;
104 };
105 #define BTRFS_SCRUB_READONLY 1
106 struct btrfs_ioctl_scrub_args {
107   __u64 devid;
108   __u64 start;
109   __u64 end;
110   __u64 flags;
111   struct btrfs_scrub_progress progress;
112   __u64 unused[(1024 - 32 - sizeof(struct btrfs_scrub_progress)) / 8];
113 };
114 #define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
115 #define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
116 struct btrfs_ioctl_dev_replace_start_params {
117   __u64 srcdevid;
118   __u64 cont_reading_from_srcdev_mode;
119   __u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
120   __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
121 };
122 #define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
123 #define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
124 #define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
125 #define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
126 #define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
127 struct btrfs_ioctl_dev_replace_status_params {
128   __u64 replace_state;
129   __u64 progress_1000;
130   __u64 time_started;
131   __u64 time_stopped;
132   __u64 num_write_errors;
133   __u64 num_uncorrectable_read_errors;
134 };
135 #define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
136 #define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
137 #define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
138 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
139 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
140 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
141 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS 3
142 struct btrfs_ioctl_dev_replace_args {
143   __u64 cmd;
144   __u64 result;
145   union {
146     struct btrfs_ioctl_dev_replace_start_params start;
147     struct btrfs_ioctl_dev_replace_status_params status;
148   };
149   __u64 spare[64];
150 };
151 struct btrfs_ioctl_dev_info_args {
152   __u64 devid;
153   __u8 uuid[BTRFS_UUID_SIZE];
154   __u64 bytes_used;
155   __u64 total_bytes;
156   __u64 unused[379];
157   __u8 path[BTRFS_DEVICE_PATH_NAME_MAX];
158 };
159 struct btrfs_ioctl_fs_info_args {
160   __u64 max_id;
161   __u64 num_devices;
162   __u8 fsid[BTRFS_FSID_SIZE];
163   __u32 nodesize;
164   __u32 sectorsize;
165   __u32 clone_alignment;
166   __u32 reserved32;
167   __u64 reserved[122];
168 };
169 #define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0)
170 #define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
171 #define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
172 #define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
173 #define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
174 #define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3)
175 #define BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD (1ULL << 4)
176 #define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5)
177 #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6)
178 #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
179 #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
180 #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
181 #define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
182 #define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
183 struct btrfs_ioctl_feature_flags {
184   __u64 compat_flags;
185   __u64 compat_ro_flags;
186   __u64 incompat_flags;
187 };
188 #define BTRFS_BALANCE_CTL_PAUSE 1
189 #define BTRFS_BALANCE_CTL_CANCEL 2
190 struct btrfs_balance_args {
191   __u64 profiles;
192   union {
193     __u64 usage;
194     struct {
195       __u32 usage_min;
196       __u32 usage_max;
197     };
198   };
199   __u64 devid;
200   __u64 pstart;
201   __u64 pend;
202   __u64 vstart;
203   __u64 vend;
204   __u64 target;
205   __u64 flags;
206   union {
207     __u64 limit;
208     struct {
209       __u32 limit_min;
210       __u32 limit_max;
211     };
212   };
213   __u32 stripes_min;
214   __u32 stripes_max;
215   __u64 unused[6];
216 } __attribute__((__packed__));
217 struct btrfs_balance_progress {
218   __u64 expected;
219   __u64 considered;
220   __u64 completed;
221 };
222 #define BTRFS_BALANCE_DATA (1ULL << 0)
223 #define BTRFS_BALANCE_SYSTEM (1ULL << 1)
224 #define BTRFS_BALANCE_METADATA (1ULL << 2)
225 #define BTRFS_BALANCE_TYPE_MASK (BTRFS_BALANCE_DATA | BTRFS_BALANCE_SYSTEM | BTRFS_BALANCE_METADATA)
226 #define BTRFS_BALANCE_FORCE (1ULL << 3)
227 #define BTRFS_BALANCE_RESUME (1ULL << 4)
228 #define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
229 #define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
230 #define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
231 #define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
232 #define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
233 #define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
234 #define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
235 #define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
236 #define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
237 #define BTRFS_BALANCE_ARGS_MASK (BTRFS_BALANCE_ARGS_PROFILES | BTRFS_BALANCE_ARGS_USAGE | BTRFS_BALANCE_ARGS_DEVID | BTRFS_BALANCE_ARGS_DRANGE | BTRFS_BALANCE_ARGS_VRANGE | BTRFS_BALANCE_ARGS_LIMIT | BTRFS_BALANCE_ARGS_LIMIT_RANGE | BTRFS_BALANCE_ARGS_STRIPES_RANGE | BTRFS_BALANCE_ARGS_USAGE_RANGE)
238 #define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
239 #define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
240 #define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
241 #define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
242 #define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
243 struct btrfs_ioctl_balance_args {
244   __u64 flags;
245   __u64 state;
246   struct btrfs_balance_args data;
247   struct btrfs_balance_args meta;
248   struct btrfs_balance_args sys;
249   struct btrfs_balance_progress stat;
250   __u64 unused[72];
251 };
252 #define BTRFS_INO_LOOKUP_PATH_MAX 4080
253 struct btrfs_ioctl_ino_lookup_args {
254   __u64 treeid;
255   __u64 objectid;
256   char name[BTRFS_INO_LOOKUP_PATH_MAX];
257 };
258 #define BTRFS_INO_LOOKUP_USER_PATH_MAX (4080 - BTRFS_VOL_NAME_MAX - 1)
259 struct btrfs_ioctl_ino_lookup_user_args {
260   __u64 dirid;
261   __u64 treeid;
262   char name[BTRFS_VOL_NAME_MAX + 1];
263   char path[BTRFS_INO_LOOKUP_USER_PATH_MAX];
264 };
265 struct btrfs_ioctl_search_key {
266   __u64 tree_id;
267   __u64 min_objectid;
268   __u64 max_objectid;
269   __u64 min_offset;
270   __u64 max_offset;
271   __u64 min_transid;
272   __u64 max_transid;
273   __u32 min_type;
274   __u32 max_type;
275   __u32 nr_items;
276   __u32 unused;
277   __u64 unused1;
278   __u64 unused2;
279   __u64 unused3;
280   __u64 unused4;
281 };
282 struct btrfs_ioctl_search_header {
283   __u64 transid;
284   __u64 objectid;
285   __u64 offset;
286   __u32 type;
287   __u32 len;
288 };
289 #define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
290 struct btrfs_ioctl_search_args {
291   struct btrfs_ioctl_search_key key;
292   char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
293 };
294 struct btrfs_ioctl_search_args_v2 {
295   struct btrfs_ioctl_search_key key;
296   __u64 buf_size;
297   __u64 buf[0];
298 };
299 struct btrfs_ioctl_clone_range_args {
300   __s64 src_fd;
301   __u64 src_offset, src_length;
302   __u64 dest_offset;
303 };
304 #define BTRFS_DEFRAG_RANGE_COMPRESS 1
305 #define BTRFS_DEFRAG_RANGE_START_IO 2
306 struct btrfs_ioctl_defrag_range_args {
307   __u64 start;
308   __u64 len;
309   __u64 flags;
310   __u32 extent_thresh;
311   __u32 compress_type;
312   __u32 unused[4];
313 };
314 #define BTRFS_SAME_DATA_DIFFERS 1
315 struct btrfs_ioctl_same_extent_info {
316   __s64 fd;
317   __u64 logical_offset;
318   __u64 bytes_deduped;
319   __s32 status;
320   __u32 reserved;
321 };
322 struct btrfs_ioctl_same_args {
323   __u64 logical_offset;
324   __u64 length;
325   __u16 dest_count;
326   __u16 reserved1;
327   __u32 reserved2;
328   struct btrfs_ioctl_same_extent_info info[0];
329 };
330 struct btrfs_ioctl_space_info {
331   __u64 flags;
332   __u64 total_bytes;
333   __u64 used_bytes;
334 };
335 struct btrfs_ioctl_space_args {
336   __u64 space_slots;
337   __u64 total_spaces;
338   struct btrfs_ioctl_space_info spaces[0];
339 };
340 struct btrfs_data_container {
341   __u32 bytes_left;
342   __u32 bytes_missing;
343   __u32 elem_cnt;
344   __u32 elem_missed;
345   __u64 val[0];
346 };
347 struct btrfs_ioctl_ino_path_args {
348   __u64 inum;
349   __u64 size;
350   __u64 reserved[4];
351   __u64 fspath;
352 };
353 struct btrfs_ioctl_logical_ino_args {
354   __u64 logical;
355   __u64 size;
356   __u64 reserved[3];
357   __u64 flags;
358   __u64 inodes;
359 };
360 #define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
361 enum btrfs_dev_stat_values {
362   BTRFS_DEV_STAT_WRITE_ERRS,
363   BTRFS_DEV_STAT_READ_ERRS,
364   BTRFS_DEV_STAT_FLUSH_ERRS,
365   BTRFS_DEV_STAT_CORRUPTION_ERRS,
366   BTRFS_DEV_STAT_GENERATION_ERRS,
367   BTRFS_DEV_STAT_VALUES_MAX
368 };
369 #define BTRFS_DEV_STATS_RESET (1ULL << 0)
370 struct btrfs_ioctl_get_dev_stats {
371   __u64 devid;
372   __u64 nr_items;
373   __u64 flags;
374   __u64 values[BTRFS_DEV_STAT_VALUES_MAX];
375   __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX];
376 };
377 #define BTRFS_QUOTA_CTL_ENABLE 1
378 #define BTRFS_QUOTA_CTL_DISABLE 2
379 #define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3
380 struct btrfs_ioctl_quota_ctl_args {
381   __u64 cmd;
382   __u64 status;
383 };
384 struct btrfs_ioctl_quota_rescan_args {
385   __u64 flags;
386   __u64 progress;
387   __u64 reserved[6];
388 };
389 struct btrfs_ioctl_qgroup_assign_args {
390   __u64 assign;
391   __u64 src;
392   __u64 dst;
393 };
394 struct btrfs_ioctl_qgroup_create_args {
395   __u64 create;
396   __u64 qgroupid;
397 };
398 struct btrfs_ioctl_timespec {
399   __u64 sec;
400   __u32 nsec;
401 };
402 struct btrfs_ioctl_received_subvol_args {
403   char uuid[BTRFS_UUID_SIZE];
404   __u64 stransid;
405   __u64 rtransid;
406   struct btrfs_ioctl_timespec stime;
407   struct btrfs_ioctl_timespec rtime;
408   __u64 flags;
409   __u64 reserved[16];
410 };
411 #define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
412 #define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2
413 #define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
414 #define BTRFS_SEND_FLAG_MASK (BTRFS_SEND_FLAG_NO_FILE_DATA | BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | BTRFS_SEND_FLAG_OMIT_END_CMD)
415 struct btrfs_ioctl_send_args {
416   __s64 send_fd;
417   __u64 clone_sources_count;
418   __u64 __user * clone_sources;
419   __u64 parent_root;
420   __u64 flags;
421   __u64 reserved[4];
422 };
423 struct btrfs_ioctl_get_subvol_info_args {
424   __u64 treeid;
425   char name[BTRFS_VOL_NAME_MAX + 1];
426   __u64 parent_id;
427   __u64 dirid;
428   __u64 generation;
429   __u64 flags;
430   __u8 uuid[BTRFS_UUID_SIZE];
431   __u8 parent_uuid[BTRFS_UUID_SIZE];
432   __u8 received_uuid[BTRFS_UUID_SIZE];
433   __u64 ctransid;
434   __u64 otransid;
435   __u64 stransid;
436   __u64 rtransid;
437   struct btrfs_ioctl_timespec ctime;
438   struct btrfs_ioctl_timespec otime;
439   struct btrfs_ioctl_timespec stime;
440   struct btrfs_ioctl_timespec rtime;
441   __u64 reserved[8];
442 };
443 #define BTRFS_MAX_ROOTREF_BUFFER_NUM 255
444 struct btrfs_ioctl_get_subvol_rootref_args {
445   __u64 min_treeid;
446   struct {
447     __u64 treeid;
448     __u64 dirid;
449   } rootref[BTRFS_MAX_ROOTREF_BUFFER_NUM];
450   __u8 num_items;
451   __u8 align[7];
452 };
453 enum btrfs_err_code {
454   BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,
455   BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
456   BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
457   BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
458   BTRFS_ERROR_DEV_TGT_REPLACE,
459   BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
460   BTRFS_ERROR_DEV_ONLY_WRITABLE,
461   BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS,
462   BTRFS_ERROR_DEV_RAID1C3_MIN_NOT_MET,
463   BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET,
464 };
465 #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, struct btrfs_ioctl_vol_args)
466 #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, struct btrfs_ioctl_vol_args)
467 #define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, struct btrfs_ioctl_vol_args)
468 #define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, struct btrfs_ioctl_vol_args)
469 #define BTRFS_IOC_FORGET_DEV _IOW(BTRFS_IOCTL_MAGIC, 5, struct btrfs_ioctl_vol_args)
470 #define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6)
471 #define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7)
472 #define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
473 #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
474 #define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, struct btrfs_ioctl_vol_args)
475 #define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, struct btrfs_ioctl_vol_args)
476 #define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, struct btrfs_ioctl_vol_args)
477 #define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, struct btrfs_ioctl_clone_range_args)
478 #define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, struct btrfs_ioctl_vol_args)
479 #define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, struct btrfs_ioctl_vol_args)
480 #define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, struct btrfs_ioctl_defrag_range_args)
481 #define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args)
482 #define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2)
483 #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, struct btrfs_ioctl_ino_lookup_args)
484 #define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
485 #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, struct btrfs_ioctl_space_args)
486 #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
487 #define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
488 #define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, struct btrfs_ioctl_vol_args_v2)
489 #define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, struct btrfs_ioctl_vol_args_v2)
490 #define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
491 #define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
492 #define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, struct btrfs_ioctl_scrub_args)
493 #define BTRFS_IOC_SCRUB_CANCEL _IO(BTRFS_IOCTL_MAGIC, 28)
494 #define BTRFS_IOC_SCRUB_PROGRESS _IOWR(BTRFS_IOCTL_MAGIC, 29, struct btrfs_ioctl_scrub_args)
495 #define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, struct btrfs_ioctl_dev_info_args)
496 #define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, struct btrfs_ioctl_fs_info_args)
497 #define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, struct btrfs_ioctl_balance_args)
498 #define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int)
499 #define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, struct btrfs_ioctl_balance_args)
500 #define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, struct btrfs_ioctl_ino_path_args)
501 #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, struct btrfs_ioctl_logical_ino_args)
502 #define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, struct btrfs_ioctl_received_subvol_args)
503 #define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args)
504 #define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, struct btrfs_ioctl_vol_args)
505 #define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, struct btrfs_ioctl_quota_ctl_args)
506 #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, struct btrfs_ioctl_qgroup_assign_args)
507 #define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, struct btrfs_ioctl_qgroup_create_args)
508 #define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, struct btrfs_ioctl_qgroup_limit_args)
509 #define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args)
510 #define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args)
511 #define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
512 #define BTRFS_IOC_GET_FSLABEL FS_IOC_GETFSLABEL
513 #define BTRFS_IOC_SET_FSLABEL FS_IOC_SETFSLABEL
514 #define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, struct btrfs_ioctl_get_dev_stats)
515 #define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, struct btrfs_ioctl_dev_replace_args)
516 #define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, struct btrfs_ioctl_same_args)
517 #define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags)
518 #define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2])
519 #define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3])
520 #define BTRFS_IOC_RM_DEV_V2 _IOW(BTRFS_IOCTL_MAGIC, 58, struct btrfs_ioctl_vol_args_v2)
521 #define BTRFS_IOC_LOGICAL_INO_V2 _IOWR(BTRFS_IOCTL_MAGIC, 59, struct btrfs_ioctl_logical_ino_args)
522 #define BTRFS_IOC_GET_SUBVOL_INFO _IOR(BTRFS_IOCTL_MAGIC, 60, struct btrfs_ioctl_get_subvol_info_args)
523 #define BTRFS_IOC_GET_SUBVOL_ROOTREF _IOWR(BTRFS_IOCTL_MAGIC, 61, struct btrfs_ioctl_get_subvol_rootref_args)
524 #define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, struct btrfs_ioctl_ino_lookup_user_args)
525 #define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, struct btrfs_ioctl_vol_args_v2)
526 #endif
527