1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
24#define BTRFS_IOCTL_MAGIC 0x94
25#define BTRFS_VOL_NAME_MAX 255
26#define BTRFS_LABEL_SIZE 256
27
28
29#define BTRFS_PATH_NAME_MAX 4087
30struct btrfs_ioctl_vol_args {
31 __s64 fd;
32 char name[BTRFS_PATH_NAME_MAX + 1];
33};
34
35#define BTRFS_DEVICE_PATH_NAME_MAX 1024
36
37#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
38#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
39#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
40#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
41
42#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
43 (BTRFS_SUBVOL_CREATE_ASYNC | \
44 BTRFS_SUBVOL_RDONLY | \
45 BTRFS_SUBVOL_QGROUP_INHERIT | \
46 BTRFS_DEVICE_SPEC_BY_ID)
47
48#define BTRFS_FSID_SIZE 16
49#define BTRFS_UUID_SIZE 16
50#define BTRFS_UUID_UNPARSED_SIZE 37
51
52
53
54
55
56
57
58
59#define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0)
60#define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1)
61#define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2)
62#define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3)
63#define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4)
64#define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5)
65
66struct btrfs_qgroup_limit {
67 __u64 flags;
68 __u64 max_rfer;
69 __u64 max_excl;
70 __u64 rsv_rfer;
71 __u64 rsv_excl;
72};
73
74
75
76
77
78
79
80#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
81
82struct btrfs_qgroup_inherit {
83 __u64 flags;
84 __u64 num_qgroups;
85 __u64 num_ref_copies;
86 __u64 num_excl_copies;
87 struct btrfs_qgroup_limit lim;
88 __u64 qgroups[0];
89};
90
91struct btrfs_ioctl_qgroup_limit_args {
92 __u64 qgroupid;
93 struct btrfs_qgroup_limit lim;
94};
95
96#define BTRFS_SUBVOL_NAME_MAX 4039
97struct btrfs_ioctl_vol_args_v2 {
98 __s64 fd;
99 __u64 transid;
100 __u64 flags;
101 union {
102 struct {
103 __u64 size;
104 struct btrfs_qgroup_inherit __user *qgroup_inherit;
105 };
106 __u64 unused[4];
107 };
108 union {
109 char name[BTRFS_SUBVOL_NAME_MAX + 1];
110 __u64 devid;
111 };
112};
113
114
115
116
117
118struct btrfs_scrub_progress {
119 __u64 data_extents_scrubbed;
120 __u64 tree_extents_scrubbed;
121 __u64 data_bytes_scrubbed;
122 __u64 tree_bytes_scrubbed;
123 __u64 read_errors;
124 __u64 csum_errors;
125 __u64 verify_errors;
126
127
128
129 __u64 no_csum;
130
131
132 __u64 csum_discards;
133
134 __u64 super_errors;
135 __u64 malloc_errors;
136
137
138 __u64 uncorrectable_errors;
139
140
141 __u64 corrected_errors;
142 __u64 last_physical;
143
144
145 __u64 unverified_errors;
146
147
148
149};
150
151#define BTRFS_SCRUB_READONLY 1
152struct btrfs_ioctl_scrub_args {
153 __u64 devid;
154 __u64 start;
155 __u64 end;
156 __u64 flags;
157 struct btrfs_scrub_progress progress;
158
159 __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
160};
161
162#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
163#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
164struct btrfs_ioctl_dev_replace_start_params {
165 __u64 srcdevid;
166 __u64 cont_reading_from_srcdev_mode;
167
168 __u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
169 __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
170};
171
172#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
173#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
174#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
175#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
176#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
177struct btrfs_ioctl_dev_replace_status_params {
178 __u64 replace_state;
179 __u64 progress_1000;
180 __u64 time_started;
181 __u64 time_stopped;
182 __u64 num_write_errors;
183 __u64 num_uncorrectable_read_errors;
184};
185
186#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
187#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
188#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
189#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
190#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
191#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
192#define BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS 3
193struct btrfs_ioctl_dev_replace_args {
194 __u64 cmd;
195 __u64 result;
196
197 union {
198 struct btrfs_ioctl_dev_replace_start_params start;
199 struct btrfs_ioctl_dev_replace_status_params status;
200 };
201
202 __u64 spare[64];
203};
204
205struct btrfs_ioctl_dev_info_args {
206 __u64 devid;
207 __u8 uuid[BTRFS_UUID_SIZE];
208 __u64 bytes_used;
209 __u64 total_bytes;
210 __u64 unused[379];
211 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX];
212};
213
214struct btrfs_ioctl_fs_info_args {
215 __u64 max_id;
216 __u64 num_devices;
217 __u8 fsid[BTRFS_FSID_SIZE];
218 __u32 nodesize;
219 __u32 sectorsize;
220 __u32 clone_alignment;
221 __u32 reserved32;
222 __u64 reserved[122];
223};
224
225
226
227
228
229
230
231#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0)
232
233
234
235
236
237
238
239
240
241#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
242
243#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
244#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
245#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
246#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3)
247
248
249
250
251
252
253#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 (1ULL << 4)
254
255
256
257
258
259#define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5)
260
261#define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6)
262#define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
263#define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
264#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
265
266struct btrfs_ioctl_feature_flags {
267 __u64 compat_flags;
268 __u64 compat_ro_flags;
269 __u64 incompat_flags;
270};
271
272
273#define BTRFS_BALANCE_CTL_PAUSE 1
274#define BTRFS_BALANCE_CTL_CANCEL 2
275
276
277
278
279
280struct btrfs_balance_args {
281 __u64 profiles;
282 union {
283 __le64 usage;
284 struct {
285 __le32 usage_min;
286 __le32 usage_max;
287 };
288 };
289 __u64 devid;
290 __u64 pstart;
291 __u64 pend;
292 __u64 vstart;
293 __u64 vend;
294
295 __u64 target;
296
297 __u64 flags;
298
299
300
301
302
303
304 union {
305 __u64 limit;
306 struct {
307 __u32 limit_min;
308 __u32 limit_max;
309 };
310 };
311
312
313
314
315
316 __le32 stripes_min;
317 __le32 stripes_max;
318
319 __u64 unused[6];
320} __attribute__ ((__packed__));
321
322
323struct btrfs_balance_progress {
324 __u64 expected;
325
326 __u64 considered;
327 __u64 completed;
328};
329
330
331
332
333
334
335
336
337
338
339#define BTRFS_BALANCE_DATA (1ULL << 0)
340#define BTRFS_BALANCE_SYSTEM (1ULL << 1)
341#define BTRFS_BALANCE_METADATA (1ULL << 2)
342
343#define BTRFS_BALANCE_TYPE_MASK (BTRFS_BALANCE_DATA | \
344 BTRFS_BALANCE_SYSTEM | \
345 BTRFS_BALANCE_METADATA)
346
347#define BTRFS_BALANCE_FORCE (1ULL << 3)
348#define BTRFS_BALANCE_RESUME (1ULL << 4)
349
350
351
352
353
354
355
356
357
358#define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
359#define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
360#define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
361#define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
362#define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
363#define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
364#define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
365#define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
366#define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
367
368#define BTRFS_BALANCE_ARGS_MASK \
369 (BTRFS_BALANCE_ARGS_PROFILES | \
370 BTRFS_BALANCE_ARGS_USAGE | \
371 BTRFS_BALANCE_ARGS_DEVID | \
372 BTRFS_BALANCE_ARGS_DRANGE | \
373 BTRFS_BALANCE_ARGS_VRANGE | \
374 BTRFS_BALANCE_ARGS_LIMIT | \
375 BTRFS_BALANCE_ARGS_LIMIT_RANGE | \
376 BTRFS_BALANCE_ARGS_STRIPES_RANGE | \
377 BTRFS_BALANCE_ARGS_USAGE_RANGE)
378
379
380
381
382
383
384#define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
385#define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
386
387
388
389
390
391
392
393
394#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
395#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
396#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
397
398struct btrfs_ioctl_balance_args {
399 __u64 flags;
400 __u64 state;
401
402 struct btrfs_balance_args data;
403 struct btrfs_balance_args meta;
404 struct btrfs_balance_args sys;
405
406 struct btrfs_balance_progress stat;
407
408 __u64 unused[72];
409};
410
411#define BTRFS_INO_LOOKUP_PATH_MAX 4080
412struct btrfs_ioctl_ino_lookup_args {
413 __u64 treeid;
414 __u64 objectid;
415 char name[BTRFS_INO_LOOKUP_PATH_MAX];
416};
417
418struct btrfs_ioctl_search_key {
419
420 __u64 tree_id;
421
422
423 __u64 min_objectid;
424 __u64 max_objectid;
425
426
427 __u64 min_offset;
428 __u64 max_offset;
429
430
431 __u64 min_transid;
432 __u64 max_transid;
433
434
435 __u32 min_type;
436 __u32 max_type;
437
438
439
440
441
442 __u32 nr_items;
443
444
445 __u32 unused;
446
447
448 __u64 unused1;
449 __u64 unused2;
450 __u64 unused3;
451 __u64 unused4;
452};
453
454struct btrfs_ioctl_search_header {
455 __u64 transid;
456 __u64 objectid;
457 __u64 offset;
458 __u32 type;
459 __u32 len;
460};
461
462#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
463
464
465
466
467
468struct btrfs_ioctl_search_args {
469 struct btrfs_ioctl_search_key key;
470 char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
471};
472
473struct btrfs_ioctl_search_args_v2 {
474 struct btrfs_ioctl_search_key key;
475 __u64 buf_size;
476
477
478 __u64 buf[0];
479};
480
481struct btrfs_ioctl_clone_range_args {
482 __s64 src_fd;
483 __u64 src_offset, src_length;
484 __u64 dest_offset;
485};
486
487
488
489
490
491
492
493#define BTRFS_DEFRAG_RANGE_COMPRESS 1
494#define BTRFS_DEFRAG_RANGE_START_IO 2
495struct btrfs_ioctl_defrag_range_args {
496
497 __u64 start;
498
499
500 __u64 len;
501
502
503
504
505
506 __u64 flags;
507
508
509
510
511
512
513 __u32 extent_thresh;
514
515
516
517
518
519
520 __u32 compress_type;
521
522
523 __u32 unused[4];
524};
525
526
527#define BTRFS_SAME_DATA_DIFFERS 1
528
529struct btrfs_ioctl_same_extent_info {
530 __s64 fd;
531 __u64 logical_offset;
532 __u64 bytes_deduped;
533
534
535
536
537
538
539 __s32 status;
540 __u32 reserved;
541};
542
543struct btrfs_ioctl_same_args {
544 __u64 logical_offset;
545 __u64 length;
546 __u16 dest_count;
547 __u16 reserved1;
548 __u32 reserved2;
549 struct btrfs_ioctl_same_extent_info info[0];
550};
551
552struct btrfs_ioctl_space_info {
553 __u64 flags;
554 __u64 total_bytes;
555 __u64 used_bytes;
556};
557
558struct btrfs_ioctl_space_args {
559 __u64 space_slots;
560 __u64 total_spaces;
561 struct btrfs_ioctl_space_info spaces[0];
562};
563
564struct btrfs_data_container {
565 __u32 bytes_left;
566 __u32 bytes_missing;
567 __u32 elem_cnt;
568 __u32 elem_missed;
569 __u64 val[0];
570};
571
572struct btrfs_ioctl_ino_path_args {
573 __u64 inum;
574 __u64 size;
575 __u64 reserved[4];
576
577 __u64 fspath;
578};
579
580struct btrfs_ioctl_logical_ino_args {
581 __u64 logical;
582 __u64 size;
583 __u64 reserved[4];
584
585 __u64 inodes;
586};
587
588enum btrfs_dev_stat_values {
589
590 BTRFS_DEV_STAT_WRITE_ERRS,
591 BTRFS_DEV_STAT_READ_ERRS,
592 BTRFS_DEV_STAT_FLUSH_ERRS,
593
594
595 BTRFS_DEV_STAT_CORRUPTION_ERRS,
596
597
598
599
600
601 BTRFS_DEV_STAT_GENERATION_ERRS,
602
603
604 BTRFS_DEV_STAT_VALUES_MAX
605};
606
607
608#define BTRFS_DEV_STATS_RESET (1ULL << 0)
609
610struct btrfs_ioctl_get_dev_stats {
611 __u64 devid;
612 __u64 nr_items;
613 __u64 flags;
614
615
616 __u64 values[BTRFS_DEV_STAT_VALUES_MAX];
617
618 __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX];
619};
620
621#define BTRFS_QUOTA_CTL_ENABLE 1
622#define BTRFS_QUOTA_CTL_DISABLE 2
623#define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3
624struct btrfs_ioctl_quota_ctl_args {
625 __u64 cmd;
626 __u64 status;
627};
628
629struct btrfs_ioctl_quota_rescan_args {
630 __u64 flags;
631 __u64 progress;
632 __u64 reserved[6];
633};
634
635struct btrfs_ioctl_qgroup_assign_args {
636 __u64 assign;
637 __u64 src;
638 __u64 dst;
639};
640
641struct btrfs_ioctl_qgroup_create_args {
642 __u64 create;
643 __u64 qgroupid;
644};
645struct btrfs_ioctl_timespec {
646 __u64 sec;
647 __u32 nsec;
648};
649
650struct btrfs_ioctl_received_subvol_args {
651 char uuid[BTRFS_UUID_SIZE];
652 __u64 stransid;
653 __u64 rtransid;
654 struct btrfs_ioctl_timespec stime;
655 struct btrfs_ioctl_timespec rtime;
656 __u64 flags;
657 __u64 reserved[16];
658};
659
660
661
662
663
664
665#define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
666
667
668
669
670
671#define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2
672
673
674
675
676
677
678#define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
679
680#define BTRFS_SEND_FLAG_MASK \
681 (BTRFS_SEND_FLAG_NO_FILE_DATA | \
682 BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \
683 BTRFS_SEND_FLAG_OMIT_END_CMD)
684
685struct btrfs_ioctl_send_args {
686 __s64 send_fd;
687 __u64 clone_sources_count;
688 __u64 __user *clone_sources;
689 __u64 parent_root;
690 __u64 flags;
691 __u64 reserved[4];
692};
693
694
695enum btrfs_err_code {
696 notused,
697 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET,
698 BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
699 BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
700 BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
701 BTRFS_ERROR_DEV_TGT_REPLACE,
702 BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
703 BTRFS_ERROR_DEV_ONLY_WRITABLE,
704 BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
705};
706
707
708
709static inline char *btrfs_err_str(enum btrfs_err_code err_code)
710{
711 switch (err_code) {
712 case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
713 return "unable to go below two devices on raid1";
714 case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
715 return "unable to go below four devices on raid10";
716 case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
717 return "unable to go below two devices on raid5";
718 case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
719 return "unable to go below three devices on raid6";
720 case BTRFS_ERROR_DEV_TGT_REPLACE:
721 return "unable to remove the dev_replace target dev";
722 case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
723 return "no missing devices found to remove";
724 case BTRFS_ERROR_DEV_ONLY_WRITABLE:
725 return "unable to remove the only writeable device";
726 case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
727 return "add/delete/balance/replace/resize operation "\
728 "in progress";
729 default:
730 return NULL;
731 }
732}
733
734#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
735 struct btrfs_ioctl_vol_args)
736#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
737 struct btrfs_ioctl_vol_args)
738#define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, \
739 struct btrfs_ioctl_vol_args)
740#define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \
741 struct btrfs_ioctl_vol_args)
742
743
744
745
746#define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6)
747#define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7)
748#define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
749
750#define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
751#define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, \
752 struct btrfs_ioctl_vol_args)
753#define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, \
754 struct btrfs_ioctl_vol_args)
755#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \
756 struct btrfs_ioctl_vol_args)
757
758#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \
759 struct btrfs_ioctl_clone_range_args)
760
761#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
762 struct btrfs_ioctl_vol_args)
763#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \
764 struct btrfs_ioctl_vol_args)
765#define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, \
766 struct btrfs_ioctl_defrag_range_args)
767#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
768 struct btrfs_ioctl_search_args)
769#define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
770 struct btrfs_ioctl_search_args_v2)
771#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
772 struct btrfs_ioctl_ino_lookup_args)
773#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
774#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
775 struct btrfs_ioctl_space_args)
776#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
777#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
778#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
779 struct btrfs_ioctl_vol_args_v2)
780#define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, \
781 struct btrfs_ioctl_vol_args_v2)
782#define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
783#define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
784#define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, \
785 struct btrfs_ioctl_scrub_args)
786#define BTRFS_IOC_SCRUB_CANCEL _IO(BTRFS_IOCTL_MAGIC, 28)
787#define BTRFS_IOC_SCRUB_PROGRESS _IOWR(BTRFS_IOCTL_MAGIC, 29, \
788 struct btrfs_ioctl_scrub_args)
789#define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, \
790 struct btrfs_ioctl_dev_info_args)
791#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \
792 struct btrfs_ioctl_fs_info_args)
793#define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, \
794 struct btrfs_ioctl_balance_args)
795#define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int)
796#define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, \
797 struct btrfs_ioctl_balance_args)
798#define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \
799 struct btrfs_ioctl_ino_path_args)
800#define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \
801 struct btrfs_ioctl_ino_path_args)
802#define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, \
803 struct btrfs_ioctl_received_subvol_args)
804#define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args)
805#define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \
806 struct btrfs_ioctl_vol_args)
807#define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, \
808 struct btrfs_ioctl_quota_ctl_args)
809#define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
810 struct btrfs_ioctl_qgroup_assign_args)
811#define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, \
812 struct btrfs_ioctl_qgroup_create_args)
813#define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, \
814 struct btrfs_ioctl_qgroup_limit_args)
815#define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
816 struct btrfs_ioctl_quota_rescan_args)
817#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
818 struct btrfs_ioctl_quota_rescan_args)
819#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
820#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \
821 char[BTRFS_LABEL_SIZE])
822#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
823 char[BTRFS_LABEL_SIZE])
824#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
825 struct btrfs_ioctl_get_dev_stats)
826#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
827 struct btrfs_ioctl_dev_replace_args)
828#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
829 struct btrfs_ioctl_same_args)
830#define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
831 struct btrfs_ioctl_feature_flags)
832#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
833 struct btrfs_ioctl_feature_flags[2])
834#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
835 struct btrfs_ioctl_feature_flags[3])
836#define BTRFS_IOC_RM_DEV_V2 _IOW(BTRFS_IOCTL_MAGIC, 58, \
837 struct btrfs_ioctl_vol_args_v2)
838
839#endif
840