btrfs.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /*
  2. * Copyright (C) 2007 Oracle. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License v2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public
  14. * License along with this program; if not, write to the
  15. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. * Boston, MA 021110-1307, USA.
  17. */
  18. #ifndef _UAPI_LINUX_BTRFS_H
  19. #define _UAPI_LINUX_BTRFS_H
  20. #include <linux/types.h>
  21. #include <linux/ioctl.h>
  22. #define BTRFS_IOCTL_MAGIC 0x94
  23. #define BTRFS_VOL_NAME_MAX 255
  24. /* this should be 4k */
  25. #define BTRFS_PATH_NAME_MAX 4087
  26. struct btrfs_ioctl_vol_args {
  27. __s64 fd;
  28. char name[BTRFS_PATH_NAME_MAX + 1];
  29. };
  30. #define BTRFS_DEVICE_PATH_NAME_MAX 1024
  31. #define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
  32. #define BTRFS_SUBVOL_RDONLY (1ULL << 1)
  33. #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
  34. #define BTRFS_FSID_SIZE 16
  35. #define BTRFS_UUID_SIZE 16
  36. #define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
  37. struct btrfs_qgroup_limit {
  38. __u64 flags;
  39. __u64 max_rfer;
  40. __u64 max_excl;
  41. __u64 rsv_rfer;
  42. __u64 rsv_excl;
  43. };
  44. struct btrfs_qgroup_inherit {
  45. __u64 flags;
  46. __u64 num_qgroups;
  47. __u64 num_ref_copies;
  48. __u64 num_excl_copies;
  49. struct btrfs_qgroup_limit lim;
  50. __u64 qgroups[0];
  51. };
  52. struct btrfs_ioctl_qgroup_limit_args {
  53. __u64 qgroupid;
  54. struct btrfs_qgroup_limit lim;
  55. };
  56. #define BTRFS_SUBVOL_NAME_MAX 4039
  57. struct btrfs_ioctl_vol_args_v2 {
  58. __s64 fd;
  59. __u64 transid;
  60. __u64 flags;
  61. union {
  62. struct {
  63. __u64 size;
  64. struct btrfs_qgroup_inherit __user *qgroup_inherit;
  65. };
  66. __u64 unused[4];
  67. };
  68. char name[BTRFS_SUBVOL_NAME_MAX + 1];
  69. };
  70. /*
  71. * structure to report errors and progress to userspace, either as a
  72. * result of a finished scrub, a canceled scrub or a progress inquiry
  73. */
  74. struct btrfs_scrub_progress {
  75. __u64 data_extents_scrubbed; /* # of data extents scrubbed */
  76. __u64 tree_extents_scrubbed; /* # of tree extents scrubbed */
  77. __u64 data_bytes_scrubbed; /* # of data bytes scrubbed */
  78. __u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */
  79. __u64 read_errors; /* # of read errors encountered (EIO) */
  80. __u64 csum_errors; /* # of failed csum checks */
  81. __u64 verify_errors; /* # of occurences, where the metadata
  82. * of a tree block did not match the
  83. * expected values, like generation or
  84. * logical */
  85. __u64 no_csum; /* # of 4k data block for which no csum
  86. * is present, probably the result of
  87. * data written with nodatasum */
  88. __u64 csum_discards; /* # of csum for which no data was found
  89. * in the extent tree. */
  90. __u64 super_errors; /* # of bad super blocks encountered */
  91. __u64 malloc_errors; /* # of internal kmalloc errors. These
  92. * will likely cause an incomplete
  93. * scrub */
  94. __u64 uncorrectable_errors; /* # of errors where either no intact
  95. * copy was found or the writeback
  96. * failed */
  97. __u64 corrected_errors; /* # of errors corrected */
  98. __u64 last_physical; /* last physical address scrubbed. In
  99. * case a scrub was aborted, this can
  100. * be used to restart the scrub */
  101. __u64 unverified_errors; /* # of occurences where a read for a
  102. * full (64k) bio failed, but the re-
  103. * check succeeded for each 4k piece.
  104. * Intermittent error. */
  105. };
  106. #define BTRFS_SCRUB_READONLY 1
  107. struct btrfs_ioctl_scrub_args {
  108. __u64 devid; /* in */
  109. __u64 start; /* in */
  110. __u64 end; /* in */
  111. __u64 flags; /* in */
  112. struct btrfs_scrub_progress progress; /* out */
  113. /* pad to 1k */
  114. __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
  115. };
  116. #define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
  117. #define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
  118. struct btrfs_ioctl_dev_replace_start_params {
  119. __u64 srcdevid; /* in, if 0, use srcdev_name instead */
  120. __u64 cont_reading_from_srcdev_mode; /* in, see #define
  121. * above */
  122. __u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
  123. __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
  124. };
  125. #define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
  126. #define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
  127. #define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
  128. #define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
  129. #define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
  130. struct btrfs_ioctl_dev_replace_status_params {
  131. __u64 replace_state; /* out, see #define above */
  132. __u64 progress_1000; /* out, 0 <= x <= 1000 */
  133. __u64 time_started; /* out, seconds since 1-Jan-1970 */
  134. __u64 time_stopped; /* out, seconds since 1-Jan-1970 */
  135. __u64 num_write_errors; /* out */
  136. __u64 num_uncorrectable_read_errors; /* out */
  137. };
  138. #define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
  139. #define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
  140. #define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
  141. #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
  142. #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
  143. #define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
  144. struct btrfs_ioctl_dev_replace_args {
  145. __u64 cmd; /* in */
  146. __u64 result; /* out */
  147. union {
  148. struct btrfs_ioctl_dev_replace_start_params start;
  149. struct btrfs_ioctl_dev_replace_status_params status;
  150. }; /* in/out */
  151. __u64 spare[64];
  152. };
  153. struct btrfs_ioctl_dev_info_args {
  154. __u64 devid; /* in/out */
  155. __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
  156. __u64 bytes_used; /* out */
  157. __u64 total_bytes; /* out */
  158. __u64 unused[379]; /* pad to 4k */
  159. __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
  160. };
  161. struct btrfs_ioctl_fs_info_args {
  162. __u64 max_id; /* out */
  163. __u64 num_devices; /* out */
  164. __u8 fsid[BTRFS_FSID_SIZE]; /* out */
  165. __u64 reserved[124]; /* pad to 1k */
  166. };
  167. /* balance control ioctl modes */
  168. #define BTRFS_BALANCE_CTL_PAUSE 1
  169. #define BTRFS_BALANCE_CTL_CANCEL 2
  170. /*
  171. * this is packed, because it should be exactly the same as its disk
  172. * byte order counterpart (struct btrfs_disk_balance_args)
  173. */
  174. struct btrfs_balance_args {
  175. __u64 profiles;
  176. __u64 usage;
  177. __u64 devid;
  178. __u64 pstart;
  179. __u64 pend;
  180. __u64 vstart;
  181. __u64 vend;
  182. __u64 target;
  183. __u64 flags;
  184. __u64 unused[8];
  185. } __attribute__ ((__packed__));
  186. /* report balance progress to userspace */
  187. struct btrfs_balance_progress {
  188. __u64 expected; /* estimated # of chunks that will be
  189. * relocated to fulfill the request */
  190. __u64 considered; /* # of chunks we have considered so far */
  191. __u64 completed; /* # of chunks relocated so far */
  192. };
  193. #define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
  194. #define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
  195. #define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
  196. struct btrfs_ioctl_balance_args {
  197. __u64 flags; /* in/out */
  198. __u64 state; /* out */
  199. struct btrfs_balance_args data; /* in/out */
  200. struct btrfs_balance_args meta; /* in/out */
  201. struct btrfs_balance_args sys; /* in/out */
  202. struct btrfs_balance_progress stat; /* out */
  203. __u64 unused[72]; /* pad to 1k */
  204. };
  205. #define BTRFS_INO_LOOKUP_PATH_MAX 4080
  206. struct btrfs_ioctl_ino_lookup_args {
  207. __u64 treeid;
  208. __u64 objectid;
  209. char name[BTRFS_INO_LOOKUP_PATH_MAX];
  210. };
  211. struct btrfs_ioctl_search_key {
  212. /* which root are we searching. 0 is the tree of tree roots */
  213. __u64 tree_id;
  214. /* keys returned will be >= min and <= max */
  215. __u64 min_objectid;
  216. __u64 max_objectid;
  217. /* keys returned will be >= min and <= max */
  218. __u64 min_offset;
  219. __u64 max_offset;
  220. /* max and min transids to search for */
  221. __u64 min_transid;
  222. __u64 max_transid;
  223. /* keys returned will be >= min and <= max */
  224. __u32 min_type;
  225. __u32 max_type;
  226. /*
  227. * how many items did userland ask for, and how many are we
  228. * returning
  229. */
  230. __u32 nr_items;
  231. /* align to 64 bits */
  232. __u32 unused;
  233. /* some extra for later */
  234. __u64 unused1;
  235. __u64 unused2;
  236. __u64 unused3;
  237. __u64 unused4;
  238. };
  239. struct btrfs_ioctl_search_header {
  240. __u64 transid;
  241. __u64 objectid;
  242. __u64 offset;
  243. __u32 type;
  244. __u32 len;
  245. };
  246. #define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
  247. /*
  248. * the buf is an array of search headers where
  249. * each header is followed by the actual item
  250. * the type field is expanded to 32 bits for alignment
  251. */
  252. struct btrfs_ioctl_search_args {
  253. struct btrfs_ioctl_search_key key;
  254. char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
  255. };
  256. struct btrfs_ioctl_clone_range_args {
  257. __s64 src_fd;
  258. __u64 src_offset, src_length;
  259. __u64 dest_offset;
  260. };
  261. /* flags for the defrag range ioctl */
  262. #define BTRFS_DEFRAG_RANGE_COMPRESS 1
  263. #define BTRFS_DEFRAG_RANGE_START_IO 2
  264. struct btrfs_ioctl_space_info {
  265. __u64 flags;
  266. __u64 total_bytes;
  267. __u64 used_bytes;
  268. };
  269. struct btrfs_ioctl_space_args {
  270. __u64 space_slots;
  271. __u64 total_spaces;
  272. struct btrfs_ioctl_space_info spaces[0];
  273. };
  274. struct btrfs_data_container {
  275. __u32 bytes_left; /* out -- bytes not needed to deliver output */
  276. __u32 bytes_missing; /* out -- additional bytes needed for result */
  277. __u32 elem_cnt; /* out */
  278. __u32 elem_missed; /* out */
  279. __u64 val[0]; /* out */
  280. };
  281. struct btrfs_ioctl_ino_path_args {
  282. __u64 inum; /* in */
  283. __u64 size; /* in */
  284. __u64 reserved[4];
  285. /* struct btrfs_data_container *fspath; out */
  286. __u64 fspath; /* out */
  287. };
  288. struct btrfs_ioctl_logical_ino_args {
  289. __u64 logical; /* in */
  290. __u64 size; /* in */
  291. __u64 reserved[4];
  292. /* struct btrfs_data_container *inodes; out */
  293. __u64 inodes;
  294. };
  295. enum btrfs_dev_stat_values {
  296. /* disk I/O failure stats */
  297. BTRFS_DEV_STAT_WRITE_ERRS, /* EIO or EREMOTEIO from lower layers */
  298. BTRFS_DEV_STAT_READ_ERRS, /* EIO or EREMOTEIO from lower layers */
  299. BTRFS_DEV_STAT_FLUSH_ERRS, /* EIO or EREMOTEIO from lower layers */
  300. /* stats for indirect indications for I/O failures */
  301. BTRFS_DEV_STAT_CORRUPTION_ERRS, /* checksum error, bytenr error or
  302. * contents is illegal: this is an
  303. * indication that the block was damaged
  304. * during read or write, or written to
  305. * wrong location or read from wrong
  306. * location */
  307. BTRFS_DEV_STAT_GENERATION_ERRS, /* an indication that blocks have not
  308. * been written */
  309. BTRFS_DEV_STAT_VALUES_MAX
  310. };
  311. /* Reset statistics after reading; needs SYS_ADMIN capability */
  312. #define BTRFS_DEV_STATS_RESET (1ULL << 0)
  313. struct btrfs_ioctl_get_dev_stats {
  314. __u64 devid; /* in */
  315. __u64 nr_items; /* in/out */
  316. __u64 flags; /* in/out */
  317. /* out values: */
  318. __u64 values[BTRFS_DEV_STAT_VALUES_MAX];
  319. __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */
  320. };
  321. #define BTRFS_QUOTA_CTL_ENABLE 1
  322. #define BTRFS_QUOTA_CTL_DISABLE 2
  323. #define BTRFS_QUOTA_CTL_RESCAN 3
  324. struct btrfs_ioctl_quota_ctl_args {
  325. __u64 cmd;
  326. __u64 status;
  327. };
  328. struct btrfs_ioctl_qgroup_assign_args {
  329. __u64 assign;
  330. __u64 src;
  331. __u64 dst;
  332. };
  333. struct btrfs_ioctl_qgroup_create_args {
  334. __u64 create;
  335. __u64 qgroupid;
  336. };
  337. struct btrfs_ioctl_timespec {
  338. __u64 sec;
  339. __u32 nsec;
  340. };
  341. struct btrfs_ioctl_received_subvol_args {
  342. char uuid[BTRFS_UUID_SIZE]; /* in */
  343. __u64 stransid; /* in */
  344. __u64 rtransid; /* out */
  345. struct btrfs_ioctl_timespec stime; /* in */
  346. struct btrfs_ioctl_timespec rtime; /* out */
  347. __u64 flags; /* in */
  348. __u64 reserved[16]; /* in */
  349. };
  350. /*
  351. * Caller doesn't want file data in the send stream, even if the
  352. * search of clone sources doesn't find an extent. UPDATE_EXTENT
  353. * commands will be sent instead of WRITE commands.
  354. */
  355. #define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
  356. struct btrfs_ioctl_send_args {
  357. __s64 send_fd; /* in */
  358. __u64 clone_sources_count; /* in */
  359. __u64 __user *clone_sources; /* in */
  360. __u64 parent_root; /* in */
  361. __u64 flags; /* in */
  362. __u64 reserved[4]; /* in */
  363. };
  364. #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
  365. struct btrfs_ioctl_vol_args)
  366. #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
  367. struct btrfs_ioctl_vol_args)
  368. #define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, \
  369. struct btrfs_ioctl_vol_args)
  370. #define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \
  371. struct btrfs_ioctl_vol_args)
  372. /* trans start and trans end are dangerous, and only for
  373. * use by applications that know how to avoid the
  374. * resulting deadlocks
  375. */
  376. #define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6)
  377. #define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7)
  378. #define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
  379. #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
  380. #define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, \
  381. struct btrfs_ioctl_vol_args)
  382. #define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, \
  383. struct btrfs_ioctl_vol_args)
  384. #define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \
  385. struct btrfs_ioctl_vol_args)
  386. #define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \
  387. struct btrfs_ioctl_clone_range_args)
  388. #define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
  389. struct btrfs_ioctl_vol_args)
  390. #define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \
  391. struct btrfs_ioctl_vol_args)
  392. #define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, \
  393. struct btrfs_ioctl_defrag_range_args)
  394. #define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
  395. struct btrfs_ioctl_search_args)
  396. #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
  397. struct btrfs_ioctl_ino_lookup_args)
  398. #define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64)
  399. #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
  400. struct btrfs_ioctl_space_args)
  401. #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
  402. #define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
  403. #define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
  404. struct btrfs_ioctl_vol_args_v2)
  405. #define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, \
  406. struct btrfs_ioctl_vol_args_v2)
  407. #define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
  408. #define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
  409. #define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, \
  410. struct btrfs_ioctl_scrub_args)
  411. #define BTRFS_IOC_SCRUB_CANCEL _IO(BTRFS_IOCTL_MAGIC, 28)
  412. #define BTRFS_IOC_SCRUB_PROGRESS _IOWR(BTRFS_IOCTL_MAGIC, 29, \
  413. struct btrfs_ioctl_scrub_args)
  414. #define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, \
  415. struct btrfs_ioctl_dev_info_args)
  416. #define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \
  417. struct btrfs_ioctl_fs_info_args)
  418. #define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, \
  419. struct btrfs_ioctl_balance_args)
  420. #define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int)
  421. #define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, \
  422. struct btrfs_ioctl_balance_args)
  423. #define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \
  424. struct btrfs_ioctl_ino_path_args)
  425. #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \
  426. struct btrfs_ioctl_ino_path_args)
  427. #define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, \
  428. struct btrfs_ioctl_received_subvol_args)
  429. #define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args)
  430. #define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \
  431. struct btrfs_ioctl_vol_args)
  432. #define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, \
  433. struct btrfs_ioctl_quota_ctl_args)
  434. #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
  435. struct btrfs_ioctl_qgroup_assign_args)
  436. #define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, \
  437. struct btrfs_ioctl_qgroup_create_args)
  438. #define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, \
  439. struct btrfs_ioctl_qgroup_limit_args)
  440. #define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \
  441. char[BTRFS_LABEL_SIZE])
  442. #define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
  443. char[BTRFS_LABEL_SIZE])
  444. #define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
  445. struct btrfs_ioctl_get_dev_stats)
  446. #define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
  447. struct btrfs_ioctl_dev_replace_args)
  448. #endif /* _UAPI_LINUX_BTRFS_H */