github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/fs_ioctl_btrfs.txt (about)

     1  # Copyright 2020 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/linux/btrfs.h>
     5  include <uapi/linux/btrfs_tree.h>
     6  include <linux/refcount.h>
     7  include <linux/spinlock_types.h>
     8  include <linux/types.h>
     9  include <linux/blk_types.h>
    10  include <linux/wait.h>
    11  include <fs/btrfs/compression.h>
    12  
    13  ioctl$BTRFS_IOC_SNAP_CREATE(fd fd, cmd const[BTRFS_IOC_SNAP_CREATE], arg ptr[in, btrfs_ioctl_vol_args])
    14  ioctl$BTRFS_IOC_SNAP_CREATE_V2(fd fd, cmd const[BTRFS_IOC_SNAP_CREATE_V2], arg ptr[in, btrfs_ioctl_vol_args_v2])
    15  ioctl$BTRFS_IOC_SUBVOL_CREATE(fd fd, cmd const[BTRFS_IOC_SUBVOL_CREATE], arg ptr[in, btrfs_ioctl_vol_args])
    16  ioctl$BTRFS_IOC_SUBVOL_CREATE_V2(fd fd, cmd const[BTRFS_IOC_SUBVOL_CREATE_V2], arg ptr[in, btrfs_ioctl_vol_args_v2])
    17  ioctl$BTRFS_IOC_SNAP_DESTROY(fd fd, cmd const[BTRFS_IOC_SNAP_DESTROY], arg ptr[in, btrfs_ioctl_vol_args])
    18  ioctl$BTRFS_IOC_SNAP_DESTROY_V2(fd fd, cmd const[BTRFS_IOC_SNAP_DESTROY_V2], arg ptr[in, btrfs_ioctl_vol_args_v2])
    19  ioctl$BTRFS_IOC_SUBVOL_GETFLAGS(fd fd, cmd const[BTRFS_IOC_SUBVOL_GETFLAGS], arg ptr[out, int64])
    20  ioctl$BTRFS_IOC_SUBVOL_SETFLAGS(fd fd, cmd const[BTRFS_IOC_SUBVOL_SETFLAGS], arg ptr[in, flags[btrfs_subvol_flags, int64]])
    21  ioctl$BTRFS_IOC_DEFAULT_SUBVOL(fd fd, cmd const[BTRFS_IOC_DEFAULT_SUBVOL], arg ptr[in, subvolid])
    22  ioctl$BTRFS_IOC_DEFRAG(fd fd, cmd const[BTRFS_IOC_DEFRAG], arg const[0])
    23  ioctl$BTRFS_IOC_DEFRAG_RANGE(fd fd, cmd const[BTRFS_IOC_DEFRAG_RANGE], arg ptr[in, btrfs_ioctl_defrag_range_args, opt])
    24  ioctl$BTRFS_IOC_RESIZE(fd fd, cmd const[BTRFS_IOC_RESIZE], arg ptr[in, btrfs_ioctl_resize_args])
    25  ioctl$BTRFS_IOC_ADD_DEV(fd fd, cmd const[BTRFS_IOC_ADD_DEV], arg ptr[in, btrfs_ioctl_vol_args])
    26  ioctl$BTRFS_IOC_RM_DEV(fd fd, cmd const[BTRFS_IOC_RM_DEV], arg ptr[in, btrfs_ioctl_vol_args])
    27  ioctl$BTRFS_IOC_RM_DEV_V2(fd fd, cmd const[BTRFS_IOC_RM_DEV_V2], arg ptr[in, btrfs_ioctl_vol_args_v2])
    28  ioctl$BTRFS_IOC_FS_INFO(fd fd, cmd const[BTRFS_IOC_FS_INFO], arg ptr[out, btrfs_ioctl_fs_info_args])
    29  ioctl$BTRFS_IOC_DEV_INFO(fd fd, cmd const[BTRFS_IOC_DEV_INFO], arg ptr[inout, btrfs_ioctl_dev_info_args])
    30  ioctl$BTRFS_IOC_BALANCE(fd fd, cmd const[BTRFS_IOC_BALANCE], arg const[0])
    31  ioctl$BTRFS_IOC_TREE_SEARCH(fd fd, cmd const[BTRFS_IOC_TREE_SEARCH], arg ptr[inout, btrfs_ioctl_search_args])
    32  ioctl$BTRFS_IOC_TREE_SEARCH_V2(fd fd, cmd const[BTRFS_IOC_TREE_SEARCH_V2], arg ptr[inout, btrfs_ioctl_search_args_v2])
    33  ioctl$BTRFS_IOC_INO_LOOKUP(fd fd, cmd const[BTRFS_IOC_INO_LOOKUP], arg ptr[in, btrfs_ioctl_ino_lookup_args])
    34  ioctl$BTRFS_IOC_INO_PATHS(fd fd, cmd const[BTRFS_IOC_INO_PATHS], arg ptr[inout, btrfs_ioctl_ino_path_args])
    35  ioctl$BTRFS_IOC_LOGICAL_INO(fd fd, cmd const[BTRFS_IOC_LOGICAL_INO], arg ptr[inout, btrfs_ioctl_logical_ino_args])
    36  ioctl$BTRFS_IOC_LOGICAL_INO_V2(fd fd, cmd const[BTRFS_IOC_LOGICAL_INO_V2], arg ptr[inout, btrfs_ioctl_logical_ino_args])
    37  ioctl$BTRFS_IOC_SPACE_INFO(fd fd, cmd const[BTRFS_IOC_SPACE_INFO], arg ptr[inout, btrfs_ioctl_space_args])
    38  ioctl$BTRFS_IOC_SYNC(fd fd, cmd const[BTRFS_IOC_SYNC], arg const[0])
    39  ioctl$BTRFS_IOC_START_SYNC(fd fd, cmd const[BTRFS_IOC_START_SYNC], arg ptr[out, transid])
    40  ioctl$BTRFS_IOC_WAIT_SYNC(fd fd, cmd const[BTRFS_IOC_WAIT_SYNC], arg ptr[in, transid, opt])
    41  ioctl$BTRFS_IOC_SCRUB(fd fd, cmd const[BTRFS_IOC_SCRUB], arg ptr[inout, btrfs_ioctl_scrub_args])
    42  ioctl$BTRFS_IOC_SCRUB_CANCEL(fd fd, cmd const[BTRFS_IOC_SCRUB_CANCEL], arg const[0])
    43  ioctl$BTRFS_IOC_SCRUB_PROGRESS(fd fd, cmd const[BTRFS_IOC_SCRUB_PROGRESS], arg ptr[inout, btrfs_ioctl_scrub_args])
    44  ioctl$BTRFS_IOC_BALANCE_V2(fd fd, cmd const[BTRFS_IOC_BALANCE_V2], arg ptr[inout, btrfs_ioctl_balance_args])
    45  ioctl$BTRFS_IOC_BALANCE_CTL(fd fd, cmd const[BTRFS_IOC_BALANCE_CTL], arg flags[btrfs_balance_ctl_values])
    46  ioctl$BTRFS_IOC_BALANCE_PROGRESS(fd fd, cmd const[BTRFS_IOC_BALANCE_PROGRESS], arg ptr[out, btrfs_ioctl_balance_args])
    47  ioctl$BTRFS_IOC_SET_RECEIVED_SUBVOL(fd fd, cmd const[BTRFS_IOC_SET_RECEIVED_SUBVOL], arg ptr[inout, btrfs_ioctl_received_subvol_args])
    48  ioctl$BTRFS_IOC_SEND(fd fd, cmd const[BTRFS_IOC_SEND], arg ptr[in, btrfs_ioctl_send_args])
    49  ioctl$BTRFS_IOC_GET_DEV_STATS(fd fd, cmd const[BTRFS_IOC_GET_DEV_STATS], arg ptr[inout, btrfs_ioctl_get_dev_stats])
    50  ioctl$BTRFS_IOC_QUOTA_CTL(fd fd, cmd const[BTRFS_IOC_QUOTA_CTL], arg ptr[in, btrfs_ioctl_quota_ctl_args])
    51  ioctl$BTRFS_IOC_QGROUP_ASSIGN(fd fd, cmd const[BTRFS_IOC_QGROUP_ASSIGN], arg ptr[in, btrfs_ioctl_qgroup_assign_args])
    52  ioctl$BTRFS_IOC_QGROUP_CREATE(fd fd, cmd const[BTRFS_IOC_QGROUP_CREATE], arg ptr[in, btrfs_ioctl_qgroup_create_args])
    53  ioctl$BTRFS_IOC_QGROUP_LIMIT(fd fd, cmd const[BTRFS_IOC_QGROUP_LIMIT], arg ptr[in, btrfs_ioctl_qgroup_limit_args])
    54  ioctl$BTRFS_IOC_QUOTA_RESCAN(fd fd, cmd const[BTRFS_IOC_QUOTA_RESCAN], arg ptr[in, btrfs_ioctl_quota_rescan_args])
    55  ioctl$BTRFS_IOC_QUOTA_RESCAN_STATUS(fd fd, cmd const[BTRFS_IOC_QUOTA_RESCAN_STATUS], arg ptr[out, btrfs_ioctl_quota_rescan_args])
    56  ioctl$BTRFS_IOC_QUOTA_RESCAN_WAIT(fd fd, cmd const[BTRFS_IOC_QUOTA_RESCAN_WAIT], arg const[0])
    57  ioctl$BTRFS_IOC_DEV_REPLACE(fd fd, cmd const[BTRFS_IOC_DEV_REPLACE], arg ptr[inout, btrfs_ioctl_dev_replace_args])
    58  ioctl$BTRFS_IOC_GET_SUPPORTED_FEATURES(fd fd, cmd const[BTRFS_IOC_GET_SUPPORTED_FEATURES], arg ptr[out, array[btrfs_ioctl_feature_flags, 3]])
    59  ioctl$BTRFS_IOC_GET_FEATURES(fd fd, cmd const[BTRFS_IOC_GET_FEATURES], arg ptr[out, btrfs_ioctl_feature_flags])
    60  ioctl$BTRFS_IOC_SET_FEATURES(fd fd, cmd const[BTRFS_IOC_SET_FEATURES], arg ptr[in, btrfs_ioctl_feature_flags])
    61  ioctl$BTRFS_IOC_GET_SUBVOL_INFO(fd fd, cmd const[BTRFS_IOC_GET_SUBVOL_INFO], arg ptr[out, btrfs_ioctl_get_subvol_info_args])
    62  ioctl$BTRFS_IOC_GET_SUBVOL_ROOTREF(fd fd, cmd const[BTRFS_IOC_GET_SUBVOL_ROOTREF], arg ptr[inout, btrfs_ioctl_get_subvol_rootref_args])
    63  ioctl$BTRFS_IOC_INO_LOOKUP_USER(fd fd, cmd const[BTRFS_IOC_INO_LOOKUP_USER], arg ptr[inout, btrfs_ioctl_ino_lookup_user_args])
    64  
    65  resource transid[int64]
    66  resource devid[int64]
    67  resource treeid[int64]
    68  resource dirid[int64]
    69  # These should be a resource but it's not returned by any syscall. So we temporarily describe them as type
    70  type qgroupid int64
    71  type objectid int64
    72  type subvolid objectid
    73  #NEED: uuid should be a resource
    74  
    75  define BTRFS_PATH_MAX	BTRFS_PATH_NAME_MAX+1 
    76  define BTRFS_SUBVOL_MAX	BTRFS_SUBVOL_NAME_MAX+1
    77  
    78  #The following two struct needs to be customized to fit the need of each specific ioctls calling them
    79  #But I still need more information in order to make the change
    80  btrfs_ioctl_vol_args {
    81  	fd	align64[fd]
    82  	name	array[int8, BTRFS_PATH_MAX]
    83  }
    84  
    85  btrfs_ioctl_vol_args_v2 {
    86  	fd	align64[fd]
    87  	transid	transid
    88  	flags	flags[btrfs_ioctl_vol_args_v2_flags, int64]
    89  	u1	btrfs_vol_args_v2_u1
    90  	u2	btrfs_vol_args_v2_u2
    91  }
    92  
    93  btrfs_vol_args_v2_u1 [
    94  	inherit	btrfs_vol_args_v2_u1_s1
    95  	unused	array[int64, 4]
    96  ]
    97  
    98  btrfs_vol_args_v2_u2 [
    99  	name		array[int8, BTRFS_SUBVOL_MAX]
   100  	devid		devid
   101  	subvolid	subvolid
   102  ]
   103  
   104  btrfs_vol_args_v2_u1_s1 {
   105  	size		bytesize[qgroup_inherit, int64]
   106  	qgroup_inherit	ptr[in, btrfs_qgroup_inherit]
   107  }
   108  
   109  btrfs_qgroup_inherit {
   110  	flags		flags[btrfs_qgroup_inherit_flags, int64]
   111  	num_qgroups	len[qgroups, int64]
   112  	num_ref_copies	int64
   113  	num_excl_copies	int64
   114  	lim		btrfs_qgroup_limit
   115  	qgroups		array[qgroupid]
   116  }
   117  
   118  btrfs_qgroup_limit {
   119  	flags		flags[btrfs_qgroup_limit_flags, int64]
   120  	max_rfer	int64
   121  	max_excl	int64
   122  	rsv_rfer	int64
   123  	rsv_excl	int64
   124  }
   125  
   126  btrfs_ioctl_defrag_range_args {
   127  	start		int64
   128  	len		int64
   129  	flags		flags[btrfs_ioctl_defrag_range_args_flags, int64]
   130  	extent_thresh	int32
   131  	compress_type	flags[btrfs_compression_type, int32]
   132  	unused		array[int32, 4]
   133  }
   134  
   135  btrfs_ioctl_fs_info_args {
   136  	max_id		const[0, int64]
   137  	num_devices	const[0, int64]
   138  	fsid		array[const[0, int8], BTRFS_FSID_SIZE]
   139  	nodesize	const[0, int32]
   140  	sectorize	const[0, int32]
   141  	clone_alignment	const[0, int32]
   142  	reserved32	const[0, int32]
   143  	reserved	array[const[0, int64], 122]
   144  }
   145  
   146  btrfs_ioctl_dev_info_args {
   147  	devid		devid
   148  	uuid		array[int8, BTRFS_UUID_SIZE]
   149  	bytes_used	const[0, int64]
   150  	total_bytes	const[0, int64]
   151  	unused		array[const[0, int64], 379]
   152  	path		array[const[0, int8], BTRFS_DEVICE_PATH_NAME_MAX]
   153  }
   154  
   155  btrfs_ioctl_search_args {
   156  	key	btrfs_ioctl_search_key
   157  	buf	array[const[0, int8], BTRFS_SEARCH_ARGS_BUFSIZE]
   158  }
   159  
   160  btrfs_ioctl_search_key {
   161  	tree_id		treeid
   162  	min_objectid	int64
   163  	max_objectid	int64
   164  	min_offset	int64
   165  	max_offset	int64
   166  	min_transid	int64
   167  	max_transid	int64
   168  	min_type	int32
   169  	max_type	int32
   170  	nr_items	int32
   171  	unused		int32
   172  	unused1		int64
   173  	unused2		int64
   174  	unused3		int64
   175  	unused4		int64
   176  }
   177  
   178  btrfs_ioctl_search_args_v2 {
   179  	key		btrfs_ioctl_search_key
   180  	buf_size	bytesize[buf, int64]
   181  	buf		array[const[0, int64]]
   182  }
   183  
   184  btrfs_ioctl_ino_lookup_args {
   185  	treeid		treeid
   186  	objectid	objectid
   187  	name		array[const[0, int8], BTRFS_INO_LOOKUP_PATH_MAX]
   188  }
   189  
   190  btrfs_ioctl_ino_path_args {
   191  	inum		int64
   192  	size		bytesize[fspath, int64]
   193  	reserved	array[int64, 4]
   194  	fspath		ptr64[out, array[const[0, int64]]]
   195  }
   196  
   197  btrfs_ioctl_logical_ino_args {
   198  	logical		int64
   199  	size		bytesize[inodes, int64]
   200  	reserved	array[const[0, int64], 3]
   201  	flags		flags[btrfs_ioctl_logical_ino_args_flags, int64]
   202  	inodes		ptr64[out, array[const[0, int64]]]
   203  }
   204  
   205  btrfs_ioctl_space_args {
   206  	space_slots	len[spaces, int64]
   207  	total_spaces	int64
   208  	spaces		array[array[const[0, int64], 3], 0:4096]
   209  }
   210  
   211  # btrfs_scrub_progress is ignored since that will only be used for out
   212  btrfs_ioctl_scrub_args {
   213  	devid	devid
   214  	start	int64
   215  	end	int64
   216  	flags	flags[btrfs_ioctl_scrub_args_flags, int64]
   217  	unused	array[const[0, int64], 124]
   218  }
   219  
   220  btrfs_ioctl_balance_args {
   221  	flags	flags[btrfs_ioctl_balance_args_flags, int64]
   222  	state	flags[btrfs_ioctl_balance_args_states, int64]
   223  	data	btrfs_balance_args
   224  	meta	btrfs_balance_args
   225  	sys	btrfs_balance_args
   226  	stat	btrfs_balance_progress
   227  	unused	array[const[0, int64], 72]
   228  }
   229  
   230  btrfs_balance_args_u [
   231  	usage	int64
   232  	struct	btrfs_balance_args_u_s1
   233  ]
   234  
   235  btrfs_balance_args_u_s1 {
   236  	usage_min	int32
   237  	usage_max	int32
   238  }
   239  
   240  btrfs_balance_args {
   241  	profiles	int64
   242  	union1		btrfs_balance_args_u
   243  	devid		devid
   244  	pstart		int64
   245  	pend		int64
   246  	vstart		int64
   247  	vend		int64
   248  	target		int64
   249  	flags		flags[btrfs_balance_args_flags, int64]
   250  	union2		btrfs_balance_args_u
   251  	stripes_min	int32
   252  	stripes_max	int32
   253  	unused		array[int64, 6]
   254  } [packed]
   255  
   256  btrfs_balance_progress {
   257  	expected	int64
   258  	considered	int64
   259  	completed	int64
   260  }
   261  
   262  btrfs_ioctl_received_subvol_args {
   263  	uuid		array[int8, BTRFS_UUID_SIZE]
   264  	stransid	transid
   265  	rtransid	transid
   266  	stime		btrfs_ioctl_timespec
   267  	rtime		btrfs_ioctl_timespec
   268  	flags		int64
   269  	reserved	array[int64, 16]
   270  }
   271  
   272  btrfs_ioctl_timespec {
   273  	sec	int64
   274  	msec	int32
   275  }
   276  
   277  btrfs_ioctl_send_args {
   278  	send_fd			padto64[fd]
   279  	clone_sources_count	len[clone_sources, int64]
   280  	clone_sources		ptr[in, array[subvolid]]
   281  	parent_root		int64
   282  	flags			flags[btrfs_ioctl_send_flags, int64]
   283  	version			int32[0:1]
   284  	reserved		array[const[0, int8], 28]
   285  }
   286  
   287  #This pads the struct to 1032 bytes. It was originally meant to pad to
   288  #1024 bytes, but when adding the flags field, the padding calculation
   289  #was not adjusted.
   290  define BTRFS_DEV_PAD	128-2-BTRFS_DEV_STAT_VALUES_MAX
   291  
   292  btrfs_ioctl_get_dev_stats {
   293  	devid		devid
   294  	nr_items	int64
   295  	flags		flags[btrfs_ioctl_get_dev_stats_flags, int64]
   296  	values		array[int64, BTRFS_DEV_STAT_VALUES_MAX]
   297  	unused		array[int64, BTRFS_DEV_PAD]
   298  }
   299  
   300  btrfs_ioctl_quota_ctl_args {
   301  	cmd	flags[btrfs_ioctl_quota_ctl_cmd, int64]
   302  	status	int64
   303  }
   304  
   305  btrfs_ioctl_qgroup_assign_args {
   306  	assign	bool64
   307  	src	qgroupid
   308  	dst	qgroupid
   309  }
   310  
   311  btrfs_ioctl_qgroup_create_args {
   312  	create		bool64
   313  	qgroupid	qgroupid
   314  }
   315  
   316  btrfs_ioctl_qgroup_limit_args {
   317  	qgroupid	qgroupid
   318  	lim		btrfs_qgroup_limit
   319  }
   320  
   321  btrfs_ioctl_quota_rescan_args {
   322  	flags		const[0, int64]
   323  	progress	int64
   324  	reserved	array[int64, 6]
   325  }
   326  
   327  btrfs_ioctl_dev_replace_args_u [
   328  	start	btrfs_ioctl_dev_replace_start_params
   329  	status	btrfs_ioctl_dev_replace_status_params
   330  ]
   331  
   332  btrfs_ioctl_dev_replace_args {
   333  	cmd	flags[btrfs_ioctl_dev_replace_args_cmd, int64]
   334  	result	int64
   335  	union1	btrfs_ioctl_dev_replace_args_u
   336  	spare	array[int64, 64]
   337  }
   338  
   339  define BTRFS_DEVICE_MAX	BTRFS_DEVICE_PATH_NAME_MAX + 1
   340  
   341  btrfs_ioctl_dev_replace_start_params {
   342  	srcdevid			devid
   343  	cont_reading_from_srcdev_mode	flags[cont_reading_from_srcdev_mode_flags, int64]
   344  	srcdev_name			array[int8, BTRFS_DEVICE_MAX]
   345  	tgtdev_name			array[int8, BTRFS_DEVICE_MAX]
   346  }
   347  
   348  #this structure is just for out, hence no need to describe
   349  btrfs_ioctl_dev_replace_status_params {
   350  	dummys	array[int64, 6]
   351  }
   352  
   353  btrfs_ioctl_feature_flags {
   354  	compat_flags	flags[btrfs_ioctl_feature_compat_flags, int64]
   355  	compat_ro_flags	flags[btrfs_ioctl_feature_compat_ro_flags, int64]
   356  	incompat_flags	flags[btrfs_ioctl_feature_incompat_flags, int64]
   357  }
   358  
   359  define BTRFS_VOL_MAX	BTRFS_VOL_NAME_MAX+1
   360  
   361  #described since the uuid, transid and treeid is going to be useful as resource
   362  btrfs_ioctl_get_subvol_info_args {
   363  	treeid		treeid
   364  	name		array[int8, BTRFS_VOL_MAX]
   365  	parent_id	treeid
   366  	dirid		dirid
   367  	generation	transid
   368  	flags		int64
   369  	uuid		array[int8, BTRFS_UUID_SIZE]
   370  	parent_uuid	array[int8, BTRFS_UUID_SIZE]
   371  	received_uuid	array[int8, BTRFS_UUID_SIZE]
   372  	ctransid	transid
   373  	otransid	transid
   374  	stransid	transid
   375  	rtransid	transid
   376  	ctime		btrfs_ioctl_timespec
   377  	otime		btrfs_ioctl_timespec
   378  	stime		btrfs_ioctl_timespec
   379  	rtime		btrfs_ioctl_timespec
   380  	reserved	array[const[0, int64], 8]
   381  }
   382  
   383  btrfs_ioctl_get_subvol_rootref_args {
   384  	min_treeid	int64
   385  	rootref		array[btrfs_ioctl_get_subvol_rootref_args_s1, BTRFS_MAX_ROOTREF_BUFFER_NUM]
   386  	num_items	int8
   387  	align		array[int8, 7]
   388  }
   389  
   390  btrfs_ioctl_get_subvol_rootref_args_s1 {
   391  	treeid	treeid
   392  	dirid	dirid
   393  }
   394  
   395  btrfs_ioctl_ino_lookup_user_args {
   396  	dirid	dirid
   397  	treeid	treeid
   398  	name	array[int8, BTRFS_VOL_MAX]
   399  	path	array[int8, BTRFS_INO_LOOKUP_USER_PATH_MAX]
   400  }
   401  
   402  btrfs_ioctl_resize_args {
   403  	fd	align64[fd]
   404  	name	btrfs_ioctl_resize_string
   405  }
   406  
   407  btrfs_ioctl_resize_string {
   408  	devid		optional[btrfs_devid_colon]
   409  	resize_num	btrfs_ioctl_resize_size
   410  } [packed]
   411  
   412  btrfs_devid_colon {
   413  	devid	fmt[dec, devid]
   414  	colon	const[':', int8]
   415  }
   416  
   417  btrfs_ioctl_resize_size [
   418  	actul_num	btrfs_ioctl_resize_size_num
   419  	max		stringnoz["max"]
   420  ] [varlen]
   421  
   422  btrfs_ioctl_resize_size_num {
   423  	plus_minus	optional[flags[plus_minus, int8]]
   424  	num		fmt[dec, int32]
   425  	kKmM		flags[all_these_kKmM, int8]
   426  } [packed]
   427  
   428  plus_minus = '+', '-'
   429  all_these_kKmM = 'k', 'K', 'm', 'M', 'g', 'G', 't', 'T', 'p', 'P', 'e', 'E'
   430  
   431  btrfs_ioctl_vol_args_v2_flags = BTRFS_SUBVOL_RDONLY, BTRFS_SUBVOL_QGROUP_INHERIT, BTRFS_DEVICE_SPEC_BY_ID, BTRFS_SUBVOL_SPEC_BY_ID
   432  btrfs_qgroup_inherit_flags = BTRFS_QGROUP_INHERIT_SET_LIMITS
   433  btrfs_qgroup_limit_flags = BTRFS_QGROUP_LIMIT_MAX_RFER, BTRFS_QGROUP_LIMIT_MAX_EXCL, BTRFS_QGROUP_LIMIT_RSV_RFER, BTRFS_QGROUP_LIMIT_RSV_EXCL, BTRFS_QGROUP_LIMIT_RFER_CMPR, BTRFS_QGROUP_LIMIT_EXCL_CMPR
   434  btrfs_subvol_flags = BTRFS_SUBVOL_RDONLY
   435  btrfs_ioctl_defrag_range_args_flags = BTRFS_DEFRAG_RANGE_COMPRESS, BTRFS_DEFRAG_RANGE_START_IO
   436  btrfs_compression_type = BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB, BTRFS_COMPRESS_LZO, BTRFS_COMPRESS_ZSTD
   437  btrfs_ioctl_logical_ino_args_flags = BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET
   438  btrfs_ioctl_scrub_args_flags = BTRFS_SCRUB_READONLY
   439  btrfs_balance_ctl_values = BTRFS_BALANCE_CTL_PAUSE, BTRFS_BALANCE_CTL_CANCEL
   440  btrfs_balance_args_flags = 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
   441  btrfs_ioctl_balance_args_states = BTRFS_BALANCE_STATE_RUNNING, BTRFS_BALANCE_STATE_PAUSE_REQ, BTRFS_BALANCE_STATE_CANCEL_REQ
   442  btrfs_ioctl_balance_args_flags = BTRFS_BALANCE_DATA, BTRFS_BALANCE_SYSTEM, BTRFS_BALANCE_METADATA, BTRFS_BALANCE_FORCE, BTRFS_BALANCE_RESUME
   443  btrfs_ioctl_send_flags = BTRFS_SEND_FLAG_NO_FILE_DATA, BTRFS_SEND_FLAG_OMIT_STREAM_HEADER, BTRFS_SEND_FLAG_OMIT_END_CMD, BTRFS_SEND_FLAG_VERSION
   444  btrfs_ioctl_get_dev_stats_flags = BTRFS_DEV_STATS_RESET
   445  btrfs_ioctl_quota_ctl_cmd = BTRFS_QUOTA_CTL_ENABLE, BTRFS_QUOTA_CTL_DISABLE, BTRFS_QUOTA_CTL_RESCAN__NOTUSED
   446  btrfs_ioctl_dev_replace_args_cmd = BTRFS_IOCTL_DEV_REPLACE_CMD_START, BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS, BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL, BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR, BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED, BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED, BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS
   447  cont_reading_from_srcdev_mode_flags = BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS, BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID
   448  btrfs_ioctl_feature_compat_flags = btrfs_ioctl_feature_compat_ro_flags
   449  btrfs_ioctl_feature_compat_ro_flags = BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE, BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID
   450  btrfs_ioctl_feature_incompat_flags = BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF, BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL, BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS, BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO, BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD