aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /fs/btrfs/ioctl.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'fs/btrfs/ioctl.h')
-rw-r--r--fs/btrfs/ioctl.h257
1 files changed, 3 insertions, 254 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h
index dabca9cc8c2..ad1ea789fcb 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -30,50 +30,17 @@ struct btrfs_ioctl_vol_args {
30 char name[BTRFS_PATH_NAME_MAX + 1]; 30 char name[BTRFS_PATH_NAME_MAX + 1];
31}; 31};
32 32
33#define BTRFS_DEVICE_PATH_NAME_MAX 1024
34
35#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) 33#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
36#define BTRFS_SUBVOL_RDONLY (1ULL << 1) 34#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
37#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
38#define BTRFS_FSID_SIZE 16 35#define BTRFS_FSID_SIZE 16
39#define BTRFS_UUID_SIZE 16 36#define BTRFS_UUID_SIZE 16
40 37
41#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
42
43struct btrfs_qgroup_limit {
44 __u64 flags;
45 __u64 max_rfer;
46 __u64 max_excl;
47 __u64 rsv_rfer;
48 __u64 rsv_excl;
49};
50
51struct btrfs_qgroup_inherit {
52 __u64 flags;
53 __u64 num_qgroups;
54 __u64 num_ref_copies;
55 __u64 num_excl_copies;
56 struct btrfs_qgroup_limit lim;
57 __u64 qgroups[0];
58};
59
60struct btrfs_ioctl_qgroup_limit_args {
61 __u64 qgroupid;
62 struct btrfs_qgroup_limit lim;
63};
64
65#define BTRFS_SUBVOL_NAME_MAX 4039 38#define BTRFS_SUBVOL_NAME_MAX 4039
66struct btrfs_ioctl_vol_args_v2 { 39struct btrfs_ioctl_vol_args_v2 {
67 __s64 fd; 40 __s64 fd;
68 __u64 transid; 41 __u64 transid;
69 __u64 flags; 42 __u64 flags;
70 union { 43 __u64 unused[4];
71 struct {
72 __u64 size;
73 struct btrfs_qgroup_inherit __user *qgroup_inherit;
74 };
75 __u64 unused[4];
76 };
77 char name[BTRFS_SUBVOL_NAME_MAX + 1]; 44 char name[BTRFS_SUBVOL_NAME_MAX + 1];
78}; 45};
79 46
@@ -125,48 +92,7 @@ struct btrfs_ioctl_scrub_args {
125 __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8]; 92 __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
126}; 93};
127 94
128#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0 95#define BTRFS_DEVICE_PATH_NAME_MAX 1024
129#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
130struct btrfs_ioctl_dev_replace_start_params {
131 __u64 srcdevid; /* in, if 0, use srcdev_name instead */
132 __u64 cont_reading_from_srcdev_mode; /* in, see #define
133 * above */
134 __u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
135 __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
136};
137
138#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
139#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
140#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
141#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
142#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
143struct btrfs_ioctl_dev_replace_status_params {
144 __u64 replace_state; /* out, see #define above */
145 __u64 progress_1000; /* out, 0 <= x <= 1000 */
146 __u64 time_started; /* out, seconds since 1-Jan-1970 */
147 __u64 time_stopped; /* out, seconds since 1-Jan-1970 */
148 __u64 num_write_errors; /* out */
149 __u64 num_uncorrectable_read_errors; /* out */
150};
151
152#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
153#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
154#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
155#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
156#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
157#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
158struct btrfs_ioctl_dev_replace_args {
159 __u64 cmd; /* in */
160 __u64 result; /* out */
161
162 union {
163 struct btrfs_ioctl_dev_replace_start_params start;
164 struct btrfs_ioctl_dev_replace_status_params status;
165 }; /* in/out */
166
167 __u64 spare[64];
168};
169
170struct btrfs_ioctl_dev_info_args { 96struct btrfs_ioctl_dev_info_args {
171 __u64 devid; /* in/out */ 97 __u64 devid; /* in/out */
172 __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */ 98 __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
@@ -183,55 +109,6 @@ struct btrfs_ioctl_fs_info_args {
183 __u64 reserved[124]; /* pad to 1k */ 109 __u64 reserved[124]; /* pad to 1k */
184}; 110};
185 111
186/* balance control ioctl modes */
187#define BTRFS_BALANCE_CTL_PAUSE 1
188#define BTRFS_BALANCE_CTL_CANCEL 2
189
190/*
191 * this is packed, because it should be exactly the same as its disk
192 * byte order counterpart (struct btrfs_disk_balance_args)
193 */
194struct btrfs_balance_args {
195 __u64 profiles;
196 __u64 usage;
197 __u64 devid;
198 __u64 pstart;
199 __u64 pend;
200 __u64 vstart;
201 __u64 vend;
202
203 __u64 target;
204
205 __u64 flags;
206
207 __u64 unused[8];
208} __attribute__ ((__packed__));
209
210/* report balance progress to userspace */
211struct btrfs_balance_progress {
212 __u64 expected; /* estimated # of chunks that will be
213 * relocated to fulfill the request */
214 __u64 considered; /* # of chunks we have considered so far */
215 __u64 completed; /* # of chunks relocated so far */
216};
217
218#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
219#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
220#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
221
222struct btrfs_ioctl_balance_args {
223 __u64 flags; /* in/out */
224 __u64 state; /* out */
225
226 struct btrfs_balance_args data; /* in/out */
227 struct btrfs_balance_args meta; /* in/out */
228 struct btrfs_balance_args sys; /* in/out */
229
230 struct btrfs_balance_progress stat; /* out */
231
232 __u64 unused[72]; /* pad to 1k */
233};
234
235#define BTRFS_INO_LOOKUP_PATH_MAX 4080 112#define BTRFS_INO_LOOKUP_PATH_MAX 4080
236struct btrfs_ioctl_ino_lookup_args { 113struct btrfs_ioctl_ino_lookup_args {
237 __u64 treeid; 114 __u64 treeid;
@@ -316,105 +193,6 @@ struct btrfs_ioctl_space_args {
316 struct btrfs_ioctl_space_info spaces[0]; 193 struct btrfs_ioctl_space_info spaces[0];
317}; 194};
318 195
319struct btrfs_data_container {
320 __u32 bytes_left; /* out -- bytes not needed to deliver output */
321 __u32 bytes_missing; /* out -- additional bytes needed for result */
322 __u32 elem_cnt; /* out */
323 __u32 elem_missed; /* out */
324 __u64 val[0]; /* out */
325};
326
327struct btrfs_ioctl_ino_path_args {
328 __u64 inum; /* in */
329 __u64 size; /* in */
330 __u64 reserved[4];
331 /* struct btrfs_data_container *fspath; out */
332 __u64 fspath; /* out */
333};
334
335struct btrfs_ioctl_logical_ino_args {
336 __u64 logical; /* in */
337 __u64 size; /* in */
338 __u64 reserved[4];
339 /* struct btrfs_data_container *inodes; out */
340 __u64 inodes;
341};
342
343enum btrfs_dev_stat_values {
344 /* disk I/O failure stats */
345 BTRFS_DEV_STAT_WRITE_ERRS, /* EIO or EREMOTEIO from lower layers */
346 BTRFS_DEV_STAT_READ_ERRS, /* EIO or EREMOTEIO from lower layers */
347 BTRFS_DEV_STAT_FLUSH_ERRS, /* EIO or EREMOTEIO from lower layers */
348
349 /* stats for indirect indications for I/O failures */
350 BTRFS_DEV_STAT_CORRUPTION_ERRS, /* checksum error, bytenr error or
351 * contents is illegal: this is an
352 * indication that the block was damaged
353 * during read or write, or written to
354 * wrong location or read from wrong
355 * location */
356 BTRFS_DEV_STAT_GENERATION_ERRS, /* an indication that blocks have not
357 * been written */
358
359 BTRFS_DEV_STAT_VALUES_MAX
360};
361
362/* Reset statistics after reading; needs SYS_ADMIN capability */
363#define BTRFS_DEV_STATS_RESET (1ULL << 0)
364
365struct btrfs_ioctl_get_dev_stats {
366 __u64 devid; /* in */
367 __u64 nr_items; /* in/out */
368 __u64 flags; /* in/out */
369
370 /* out values: */
371 __u64 values[BTRFS_DEV_STAT_VALUES_MAX];
372
373 __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */
374};
375
376#define BTRFS_QUOTA_CTL_ENABLE 1
377#define BTRFS_QUOTA_CTL_DISABLE 2
378#define BTRFS_QUOTA_CTL_RESCAN 3
379struct btrfs_ioctl_quota_ctl_args {
380 __u64 cmd;
381 __u64 status;
382};
383
384struct btrfs_ioctl_qgroup_assign_args {
385 __u64 assign;
386 __u64 src;
387 __u64 dst;
388};
389
390struct btrfs_ioctl_qgroup_create_args {
391 __u64 create;
392 __u64 qgroupid;
393};
394struct btrfs_ioctl_timespec {
395 __u64 sec;
396 __u32 nsec;
397};
398
399struct btrfs_ioctl_received_subvol_args {
400 char uuid[BTRFS_UUID_SIZE]; /* in */
401 __u64 stransid; /* in */
402 __u64 rtransid; /* out */
403 struct btrfs_ioctl_timespec stime; /* in */
404 struct btrfs_ioctl_timespec rtime; /* out */
405 __u64 flags; /* in */
406 __u64 reserved[16]; /* in */
407};
408
409struct btrfs_ioctl_send_args {
410 __s64 send_fd; /* in */
411 __u64 clone_sources_count; /* in */
412 __u64 __user *clone_sources; /* in */
413 __u64 parent_root; /* in */
414 __u64 flags; /* in */
415 __u64 reserved[4]; /* in */
416};
417
418#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ 196#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
419 struct btrfs_ioctl_vol_args) 197 struct btrfs_ioctl_vol_args)
420#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ 198#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -459,9 +237,7 @@ struct btrfs_ioctl_send_args {
459#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) 237#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
460#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ 238#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
461 struct btrfs_ioctl_vol_args_v2) 239 struct btrfs_ioctl_vol_args_v2)
462#define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, \ 240#define BTRFS_IOC_SUBVOL_GETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 25, __u64)
463 struct btrfs_ioctl_vol_args_v2)
464#define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
465#define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64) 241#define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
466#define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, \ 242#define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, \
467 struct btrfs_ioctl_scrub_args) 243 struct btrfs_ioctl_scrub_args)
@@ -472,31 +248,4 @@ struct btrfs_ioctl_send_args {
472 struct btrfs_ioctl_dev_info_args) 248 struct btrfs_ioctl_dev_info_args)
473#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \ 249#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \
474 struct btrfs_ioctl_fs_info_args) 250 struct btrfs_ioctl_fs_info_args)
475#define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, \
476 struct btrfs_ioctl_balance_args)
477#define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int)
478#define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, \
479 struct btrfs_ioctl_balance_args)
480#define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \
481 struct btrfs_ioctl_ino_path_args)
482#define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \
483 struct btrfs_ioctl_ino_path_args)
484#define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, \
485 struct btrfs_ioctl_received_subvol_args)
486#define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args)
487#define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \
488 struct btrfs_ioctl_vol_args)
489#define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, \
490 struct btrfs_ioctl_quota_ctl_args)
491#define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
492 struct btrfs_ioctl_qgroup_assign_args)
493#define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, \
494 struct btrfs_ioctl_qgroup_create_args)
495#define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, \
496 struct btrfs_ioctl_qgroup_limit_args)
497#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
498 struct btrfs_ioctl_get_dev_stats)
499#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
500 struct btrfs_ioctl_dev_replace_args)
501
502#endif 251#endif