blob: 1522b92bfd892d8dccbbea673477717a95a70211 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define BTRFS_IOCTL_MAGIC 0x94
25#define BTRFS_VOL_NAME_MAX 255
Christopher Ferris106b3a82016-08-24 12:15:38 -070026#define BTRFS_LABEL_SIZE 256
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define BTRFS_PATH_NAME_MAX 4087
Ben Cheng655a7c02013-10-16 16:09:24 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070029struct btrfs_ioctl_vol_args {
Tao Baod7db5942015-01-28 10:07:51 -080030 __s64 fd;
31 char name[BTRFS_PATH_NAME_MAX + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070032};
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070034#define BTRFS_DEVICE_PATH_NAME_MAX 1024
35#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
36#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED (BTRFS_SUBVOL_CREATE_ASYNC | BTRFS_SUBVOL_RDONLY | BTRFS_SUBVOL_QGROUP_INHERIT | BTRFS_DEVICE_SPEC_BY_ID)
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define BTRFS_FSID_SIZE 16
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define BTRFS_UUID_SIZE 16
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070040#define BTRFS_UUID_UNPARSED_SIZE 37
Christopher Ferris106b3a82016-08-24 12:15:38 -070041#define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0)
42#define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070044#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/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49struct btrfs_qgroup_limit {
Tao Baod7db5942015-01-28 10:07:51 -080050 __u64 flags;
51 __u64 max_rfer;
52 __u64 max_excl;
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070054 __u64 rsv_rfer;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u64 rsv_excl;
Ben Cheng655a7c02013-10-16 16:09:24 -070056};
Christopher Ferris106b3a82016-08-24 12:15:38 -070057#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct btrfs_qgroup_inherit {
Tao Baod7db5942015-01-28 10:07:51 -080060 __u64 flags;
Tao Baod7db5942015-01-28 10:07:51 -080061 __u64 num_qgroups;
62 __u64 num_ref_copies;
Christopher Ferris106b3a82016-08-24 12:15:38 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 __u64 num_excl_copies;
65 struct btrfs_qgroup_limit lim;
Tao Baod7db5942015-01-28 10:07:51 -080066 __u64 qgroups[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070067};
Christopher Ferris106b3a82016-08-24 12:15:38 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070069struct btrfs_ioctl_qgroup_limit_args {
Tao Baod7db5942015-01-28 10:07:51 -080070 __u64 qgroupid;
Tao Baod7db5942015-01-28 10:07:51 -080071 struct btrfs_qgroup_limit lim;
Ben Cheng655a7c02013-10-16 16:09:24 -070072};
Ben Cheng655a7c02013-10-16 16:09:24 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070074#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
75#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
76#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
77#define BTRFS_SUBVOL_NAME_MAX 4039
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79struct btrfs_ioctl_vol_args_v2 {
Tao Baod7db5942015-01-28 10:07:51 -080080 __s64 fd;
81 __u64 transid;
82 __u64 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 union {
Tao Baod7db5942015-01-28 10:07:51 -080085 struct {
86 __u64 size;
87 struct btrfs_qgroup_inherit __user * qgroup_inherit;
Ben Cheng655a7c02013-10-16 16:09:24 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070089 };
Tao Baod7db5942015-01-28 10:07:51 -080090 __u64 unused[4];
91 };
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 union {
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 char name[BTRFS_SUBVOL_NAME_MAX + 1];
95 __u64 devid;
96 };
Ben Cheng655a7c02013-10-16 16:09:24 -070097};
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070099struct btrfs_scrub_progress {
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u64 data_extents_scrubbed;
101 __u64 tree_extents_scrubbed;
102 __u64 data_bytes_scrubbed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u64 tree_bytes_scrubbed;
105 __u64 read_errors;
106 __u64 csum_errors;
107 __u64 verify_errors;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 __u64 no_csum;
110 __u64 csum_discards;
111 __u64 super_errors;
112 __u64 malloc_errors;
Ben Cheng655a7c02013-10-16 16:09:24 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 __u64 uncorrectable_errors;
115 __u64 corrected_errors;
116 __u64 last_physical;
117 __u64 unverified_errors;
Ben Cheng655a7c02013-10-16 16:09:24 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700119};
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define BTRFS_SCRUB_READONLY 1
121struct btrfs_ioctl_scrub_args {
Tao Baod7db5942015-01-28 10:07:51 -0800122 __u64 devid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u64 start;
125 __u64 end;
126 __u64 flags;
127 struct btrfs_scrub_progress progress;
Ben Cheng655a7c02013-10-16 16:09:24 -0700128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800129 __u64 unused[(1024 - 32 - sizeof(struct btrfs_scrub_progress)) / 8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700130};
131#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
132#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700134struct btrfs_ioctl_dev_replace_start_params {
Tao Baod7db5942015-01-28 10:07:51 -0800135 __u64 srcdevid;
136 __u64 cont_reading_from_srcdev_mode;
137 __u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -0700140};
141#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
142#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700144#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
146#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
147struct btrfs_ioctl_dev_replace_status_params {
Ben Cheng655a7c02013-10-16 16:09:24 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800149 __u64 replace_state;
150 __u64 progress_1000;
151 __u64 time_started;
152 __u64 time_stopped;
Ben Cheng655a7c02013-10-16 16:09:24 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u64 num_write_errors;
155 __u64 num_uncorrectable_read_errors;
Ben Cheng655a7c02013-10-16 16:09:24 -0700156};
157#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700159#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
161#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
162#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700164#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800165#define BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700166struct btrfs_ioctl_dev_replace_args {
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u64 cmd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800169 __u64 result;
Tao Baod7db5942015-01-28 10:07:51 -0800170 union {
171 struct btrfs_ioctl_dev_replace_start_params start;
172 struct btrfs_ioctl_dev_replace_status_params status;
Ben Cheng655a7c02013-10-16 16:09:24 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800174 };
Tao Baod7db5942015-01-28 10:07:51 -0800175 __u64 spare[64];
Ben Cheng655a7c02013-10-16 16:09:24 -0700176};
177struct btrfs_ioctl_dev_info_args {
Ben Cheng655a7c02013-10-16 16:09:24 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800179 __u64 devid;
Tao Baod7db5942015-01-28 10:07:51 -0800180 __u8 uuid[BTRFS_UUID_SIZE];
181 __u64 bytes_used;
182 __u64 total_bytes;
Ben Cheng655a7c02013-10-16 16:09:24 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800184 __u64 unused[379];
Tao Baod7db5942015-01-28 10:07:51 -0800185 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX];
Ben Cheng655a7c02013-10-16 16:09:24 -0700186};
187struct btrfs_ioctl_fs_info_args {
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800189 __u64 max_id;
Tao Baod7db5942015-01-28 10:07:51 -0800190 __u64 num_devices;
191 __u8 fsid[BTRFS_FSID_SIZE];
192 __u32 nodesize;
Ben Cheng655a7c02013-10-16 16:09:24 -0700193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800194 __u32 sectorsize;
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u32 clone_alignment;
196 __u32 reserved32;
197 __u64 reserved[122];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800199};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0)
201#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
202#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
205#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3)
206#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 (1ULL << 4)
207#define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5)
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209#define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6)
210#define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
211#define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
212#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700214struct btrfs_ioctl_feature_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800215 __u64 compat_flags;
216 __u64 compat_ro_flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800217 __u64 incompat_flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700219};
Christopher Ferris38062f92014-07-09 15:33:25 -0700220#define BTRFS_BALANCE_CTL_PAUSE 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700221#define BTRFS_BALANCE_CTL_CANCEL 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800222struct btrfs_balance_args {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800224 __u64 profiles;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800225 union {
226 __le64 usage;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800227 struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800229 __le32 usage_min;
230 __le32 usage_max;
231 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800232 };
Christopher Ferris106b3a82016-08-24 12:15:38 -0700233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800234 __u64 devid;
235 __u64 pstart;
Tao Baod7db5942015-01-28 10:07:51 -0800236 __u64 pend;
237 __u64 vstart;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800239 __u64 vend;
240 __u64 target;
Tao Baod7db5942015-01-28 10:07:51 -0800241 __u64 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800242 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800244 __u64 limit;
245 struct {
246 __u32 limit_min;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800247 __u32 limit_max;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800249 };
250 };
251 __le32 stripes_min;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800252 __le32 stripes_max;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800254 __u64 unused[6];
255} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700256struct btrfs_balance_progress {
Tao Baod7db5942015-01-28 10:07:51 -0800257 __u64 expected;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800259 __u64 considered;
260 __u64 completed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700261};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700262#define BTRFS_BALANCE_DATA (1ULL << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700264#define BTRFS_BALANCE_SYSTEM (1ULL << 1)
265#define BTRFS_BALANCE_METADATA (1ULL << 2)
266#define BTRFS_BALANCE_TYPE_MASK (BTRFS_BALANCE_DATA | BTRFS_BALANCE_SYSTEM | BTRFS_BALANCE_METADATA)
267#define BTRFS_BALANCE_FORCE (1ULL << 3)
268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269#define BTRFS_BALANCE_RESUME (1ULL << 4)
270#define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
271#define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
272#define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274#define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
275#define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
276#define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
277#define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279#define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
280#define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
281#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)
282#define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284#define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
Ben Cheng655a7c02013-10-16 16:09:24 -0700285#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
Christopher Ferris38062f92014-07-09 15:33:25 -0700286#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700287#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700289struct btrfs_ioctl_balance_args {
Tao Baod7db5942015-01-28 10:07:51 -0800290 __u64 flags;
291 __u64 state;
292 struct btrfs_balance_args data;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700294 struct btrfs_balance_args meta;
Tao Baod7db5942015-01-28 10:07:51 -0800295 struct btrfs_balance_args sys;
296 struct btrfs_balance_progress stat;
297 __u64 unused[72];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700299};
Ben Cheng655a7c02013-10-16 16:09:24 -0700300#define BTRFS_INO_LOOKUP_PATH_MAX 4080
Christopher Ferris38062f92014-07-09 15:33:25 -0700301struct btrfs_ioctl_ino_lookup_args {
Tao Baod7db5942015-01-28 10:07:51 -0800302 __u64 treeid;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700304 __u64 objectid;
Tao Baod7db5942015-01-28 10:07:51 -0800305 char name[BTRFS_INO_LOOKUP_PATH_MAX];
Christopher Ferris38062f92014-07-09 15:33:25 -0700306};
Ben Cheng655a7c02013-10-16 16:09:24 -0700307struct btrfs_ioctl_search_key {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700309 __u64 tree_id;
Tao Baod7db5942015-01-28 10:07:51 -0800310 __u64 min_objectid;
311 __u64 max_objectid;
312 __u64 min_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700314 __u64 max_offset;
Tao Baod7db5942015-01-28 10:07:51 -0800315 __u64 min_transid;
316 __u64 max_transid;
317 __u32 min_type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700319 __u32 max_type;
Tao Baod7db5942015-01-28 10:07:51 -0800320 __u32 nr_items;
321 __u32 unused;
322 __u64 unused1;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700324 __u64 unused2;
Tao Baod7db5942015-01-28 10:07:51 -0800325 __u64 unused3;
326 __u64 unused4;
Ben Cheng655a7c02013-10-16 16:09:24 -0700327};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700329struct btrfs_ioctl_search_header {
Tao Baod7db5942015-01-28 10:07:51 -0800330 __u64 transid;
331 __u64 objectid;
332 __u64 offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800333/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700334 __u32 type;
Tao Baod7db5942015-01-28 10:07:51 -0800335 __u32 len;
Christopher Ferris38062f92014-07-09 15:33:25 -0700336};
Ben Cheng655a7c02013-10-16 16:09:24 -0700337#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
Christopher Ferris05d08e92016-02-04 13:16:38 -0800338/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700339struct btrfs_ioctl_search_args {
Tao Baod7db5942015-01-28 10:07:51 -0800340 struct btrfs_ioctl_search_key key;
341 char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
Ben Cheng655a7c02013-10-16 16:09:24 -0700342};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800343/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700344struct btrfs_ioctl_search_args_v2 {
Tao Baod7db5942015-01-28 10:07:51 -0800345 struct btrfs_ioctl_search_key key;
346 __u64 buf_size;
347 __u64 buf[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800348/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700349};
Ben Cheng655a7c02013-10-16 16:09:24 -0700350struct btrfs_ioctl_clone_range_args {
Tao Baod7db5942015-01-28 10:07:51 -0800351 __s64 src_fd;
352 __u64 src_offset, src_length;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800353/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700354 __u64 dest_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700355};
356#define BTRFS_DEFRAG_RANGE_COMPRESS 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700357#define BTRFS_DEFRAG_RANGE_START_IO 2
Christopher Ferris05d08e92016-02-04 13:16:38 -0800358/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700359struct btrfs_ioctl_defrag_range_args {
360 __u64 start;
361 __u64 len;
362 __u64 flags;
363/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
364 __u32 extent_thresh;
365 __u32 compress_type;
366 __u32 unused[4];
367};
368/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
369#define BTRFS_SAME_DATA_DIFFERS 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700370struct btrfs_ioctl_same_extent_info {
Tao Baod7db5942015-01-28 10:07:51 -0800371 __s64 fd;
372 __u64 logical_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800373/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700374 __u64 bytes_deduped;
Tao Baod7db5942015-01-28 10:07:51 -0800375 __s32 status;
376 __u32 reserved;
Christopher Ferris38062f92014-07-09 15:33:25 -0700377};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800378/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700379struct btrfs_ioctl_same_args {
Tao Baod7db5942015-01-28 10:07:51 -0800380 __u64 logical_offset;
381 __u64 length;
382 __u16 dest_count;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800383/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700384 __u16 reserved1;
Tao Baod7db5942015-01-28 10:07:51 -0800385 __u32 reserved2;
386 struct btrfs_ioctl_same_extent_info info[0];
Christopher Ferris38062f92014-07-09 15:33:25 -0700387};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800388/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700389struct btrfs_ioctl_space_info {
Tao Baod7db5942015-01-28 10:07:51 -0800390 __u64 flags;
391 __u64 total_bytes;
392 __u64 used_bytes;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800393/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700394};
Ben Cheng655a7c02013-10-16 16:09:24 -0700395struct btrfs_ioctl_space_args {
Tao Baod7db5942015-01-28 10:07:51 -0800396 __u64 space_slots;
397 __u64 total_spaces;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800398/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700399 struct btrfs_ioctl_space_info spaces[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700400};
401struct btrfs_data_container {
Tao Baod7db5942015-01-28 10:07:51 -0800402 __u32 bytes_left;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800403/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700404 __u32 bytes_missing;
Tao Baod7db5942015-01-28 10:07:51 -0800405 __u32 elem_cnt;
406 __u32 elem_missed;
407 __u64 val[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800408/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700409};
Ben Cheng655a7c02013-10-16 16:09:24 -0700410struct btrfs_ioctl_ino_path_args {
Tao Baod7db5942015-01-28 10:07:51 -0800411 __u64 inum;
412 __u64 size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800413/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700414 __u64 reserved[4];
Tao Baod7db5942015-01-28 10:07:51 -0800415 __u64 fspath;
Ben Cheng655a7c02013-10-16 16:09:24 -0700416};
Christopher Ferris38062f92014-07-09 15:33:25 -0700417struct btrfs_ioctl_logical_ino_args {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800418/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700419 __u64 logical;
Tao Baod7db5942015-01-28 10:07:51 -0800420 __u64 size;
421 __u64 reserved[4];
422 __u64 inodes;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800423/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700424};
Ben Cheng655a7c02013-10-16 16:09:24 -0700425enum btrfs_dev_stat_values {
Tao Baod7db5942015-01-28 10:07:51 -0800426 BTRFS_DEV_STAT_WRITE_ERRS,
427 BTRFS_DEV_STAT_READ_ERRS,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800428/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700429 BTRFS_DEV_STAT_FLUSH_ERRS,
Tao Baod7db5942015-01-28 10:07:51 -0800430 BTRFS_DEV_STAT_CORRUPTION_ERRS,
431 BTRFS_DEV_STAT_GENERATION_ERRS,
432 BTRFS_DEV_STAT_VALUES_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -0800433/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700434};
Ben Cheng655a7c02013-10-16 16:09:24 -0700435#define BTRFS_DEV_STATS_RESET (1ULL << 0)
436struct btrfs_ioctl_get_dev_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800437 __u64 devid;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800438/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700439 __u64 nr_items;
Tao Baod7db5942015-01-28 10:07:51 -0800440 __u64 flags;
441 __u64 values[BTRFS_DEV_STAT_VALUES_MAX];
442 __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800443/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700444};
Ben Cheng655a7c02013-10-16 16:09:24 -0700445#define BTRFS_QUOTA_CTL_ENABLE 1
446#define BTRFS_QUOTA_CTL_DISABLE 2
Christopher Ferris38062f92014-07-09 15:33:25 -0700447#define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3
Christopher Ferris05d08e92016-02-04 13:16:38 -0800448/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700449struct btrfs_ioctl_quota_ctl_args {
Tao Baod7db5942015-01-28 10:07:51 -0800450 __u64 cmd;
451 __u64 status;
Christopher Ferris38062f92014-07-09 15:33:25 -0700452};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800453/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700454struct btrfs_ioctl_quota_rescan_args {
Tao Baod7db5942015-01-28 10:07:51 -0800455 __u64 flags;
456 __u64 progress;
457 __u64 reserved[6];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800458/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700459};
Ben Cheng655a7c02013-10-16 16:09:24 -0700460struct btrfs_ioctl_qgroup_assign_args {
Tao Baod7db5942015-01-28 10:07:51 -0800461 __u64 assign;
462 __u64 src;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800463/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700464 __u64 dst;
Ben Cheng655a7c02013-10-16 16:09:24 -0700465};
466struct btrfs_ioctl_qgroup_create_args {
Tao Baod7db5942015-01-28 10:07:51 -0800467 __u64 create;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800468/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700469 __u64 qgroupid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700470};
471struct btrfs_ioctl_timespec {
Tao Baod7db5942015-01-28 10:07:51 -0800472 __u64 sec;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800473/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700474 __u32 nsec;
Ben Cheng655a7c02013-10-16 16:09:24 -0700475};
476struct btrfs_ioctl_received_subvol_args {
Tao Baod7db5942015-01-28 10:07:51 -0800477 char uuid[BTRFS_UUID_SIZE];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800478/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700479 __u64 stransid;
Tao Baod7db5942015-01-28 10:07:51 -0800480 __u64 rtransid;
481 struct btrfs_ioctl_timespec stime;
482 struct btrfs_ioctl_timespec rtime;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800483/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700484 __u64 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800485 __u64 reserved[16];
Ben Cheng655a7c02013-10-16 16:09:24 -0700486};
Christopher Ferris38062f92014-07-09 15:33:25 -0700487#define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800488/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700489#define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -0700490#define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
Tao Baod7db5942015-01-28 10:07:51 -0800491#define BTRFS_SEND_FLAG_MASK (BTRFS_SEND_FLAG_NO_FILE_DATA | BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | BTRFS_SEND_FLAG_OMIT_END_CMD)
Christopher Ferris38062f92014-07-09 15:33:25 -0700492struct btrfs_ioctl_send_args {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800493/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700494 __s64 send_fd;
Tao Baod7db5942015-01-28 10:07:51 -0800495 __u64 clone_sources_count;
496 __u64 __user * clone_sources;
497 __u64 parent_root;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800498/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700499 __u64 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800500 __u64 reserved[4];
Ben Cheng655a7c02013-10-16 16:09:24 -0700501};
Christopher Ferris38062f92014-07-09 15:33:25 -0700502enum btrfs_err_code {
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700503/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700504 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,
Tao Baod7db5942015-01-28 10:07:51 -0800505 BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
506 BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
Tao Baod7db5942015-01-28 10:07:51 -0800507 BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800508/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700509 BTRFS_ERROR_DEV_TGT_REPLACE,
Tao Baod7db5942015-01-28 10:07:51 -0800510 BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
511 BTRFS_ERROR_DEV_ONLY_WRITABLE,
Tao Baod7db5942015-01-28 10:07:51 -0800512 BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
Christopher Ferris05d08e92016-02-04 13:16:38 -0800513/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700514};
Tao Baod7db5942015-01-28 10:07:51 -0800515#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, struct btrfs_ioctl_vol_args)
516#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, struct btrfs_ioctl_vol_args)
Tao Baod7db5942015-01-28 10:07:51 -0800517#define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, struct btrfs_ioctl_vol_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800518/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700519#define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, struct btrfs_ioctl_vol_args)
Ben Cheng655a7c02013-10-16 16:09:24 -0700520#define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800521#define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7)
Ben Cheng655a7c02013-10-16 16:09:24 -0700522#define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800523/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700524#define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
Tao Baod7db5942015-01-28 10:07:51 -0800525#define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, struct btrfs_ioctl_vol_args)
526#define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, struct btrfs_ioctl_vol_args)
Tao Baod7db5942015-01-28 10:07:51 -0800527#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, struct btrfs_ioctl_vol_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800528/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700529#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, struct btrfs_ioctl_clone_range_args)
Tao Baod7db5942015-01-28 10:07:51 -0800530#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, struct btrfs_ioctl_vol_args)
531#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, struct btrfs_ioctl_vol_args)
Tao Baod7db5942015-01-28 10:07:51 -0800532#define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, struct btrfs_ioctl_defrag_range_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800533/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700534#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args)
Tao Baod7db5942015-01-28 10:07:51 -0800535#define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2)
536#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, struct btrfs_ioctl_ino_lookup_args)
Christopher Ferris38062f92014-07-09 15:33:25 -0700537#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800538/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700539#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, struct btrfs_ioctl_space_args)
Ben Cheng655a7c02013-10-16 16:09:24 -0700540#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
541#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
Tao Baod7db5942015-01-28 10:07:51 -0800542#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, struct btrfs_ioctl_vol_args_v2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800543/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700544#define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, struct btrfs_ioctl_vol_args_v2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700545#define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
546#define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
Tao Baod7db5942015-01-28 10:07:51 -0800547#define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, struct btrfs_ioctl_scrub_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800548/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700549#define BTRFS_IOC_SCRUB_CANCEL _IO(BTRFS_IOCTL_MAGIC, 28)
Tao Baod7db5942015-01-28 10:07:51 -0800550#define BTRFS_IOC_SCRUB_PROGRESS _IOWR(BTRFS_IOCTL_MAGIC, 29, struct btrfs_ioctl_scrub_args)
551#define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, struct btrfs_ioctl_dev_info_args)
Tao Baod7db5942015-01-28 10:07:51 -0800552#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, struct btrfs_ioctl_fs_info_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800553/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700554#define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, struct btrfs_ioctl_balance_args)
Ben Cheng655a7c02013-10-16 16:09:24 -0700555#define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int)
Tao Baod7db5942015-01-28 10:07:51 -0800556#define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, struct btrfs_ioctl_balance_args)
Tao Baod7db5942015-01-28 10:07:51 -0800557#define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, struct btrfs_ioctl_ino_path_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800558/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700559#define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, struct btrfs_ioctl_ino_path_args)
Tao Baod7db5942015-01-28 10:07:51 -0800560#define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, struct btrfs_ioctl_received_subvol_args)
Ben Cheng655a7c02013-10-16 16:09:24 -0700561#define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args)
Tao Baod7db5942015-01-28 10:07:51 -0800562#define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, struct btrfs_ioctl_vol_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800563/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700564#define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, struct btrfs_ioctl_quota_ctl_args)
Tao Baod7db5942015-01-28 10:07:51 -0800565#define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, struct btrfs_ioctl_qgroup_assign_args)
566#define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, struct btrfs_ioctl_qgroup_create_args)
Tao Baod7db5942015-01-28 10:07:51 -0800567#define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, struct btrfs_ioctl_qgroup_limit_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800568/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700569#define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args)
Tao Baod7db5942015-01-28 10:07:51 -0800570#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args)
Christopher Ferris38062f92014-07-09 15:33:25 -0700571#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
Tao Baod7db5942015-01-28 10:07:51 -0800572#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, char[BTRFS_LABEL_SIZE])
Christopher Ferris05d08e92016-02-04 13:16:38 -0800573/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700574#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, char[BTRFS_LABEL_SIZE])
Tao Baod7db5942015-01-28 10:07:51 -0800575#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, struct btrfs_ioctl_get_dev_stats)
576#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, struct btrfs_ioctl_dev_replace_args)
Tao Baod7db5942015-01-28 10:07:51 -0800577#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, struct btrfs_ioctl_same_args)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800578/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700579#define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags)
Tao Baod7db5942015-01-28 10:07:51 -0800580#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2])
581#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3])
Christopher Ferris106b3a82016-08-24 12:15:38 -0700582#define BTRFS_IOC_RM_DEV_V2 _IOW(BTRFS_IOCTL_MAGIC, 58, struct btrfs_ioctl_vol_args_v2)
583/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -0700584#endif