2007-06-12 13:07:11 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Oracle. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public
|
|
|
|
* License v2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 021110-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2015-01-21 16:49:26 +00:00
|
|
|
#ifndef __BTRFS_IOCTL_H__
|
|
|
|
#define __BTRFS_IOCTL_H__
|
|
|
|
|
2013-01-30 22:50:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-06-10 00:21:42 +00:00
|
|
|
#include <asm/types.h>
|
|
|
|
#include <linux/ioctl.h>
|
2016-11-14 15:43:15 +00:00
|
|
|
#include <stddef.h>
|
2015-06-10 00:21:42 +00:00
|
|
|
|
2015-06-03 14:52:05 +00:00
|
|
|
#ifndef __user
|
|
|
|
#define __user
|
|
|
|
#endif
|
|
|
|
|
2016-10-24 12:46:26 +00:00
|
|
|
/* We don't want to include entire kerncompat.h */
|
|
|
|
#ifndef BUILD_ASSERT
|
|
|
|
#define BUILD_ASSERT(x)
|
|
|
|
#endif
|
|
|
|
|
2007-04-10 13:27:30 +00:00
|
|
|
#define BTRFS_IOCTL_MAGIC 0x94
|
|
|
|
#define BTRFS_VOL_NAME_MAX 255
|
2008-03-24 19:04:49 +00:00
|
|
|
|
2011-07-18 12:37:22 +00:00
|
|
|
/* this should be 4k */
|
|
|
|
#define BTRFS_PATH_NAME_MAX 4087
|
2007-04-10 13:27:30 +00:00
|
|
|
struct btrfs_ioctl_vol_args {
|
2008-11-18 16:26:35 +00:00
|
|
|
__s64 fd;
|
2008-03-24 19:04:49 +00:00
|
|
|
char name[BTRFS_PATH_NAME_MAX + 1];
|
2007-04-10 13:27:30 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_vol_args) == 4096);
|
2007-04-10 13:27:30 +00:00
|
|
|
|
2012-05-07 12:00:20 +00:00
|
|
|
#define BTRFS_DEVICE_PATH_NAME_MAX 1024
|
|
|
|
|
2021-09-23 12:41:27 +00:00
|
|
|
/*
|
|
|
|
* Obsolete since 5.15, functionality removed in kernel 5.7:
|
|
|
|
* BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
|
|
|
|
*/
|
2011-04-26 08:02:40 +00:00
|
|
|
#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
|
2012-08-07 10:37:54 +00:00
|
|
|
#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
|
2016-03-14 08:31:49 +00:00
|
|
|
#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
|
2020-02-07 13:10:25 +00:00
|
|
|
#define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
|
2016-03-14 08:31:49 +00:00
|
|
|
|
|
|
|
#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
|
2021-09-23 12:41:27 +00:00
|
|
|
(BTRFS_SUBVOL_RDONLY | \
|
2016-03-14 08:31:49 +00:00
|
|
|
BTRFS_SUBVOL_QGROUP_INHERIT | \
|
2020-02-07 13:10:25 +00:00
|
|
|
BTRFS_DEVICE_SPEC_BY_ID | \
|
|
|
|
BTRFS_SUBVOL_SPEC_BY_ID)
|
2016-03-14 08:31:49 +00:00
|
|
|
|
2015-06-03 14:35:51 +00:00
|
|
|
#define BTRFS_FSID_SIZE 16
|
|
|
|
#define BTRFS_UUID_SIZE 16
|
2012-08-07 10:37:54 +00:00
|
|
|
|
|
|
|
#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
|
|
|
|
|
|
|
|
struct btrfs_qgroup_limit {
|
|
|
|
__u64 flags;
|
|
|
|
__u64 max_referenced;
|
|
|
|
__u64 max_exclusive;
|
|
|
|
__u64 rsv_referenced;
|
|
|
|
__u64 rsv_exclusive;
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_qgroup_limit) == 40);
|
2012-08-07 10:37:54 +00:00
|
|
|
|
|
|
|
struct btrfs_qgroup_inherit {
|
|
|
|
__u64 flags;
|
|
|
|
__u64 num_qgroups;
|
|
|
|
__u64 num_ref_copies;
|
|
|
|
__u64 num_excl_copies;
|
|
|
|
struct btrfs_qgroup_limit lim;
|
|
|
|
__u64 qgroups[0];
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_qgroup_inherit) == 72);
|
2012-08-07 10:37:54 +00:00
|
|
|
|
|
|
|
struct btrfs_ioctl_qgroup_limit_args {
|
|
|
|
__u64 qgroupid;
|
|
|
|
struct btrfs_qgroup_limit lim;
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_qgroup_limit_args) == 48);
|
2012-08-07 10:37:54 +00:00
|
|
|
|
2011-04-26 08:02:40 +00:00
|
|
|
#define BTRFS_SUBVOL_NAME_MAX 4039
|
|
|
|
struct btrfs_ioctl_vol_args_v2 {
|
|
|
|
__s64 fd;
|
|
|
|
__u64 transid;
|
|
|
|
__u64 flags;
|
2012-08-07 10:37:54 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
__u64 size;
|
2015-06-03 14:52:05 +00:00
|
|
|
struct btrfs_qgroup_inherit __user *qgroup_inherit;
|
2012-08-07 10:37:54 +00:00
|
|
|
};
|
|
|
|
__u64 unused[4];
|
|
|
|
};
|
2016-03-14 08:31:49 +00:00
|
|
|
union {
|
|
|
|
char name[BTRFS_SUBVOL_NAME_MAX + 1];
|
2016-03-29 21:34:48 +00:00
|
|
|
__u64 devid;
|
2020-02-07 13:10:25 +00:00
|
|
|
__u64 subvolid;
|
2016-03-14 08:31:49 +00:00
|
|
|
};
|
2011-04-26 08:02:40 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_vol_args_v2) == 4096);
|
2011-04-26 08:02:40 +00:00
|
|
|
|
2015-06-03 14:37:50 +00:00
|
|
|
/*
|
|
|
|
* structure to report errors and progress to userspace, either as a
|
|
|
|
* result of a finished scrub, a canceled scrub or a progress inquiry
|
|
|
|
*/
|
2011-07-18 12:37:22 +00:00
|
|
|
struct btrfs_scrub_progress {
|
2015-06-03 14:37:50 +00:00
|
|
|
__u64 data_extents_scrubbed; /* # of data extents scrubbed */
|
|
|
|
__u64 tree_extents_scrubbed; /* # of tree extents scrubbed */
|
|
|
|
__u64 data_bytes_scrubbed; /* # of data bytes scrubbed */
|
|
|
|
__u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */
|
|
|
|
__u64 read_errors; /* # of read errors encountered (EIO) */
|
|
|
|
__u64 csum_errors; /* # of failed csum checks */
|
2016-05-11 23:50:36 +00:00
|
|
|
__u64 verify_errors; /* # of occurrences, where the metadata
|
2015-06-03 14:37:50 +00:00
|
|
|
* of a tree block did not match the
|
|
|
|
* expected values, like generation or
|
|
|
|
* logical */
|
|
|
|
__u64 no_csum; /* # of 4k data block for which no csum
|
|
|
|
* is present, probably the result of
|
|
|
|
* data written with nodatasum */
|
|
|
|
__u64 csum_discards; /* # of csum for which no data was found
|
|
|
|
* in the extent tree. */
|
|
|
|
__u64 super_errors; /* # of bad super blocks encountered */
|
|
|
|
__u64 malloc_errors; /* # of internal kmalloc errors. These
|
|
|
|
* will likely cause an incomplete
|
|
|
|
* scrub */
|
|
|
|
__u64 uncorrectable_errors; /* # of errors where either no intact
|
|
|
|
* copy was found or the writeback
|
|
|
|
* failed */
|
|
|
|
__u64 corrected_errors; /* # of errors corrected */
|
|
|
|
__u64 last_physical; /* last physical address scrubbed. In
|
|
|
|
* case a scrub was aborted, this can
|
|
|
|
* be used to restart the scrub */
|
2016-05-11 23:50:36 +00:00
|
|
|
__u64 unverified_errors; /* # of occurrences where a read for a
|
2015-06-03 14:37:50 +00:00
|
|
|
* full (64k) bio failed, but the re-
|
|
|
|
* check succeeded for each 4k piece.
|
|
|
|
* Intermittent error. */
|
2011-07-18 12:37:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define BTRFS_SCRUB_READONLY 1
|
|
|
|
struct btrfs_ioctl_scrub_args {
|
|
|
|
__u64 devid; /* in */
|
|
|
|
__u64 start; /* in */
|
|
|
|
__u64 end; /* in */
|
|
|
|
__u64 flags; /* in */
|
|
|
|
struct btrfs_scrub_progress progress; /* out */
|
|
|
|
/* pad to 1k */
|
|
|
|
__u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_scrub_args) == 1024);
|
2011-07-18 12:37:22 +00:00
|
|
|
|
2012-05-07 12:00:20 +00:00
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
|
|
|
|
struct btrfs_ioctl_dev_replace_start_params {
|
|
|
|
__u64 srcdevid; /* in, if 0, use srcdev_name instead */
|
|
|
|
__u64 cont_reading_from_srcdev_mode; /* in, see #define
|
|
|
|
* above */
|
|
|
|
__u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
|
|
|
|
__u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_replace_start_params) == 2072);
|
2012-05-07 12:00:20 +00:00
|
|
|
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
|
|
|
|
struct btrfs_ioctl_dev_replace_status_params {
|
|
|
|
__u64 replace_state; /* out, see #define above */
|
|
|
|
__u64 progress_1000; /* out, 0 <= x <= 1000 */
|
|
|
|
__u64 time_started; /* out, seconds since 1-Jan-1970 */
|
|
|
|
__u64 time_stopped; /* out, seconds since 1-Jan-1970 */
|
|
|
|
__u64 num_write_errors; /* out */
|
|
|
|
__u64 num_uncorrectable_read_errors; /* out */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_replace_status_params) == 48);
|
2012-05-07 12:00:20 +00:00
|
|
|
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
|
2014-10-10 13:16:16 +00:00
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT -1
|
2012-05-07 12:00:20 +00:00
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
|
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
|
2014-10-13 04:42:13 +00:00
|
|
|
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS 3
|
2012-05-07 12:00:20 +00:00
|
|
|
struct btrfs_ioctl_dev_replace_args {
|
|
|
|
__u64 cmd; /* in */
|
|
|
|
__u64 result; /* out */
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct btrfs_ioctl_dev_replace_start_params start;
|
|
|
|
struct btrfs_ioctl_dev_replace_status_params status;
|
|
|
|
}; /* in/out */
|
|
|
|
|
|
|
|
__u64 spare[64];
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_replace_args) == 2600);
|
2012-05-07 12:00:20 +00:00
|
|
|
|
2011-07-18 12:37:22 +00:00
|
|
|
struct btrfs_ioctl_dev_info_args {
|
|
|
|
__u64 devid; /* in/out */
|
|
|
|
__u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
|
|
|
|
__u64 bytes_used; /* out */
|
|
|
|
__u64 total_bytes; /* out */
|
|
|
|
__u64 unused[379]; /* pad to 4k */
|
|
|
|
__u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_info_args) == 4096);
|
2011-07-18 12:37:22 +00:00
|
|
|
|
|
|
|
struct btrfs_ioctl_fs_info_args {
|
|
|
|
__u64 max_id; /* out */
|
|
|
|
__u64 num_devices; /* out */
|
|
|
|
__u8 fsid[BTRFS_FSID_SIZE]; /* out */
|
2015-06-03 17:35:54 +00:00
|
|
|
__u32 nodesize; /* out */
|
|
|
|
__u32 sectorsize; /* out */
|
|
|
|
__u32 clone_alignment; /* out */
|
|
|
|
__u32 reserved32;
|
|
|
|
__u64 reserved[122]; /* pad to 1k */
|
2011-07-18 12:37:22 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_fs_info_args) == 1024);
|
2011-07-18 12:37:22 +00:00
|
|
|
|
2015-06-03 17:36:36 +00:00
|
|
|
struct btrfs_ioctl_feature_flags {
|
|
|
|
__u64 compat_flags;
|
|
|
|
__u64 compat_ro_flags;
|
|
|
|
__u64 incompat_flags;
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_feature_flags) == 24);
|
2015-06-03 17:36:36 +00:00
|
|
|
|
2012-02-03 19:02:29 +00:00
|
|
|
/* balance control ioctl modes */
|
|
|
|
#define BTRFS_BALANCE_CTL_PAUSE 1
|
|
|
|
#define BTRFS_BALANCE_CTL_CANCEL 2
|
|
|
|
#define BTRFS_BALANCE_CTL_RESUME 3
|
|
|
|
|
|
|
|
/*
|
|
|
|
* this is packed, because it should be exactly the same as its disk
|
|
|
|
* byte order counterpart (struct btrfs_disk_balance_args)
|
|
|
|
*/
|
|
|
|
struct btrfs_balance_args {
|
|
|
|
__u64 profiles;
|
2015-10-22 08:19:38 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* usage filter
|
|
|
|
* BTRFS_BALANCE_ARGS_USAGE with a single value means '0..N'
|
|
|
|
* BTRFS_BALANCE_ARGS_USAGE_RANGE - range syntax, min..max
|
|
|
|
*/
|
|
|
|
union {
|
|
|
|
__u64 usage;
|
|
|
|
struct {
|
|
|
|
__u32 usage_min;
|
|
|
|
__u32 usage_max;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2012-02-03 19:02:29 +00:00
|
|
|
__u64 devid;
|
|
|
|
__u64 pstart;
|
|
|
|
__u64 pend;
|
|
|
|
__u64 vstart;
|
|
|
|
__u64 vend;
|
|
|
|
|
|
|
|
__u64 target;
|
|
|
|
|
|
|
|
__u64 flags;
|
|
|
|
|
2015-10-11 22:34:58 +00:00
|
|
|
/*
|
|
|
|
* BTRFS_BALANCE_ARGS_LIMIT with value 'limit'
|
|
|
|
* BTRFS_BALANCE_ARGS_LIMIT_RANGE - the extend version can use minimum
|
|
|
|
* and maximum
|
|
|
|
*/
|
|
|
|
union {
|
|
|
|
__u64 limit; /* limit number of processed chunks */
|
|
|
|
struct {
|
|
|
|
__u32 limit_min;
|
|
|
|
__u32 limit_max;
|
|
|
|
};
|
|
|
|
};
|
2015-09-28 22:33:04 +00:00
|
|
|
__u32 stripes_min;
|
|
|
|
__u32 stripes_max;
|
|
|
|
__u64 unused[6];
|
2012-02-03 19:02:29 +00:00
|
|
|
} __attribute__ ((__packed__));
|
|
|
|
|
2015-06-03 14:40:34 +00:00
|
|
|
/* report balance progress to userspace */
|
2012-02-03 19:02:29 +00:00
|
|
|
struct btrfs_balance_progress {
|
2015-06-03 14:40:34 +00:00
|
|
|
__u64 expected; /* estimated # of chunks that will be
|
2016-05-11 23:50:36 +00:00
|
|
|
* relocated to fulfil the request */
|
2015-06-03 14:40:34 +00:00
|
|
|
__u64 considered; /* # of chunks we have considered so far */
|
|
|
|
__u64 completed; /* # of chunks relocated so far */
|
2012-02-03 19:02:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
|
|
|
|
#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
|
|
|
|
#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
|
|
|
|
|
|
|
|
struct btrfs_ioctl_balance_args {
|
|
|
|
__u64 flags; /* in/out */
|
|
|
|
__u64 state; /* out */
|
|
|
|
|
|
|
|
struct btrfs_balance_args data; /* in/out */
|
|
|
|
struct btrfs_balance_args meta; /* in/out */
|
|
|
|
struct btrfs_balance_args sys; /* in/out */
|
|
|
|
|
|
|
|
struct btrfs_balance_progress stat; /* out */
|
|
|
|
|
|
|
|
__u64 unused[72]; /* pad to 1k */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_balance_args) == 1024);
|
2012-02-03 19:02:29 +00:00
|
|
|
|
2015-06-03 14:35:51 +00:00
|
|
|
#define BTRFS_INO_LOOKUP_PATH_MAX 4080
|
|
|
|
struct btrfs_ioctl_ino_lookup_args {
|
|
|
|
__u64 treeid;
|
|
|
|
__u64 objectid;
|
|
|
|
char name[BTRFS_INO_LOOKUP_PATH_MAX];
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_ino_lookup_args) == 4096);
|
2015-06-03 14:35:51 +00:00
|
|
|
|
2018-06-18 08:40:50 +00:00
|
|
|
#define BTRFS_INO_LOOKUP_USER_PATH_MAX (4080 - BTRFS_VOL_NAME_MAX - 1)
|
|
|
|
struct btrfs_ioctl_ino_lookup_user_args {
|
|
|
|
/* in, inode number containing the subvolume of 'subvolid' */
|
|
|
|
__u64 dirid;
|
|
|
|
/* in */
|
|
|
|
__u64 treeid;
|
|
|
|
/* out, name of the subvolume of 'treeid' */
|
|
|
|
char name[BTRFS_VOL_NAME_MAX + 1];
|
|
|
|
/*
|
|
|
|
* out, constructed path from the directory with which the ioctl is
|
|
|
|
* called to dirid
|
|
|
|
*/
|
|
|
|
char path[BTRFS_INO_LOOKUP_USER_PATH_MAX];
|
|
|
|
};
|
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_ino_lookup_user_args) == 4096);
|
|
|
|
|
2010-02-28 20:29:47 +00:00
|
|
|
struct btrfs_ioctl_search_key {
|
|
|
|
/* which root are we searching. 0 is the tree of tree roots */
|
|
|
|
__u64 tree_id;
|
|
|
|
|
|
|
|
/* keys returned will be >= min and <= max */
|
|
|
|
__u64 min_objectid;
|
|
|
|
__u64 max_objectid;
|
|
|
|
|
|
|
|
/* keys returned will be >= min and <= max */
|
|
|
|
__u64 min_offset;
|
|
|
|
__u64 max_offset;
|
|
|
|
|
|
|
|
/* max and min transids to search for */
|
|
|
|
__u64 min_transid;
|
|
|
|
__u64 max_transid;
|
|
|
|
|
|
|
|
/* keys returned will be >= min and <= max */
|
|
|
|
__u32 min_type;
|
|
|
|
__u32 max_type;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* how many items did userland ask for, and how many are we
|
|
|
|
* returning
|
|
|
|
*/
|
|
|
|
__u32 nr_items;
|
|
|
|
|
|
|
|
/* align to 64 bits */
|
|
|
|
__u32 unused;
|
|
|
|
|
|
|
|
/* some extra for later */
|
|
|
|
__u64 unused1;
|
|
|
|
__u64 unused2;
|
|
|
|
__u64 unused3;
|
|
|
|
__u64 unused4;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct btrfs_ioctl_search_header {
|
|
|
|
__u64 transid;
|
|
|
|
__u64 objectid;
|
|
|
|
__u64 offset;
|
|
|
|
__u32 type;
|
|
|
|
__u32 len;
|
2010-03-18 16:32:32 +00:00
|
|
|
} __attribute__((may_alias));
|
2010-02-28 20:29:47 +00:00
|
|
|
|
|
|
|
#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
|
|
|
|
/*
|
|
|
|
* the buf is an array of search headers where
|
|
|
|
* each header is followed by the actual item
|
|
|
|
* the type field is expanded to 32 bits for alignment
|
|
|
|
*/
|
|
|
|
struct btrfs_ioctl_search_args {
|
|
|
|
struct btrfs_ioctl_search_key key;
|
|
|
|
char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
|
|
|
|
};
|
|
|
|
|
2014-11-25 17:46:16 +00:00
|
|
|
/*
|
|
|
|
* Extended version of TREE_SEARCH ioctl that can return more than 4k of bytes.
|
|
|
|
* The allocated size of the buffer is set in buf_size.
|
|
|
|
*/
|
|
|
|
struct btrfs_ioctl_search_args_v2 {
|
|
|
|
struct btrfs_ioctl_search_key key; /* in/out - search parameters */
|
|
|
|
__u64 buf_size; /* in - size of buffer
|
|
|
|
* out - on EOVERFLOW: needed size
|
|
|
|
* to store item */
|
|
|
|
__u64 buf[0]; /* out - found items */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_search_args_v2) == 112);
|
2014-11-25 17:46:16 +00:00
|
|
|
|
2015-06-03 14:35:51 +00:00
|
|
|
/* With a @src_length of zero, the range from @src_offset->EOF is cloned! */
|
|
|
|
struct btrfs_ioctl_clone_range_args {
|
|
|
|
__s64 src_fd;
|
|
|
|
__u64 src_offset, src_length;
|
|
|
|
__u64 dest_offset;
|
2010-02-28 20:29:47 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_clone_range_args) == 32);
|
2010-02-28 20:29:47 +00:00
|
|
|
|
2010-03-11 14:38:52 +00:00
|
|
|
/* flags for the defrag range ioctl */
|
|
|
|
#define BTRFS_DEFRAG_RANGE_COMPRESS 1
|
|
|
|
#define BTRFS_DEFRAG_RANGE_START_IO 2
|
|
|
|
|
2015-06-03 14:42:51 +00:00
|
|
|
#define BTRFS_SAME_DATA_DIFFERS 1
|
|
|
|
/* For extent-same ioctl */
|
|
|
|
struct btrfs_ioctl_same_extent_info {
|
|
|
|
__s64 fd; /* in - destination file */
|
|
|
|
__u64 logical_offset; /* in - start of extent in destination */
|
|
|
|
__u64 bytes_deduped; /* out - total # of bytes we were able
|
|
|
|
* to dedupe from this file */
|
|
|
|
/* status of this dedupe operation:
|
|
|
|
* 0 if dedup succeeds
|
|
|
|
* < 0 for error
|
|
|
|
* == BTRFS_SAME_DATA_DIFFERS if data differs
|
|
|
|
*/
|
|
|
|
__s32 status; /* out - see above description */
|
|
|
|
__u32 reserved;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct btrfs_ioctl_same_args {
|
|
|
|
__u64 logical_offset; /* in - start of extent in source */
|
|
|
|
__u64 length; /* in - length of extent */
|
|
|
|
__u16 dest_count; /* in - total elements in info array */
|
|
|
|
__u16 reserved1;
|
|
|
|
__u32 reserved2;
|
|
|
|
struct btrfs_ioctl_same_extent_info info[0];
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_same_args) == 24);
|
2015-06-03 14:42:51 +00:00
|
|
|
|
2010-03-11 14:38:52 +00:00
|
|
|
struct btrfs_ioctl_defrag_range_args {
|
|
|
|
/* start of the defrag operation */
|
|
|
|
__u64 start;
|
|
|
|
|
|
|
|
/* number of bytes to defrag, use (u64)-1 to say all */
|
|
|
|
__u64 len;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* flags for the operation, which can include turning
|
|
|
|
* on compression for this one defrag
|
|
|
|
*/
|
|
|
|
__u64 flags;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* any extent bigger than this will be considered
|
|
|
|
* already defragged. Use 0 to take the kernel default
|
|
|
|
* Use 1 to say every single extent must be rewritten
|
|
|
|
*/
|
|
|
|
__u32 extent_thresh;
|
|
|
|
|
2010-11-18 03:49:56 +00:00
|
|
|
/*
|
|
|
|
* which compression method to use if turning on compression
|
|
|
|
* for this defrag operation. If unspecified, zlib will
|
|
|
|
* be used
|
|
|
|
*/
|
|
|
|
__u32 compress_type;
|
|
|
|
|
2010-03-11 14:38:52 +00:00
|
|
|
/* spare for later */
|
2010-11-18 03:49:56 +00:00
|
|
|
__u32 unused[4];
|
2010-03-11 14:38:52 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_defrag_range_args) == 48);
|
2010-03-11 14:38:52 +00:00
|
|
|
|
2010-01-13 18:21:23 +00:00
|
|
|
struct btrfs_ioctl_space_info {
|
|
|
|
__u64 flags;
|
|
|
|
__u64 total_bytes;
|
|
|
|
__u64 used_bytes;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct btrfs_ioctl_space_args {
|
|
|
|
__u64 space_slots;
|
|
|
|
__u64 total_spaces;
|
|
|
|
struct btrfs_ioctl_space_info spaces[0];
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_space_args) == 16);
|
2010-01-13 18:21:23 +00:00
|
|
|
|
2011-11-02 15:42:30 +00:00
|
|
|
struct btrfs_data_container {
|
|
|
|
__u32 bytes_left; /* out -- bytes not needed to deliver output */
|
|
|
|
__u32 bytes_missing; /* out -- additional bytes needed for result */
|
|
|
|
__u32 elem_cnt; /* out */
|
|
|
|
__u32 elem_missed; /* out */
|
|
|
|
__u64 val[0]; /* out */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct btrfs_ioctl_ino_path_args {
|
|
|
|
__u64 inum; /* in */
|
|
|
|
__u64 size; /* in */
|
|
|
|
__u64 reserved[4];
|
|
|
|
/* struct btrfs_data_container *fspath; out */
|
|
|
|
__u64 fspath; /* out */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_ino_path_args) == 56);
|
2011-11-02 15:42:30 +00:00
|
|
|
|
|
|
|
struct btrfs_ioctl_logical_ino_args {
|
|
|
|
__u64 logical; /* in */
|
|
|
|
__u64 size; /* in */
|
2019-11-27 03:55:06 +00:00
|
|
|
__u64 reserved[3];
|
|
|
|
__u64 flags; /* in */
|
2011-11-02 15:42:30 +00:00
|
|
|
/* struct btrfs_data_container *inodes; out */
|
|
|
|
__u64 inodes;
|
|
|
|
};
|
|
|
|
|
2019-11-27 03:55:06 +00:00
|
|
|
/*
|
|
|
|
* Return every ref to the extent, not just those containing logical block.
|
|
|
|
* Requires logical == extent bytenr.
|
|
|
|
*/
|
|
|
|
#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
|
|
|
|
|
2012-05-15 09:30:39 +00:00
|
|
|
enum btrfs_dev_stat_values {
|
|
|
|
/* disk I/O failure stats */
|
|
|
|
BTRFS_DEV_STAT_WRITE_ERRS, /* EIO or EREMOTEIO from lower layers */
|
|
|
|
BTRFS_DEV_STAT_READ_ERRS, /* EIO or EREMOTEIO from lower layers */
|
|
|
|
BTRFS_DEV_STAT_FLUSH_ERRS, /* EIO or EREMOTEIO from lower layers */
|
|
|
|
|
|
|
|
/* stats for indirect indications for I/O failures */
|
|
|
|
BTRFS_DEV_STAT_CORRUPTION_ERRS, /* checksum error, bytenr error or
|
|
|
|
* contents is illegal: this is an
|
|
|
|
* indication that the block was damaged
|
|
|
|
* during read or write, or written to
|
|
|
|
* wrong location or read from wrong
|
|
|
|
* location */
|
|
|
|
BTRFS_DEV_STAT_GENERATION_ERRS, /* an indication that blocks have not
|
|
|
|
* been written */
|
|
|
|
|
|
|
|
BTRFS_DEV_STAT_VALUES_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Reset statistics after reading; needs SYS_ADMIN capability */
|
|
|
|
#define BTRFS_DEV_STATS_RESET (1ULL << 0)
|
|
|
|
|
|
|
|
struct btrfs_ioctl_get_dev_stats {
|
|
|
|
__u64 devid; /* in */
|
|
|
|
__u64 nr_items; /* in/out */
|
|
|
|
__u64 flags; /* in/out */
|
|
|
|
|
|
|
|
/* out values: */
|
|
|
|
__u64 values[BTRFS_DEV_STAT_VALUES_MAX];
|
|
|
|
|
2016-10-04 22:01:31 +00:00
|
|
|
__u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k + 8B */
|
2012-05-15 09:30:39 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_get_dev_stats) == 1032);
|
2012-05-15 09:30:39 +00:00
|
|
|
|
2011-04-26 08:02:40 +00:00
|
|
|
/* BTRFS_IOC_SNAP_CREATE is no longer used by the btrfs command */
|
2013-04-05 11:44:06 +00:00
|
|
|
#define BTRFS_QUOTA_CTL_ENABLE 1
|
|
|
|
#define BTRFS_QUOTA_CTL_DISABLE 2
|
|
|
|
/* 3 has formerly been reserved for BTRFS_QUOTA_CTL_RESCAN */
|
|
|
|
struct btrfs_ioctl_quota_ctl_args {
|
|
|
|
__u64 cmd;
|
|
|
|
__u64 status;
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_quota_ctl_args) == 16);
|
2013-04-05 11:44:06 +00:00
|
|
|
|
|
|
|
struct btrfs_ioctl_quota_rescan_args {
|
|
|
|
__u64 flags;
|
|
|
|
__u64 progress;
|
2013-05-06 19:15:01 +00:00
|
|
|
__u64 reserved[6];
|
2013-04-05 11:44:06 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_quota_rescan_args) == 64);
|
2013-04-05 11:44:06 +00:00
|
|
|
|
|
|
|
struct btrfs_ioctl_qgroup_assign_args {
|
|
|
|
__u64 assign;
|
|
|
|
__u64 src;
|
|
|
|
__u64 dst;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct btrfs_ioctl_qgroup_create_args {
|
|
|
|
__u64 create;
|
|
|
|
__u64 qgroupid;
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_qgroup_create_args) == 16);
|
|
|
|
|
2015-06-03 14:35:51 +00:00
|
|
|
struct btrfs_ioctl_timespec {
|
|
|
|
__u64 sec;
|
|
|
|
__u32 nsec;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct btrfs_ioctl_received_subvol_args {
|
|
|
|
char uuid[BTRFS_UUID_SIZE]; /* in */
|
|
|
|
__u64 stransid; /* in */
|
|
|
|
__u64 rtransid; /* out */
|
|
|
|
struct btrfs_ioctl_timespec stime; /* in */
|
|
|
|
struct btrfs_ioctl_timespec rtime; /* out */
|
|
|
|
__u64 flags; /* in */
|
|
|
|
__u64 reserved[16]; /* in */
|
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_received_subvol_args) == 200);
|
2015-06-03 14:35:51 +00:00
|
|
|
|
2016-10-06 11:06:18 +00:00
|
|
|
/*
|
|
|
|
* If we have a 32-bit userspace and 64-bit kernel, then the UAPI
|
|
|
|
* structures are incorrect, as the timespec structure from userspace
|
|
|
|
* is 4 bytes too small. We define these alternatives here for backward
|
|
|
|
* compatibility, the kernel understands both values.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure size is different on 32bit and 64bit, has some padding if the
|
|
|
|
* structure is embedded. Packing makes sure the size is same on both, but will
|
|
|
|
* be misaligned on 64bit.
|
|
|
|
*
|
|
|
|
* NOTE: do not use in your code, this is for testing only
|
|
|
|
*/
|
|
|
|
struct btrfs_ioctl_timespec_32 {
|
|
|
|
__u64 sec;
|
|
|
|
__u32 nsec;
|
|
|
|
} __attribute__ ((__packed__));
|
|
|
|
|
|
|
|
struct btrfs_ioctl_received_subvol_args_32 {
|
|
|
|
char uuid[BTRFS_UUID_SIZE]; /* in */
|
|
|
|
__u64 stransid; /* in */
|
|
|
|
__u64 rtransid; /* out */
|
|
|
|
struct btrfs_ioctl_timespec_32 stime; /* in */
|
|
|
|
struct btrfs_ioctl_timespec_32 rtime; /* out */
|
|
|
|
__u64 flags; /* in */
|
|
|
|
__u64 reserved[16]; /* in */
|
|
|
|
} __attribute__ ((__packed__));
|
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_received_subvol_args_32) == 192);
|
|
|
|
|
|
|
|
#define BTRFS_IOC_SET_RECEIVED_SUBVOL_32_COMPAT_DEFINED 1
|
|
|
|
|
2015-06-03 14:35:51 +00:00
|
|
|
/*
|
|
|
|
* Caller doesn't want file data in the send stream, even if the
|
|
|
|
* search of clone sources doesn't find an extent. UPDATE_EXTENT
|
|
|
|
* commands will be sent instead of WRITE commands.
|
|
|
|
*/
|
|
|
|
#define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do not add the leading stream header. Used when multiple snapshots
|
|
|
|
* are sent back to back.
|
|
|
|
*/
|
|
|
|
#define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Omit the command at the end of the stream that indicated the end
|
|
|
|
* of the stream. This option is used when multiple snapshots are
|
|
|
|
* sent back to back.
|
|
|
|
*/
|
|
|
|
#define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
|
|
|
|
|
2022-03-17 17:25:52 +00:00
|
|
|
/*
|
|
|
|
* Read the protocol version in the structure
|
|
|
|
*/
|
|
|
|
#define BTRFS_SEND_FLAG_VERSION 0x8
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Send compressed data using the ENCODED_WRITE command instead of decompressing
|
|
|
|
* the data and sending it with the WRITE command. This requires protocol
|
|
|
|
* version >= 2.
|
|
|
|
*/
|
|
|
|
#define BTRFS_SEND_FLAG_COMPRESSED 0x10
|
|
|
|
|
2015-06-03 14:51:34 +00:00
|
|
|
#define BTRFS_SEND_FLAG_MASK \
|
|
|
|
(BTRFS_SEND_FLAG_NO_FILE_DATA | \
|
|
|
|
BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \
|
2022-03-17 17:25:52 +00:00
|
|
|
BTRFS_SEND_FLAG_OMIT_END_CMD | \
|
|
|
|
BTRFS_SEND_FLAG_VERSION | \
|
|
|
|
BTRFS_SEND_FLAG_COMPRESSED)
|
2015-06-03 14:51:34 +00:00
|
|
|
|
2015-06-03 14:35:51 +00:00
|
|
|
struct btrfs_ioctl_send_args {
|
|
|
|
__s64 send_fd; /* in */
|
|
|
|
__u64 clone_sources_count; /* in */
|
2015-06-03 14:52:05 +00:00
|
|
|
__u64 __user *clone_sources; /* in */
|
2015-06-03 14:35:51 +00:00
|
|
|
__u64 parent_root; /* in */
|
|
|
|
__u64 flags; /* in */
|
2022-03-17 17:25:52 +00:00
|
|
|
__u32 version; /* in */
|
|
|
|
__u8 reserved[28]; /* in */
|
2015-06-03 14:35:51 +00:00
|
|
|
};
|
2016-10-04 22:01:31 +00:00
|
|
|
/*
|
2016-10-06 11:11:17 +00:00
|
|
|
* Size of structure depends on pointer width, was not caught in the early
|
|
|
|
* days. Kernel handles pointer width differences transparently.
|
2016-10-04 22:01:31 +00:00
|
|
|
*/
|
|
|
|
BUILD_ASSERT(sizeof(__u64 *) == 8
|
|
|
|
? sizeof(struct btrfs_ioctl_send_args) == 72
|
|
|
|
: (sizeof(void *) == 4
|
|
|
|
? sizeof(struct btrfs_ioctl_send_args) == 68
|
|
|
|
: 0));
|
2015-06-03 14:35:51 +00:00
|
|
|
|
2016-10-06 11:11:17 +00:00
|
|
|
/*
|
|
|
|
* Different pointer width leads to structure size change. Kernel should accept
|
|
|
|
* both ioctl values (derived from the structures) for backward compatibility.
|
|
|
|
* Size of this structure is same on 32bit and 64bit though.
|
|
|
|
*
|
|
|
|
* NOTE: do not use in your code, this is for testing only
|
|
|
|
*/
|
|
|
|
struct btrfs_ioctl_send_args_64 {
|
|
|
|
__s64 send_fd; /* in */
|
|
|
|
__u64 clone_sources_count; /* in */
|
|
|
|
union {
|
|
|
|
__u64 __user *clone_sources; /* in */
|
|
|
|
__u64 __clone_sources_alignment;
|
|
|
|
};
|
|
|
|
__u64 parent_root; /* in */
|
|
|
|
__u64 flags; /* in */
|
|
|
|
__u64 reserved[4]; /* in */
|
|
|
|
} __attribute__((packed));
|
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_send_args_64) == 72);
|
|
|
|
|
|
|
|
#define BTRFS_IOC_SEND_64_COMPAT_DEFINED 1
|
|
|
|
|
2018-06-18 08:40:50 +00:00
|
|
|
/*
|
|
|
|
* Information about a fs tree root.
|
|
|
|
*
|
|
|
|
* All items are filled by the ioctl
|
|
|
|
*/
|
|
|
|
struct btrfs_ioctl_get_subvol_info_args {
|
|
|
|
/* Id of this subvolume */
|
|
|
|
__u64 treeid;
|
|
|
|
|
|
|
|
/* Name of this subvolume, used to get the real name at mount point */
|
|
|
|
char name[BTRFS_VOL_NAME_MAX + 1];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Id of the subvolume which contains this subvolume.
|
|
|
|
* Zero for top-level subvolume or a deleted subvolume.
|
|
|
|
*/
|
|
|
|
__u64 parent_id;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Inode number of the directory which contains this subvolume.
|
|
|
|
* Zero for top-level subvolume or a deleted subvolume
|
|
|
|
*/
|
|
|
|
__u64 dirid;
|
|
|
|
|
|
|
|
/* Latest transaction id of this subvolume */
|
|
|
|
__u64 generation;
|
|
|
|
|
|
|
|
/* Flags of this subvolume */
|
|
|
|
__u64 flags;
|
|
|
|
|
|
|
|
/* UUID of this subvolume */
|
|
|
|
__u8 uuid[BTRFS_UUID_SIZE];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* UUID of the subvolume of which this subvolume is a snapshot.
|
|
|
|
* All zero for a non-snapshot subvolume.
|
|
|
|
*/
|
|
|
|
__u8 parent_uuid[BTRFS_UUID_SIZE];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* UUID of the subvolume from which this subvolume was received.
|
|
|
|
* All zero for non-received subvolume.
|
|
|
|
*/
|
|
|
|
__u8 received_uuid[BTRFS_UUID_SIZE];
|
|
|
|
|
|
|
|
/* Transaction id indicating when change/create/send/receive happened */
|
|
|
|
__u64 ctransid;
|
|
|
|
__u64 otransid;
|
|
|
|
__u64 stransid;
|
|
|
|
__u64 rtransid;
|
|
|
|
/* Time corresponding to c/o/s/rtransid */
|
|
|
|
struct btrfs_ioctl_timespec ctime;
|
|
|
|
struct btrfs_ioctl_timespec otime;
|
|
|
|
struct btrfs_ioctl_timespec stime;
|
|
|
|
struct btrfs_ioctl_timespec rtime;
|
|
|
|
|
|
|
|
/* Must be zero */
|
|
|
|
__u64 reserved[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BTRFS_MAX_ROOTREF_BUFFER_NUM 255
|
|
|
|
struct btrfs_ioctl_get_subvol_rootref_args {
|
|
|
|
/* in/out, minimum id of rootref's treeid to be searched */
|
|
|
|
__u64 min_treeid;
|
|
|
|
|
|
|
|
/* out */
|
|
|
|
struct {
|
|
|
|
__u64 treeid;
|
|
|
|
__u64 dirid;
|
|
|
|
} rootref[BTRFS_MAX_ROOTREF_BUFFER_NUM];
|
|
|
|
|
|
|
|
/* out, number of found items */
|
|
|
|
__u8 num_items;
|
|
|
|
__u8 align[7];
|
|
|
|
};
|
|
|
|
BUILD_ASSERT(sizeof(struct btrfs_ioctl_get_subvol_rootref_args) == 4096);
|
|
|
|
|
2022-03-17 17:25:48 +00:00
|
|
|
/*
|
|
|
|
* Data and metadata for an encoded read or write.
|
|
|
|
*
|
|
|
|
* Encoded I/O bypasses any encoding automatically done by the filesystem (e.g.,
|
|
|
|
* compression). This can be used to read the compressed contents of a file or
|
|
|
|
* write pre-compressed data directly to a file.
|
|
|
|
*
|
|
|
|
* BTRFS_IOC_ENCODED_READ and BTRFS_IOC_ENCODED_WRITE are essentially
|
|
|
|
* preadv/pwritev with additional metadata about how the data is encoded and the
|
|
|
|
* size of the unencoded data.
|
|
|
|
*
|
|
|
|
* BTRFS_IOC_ENCODED_READ fills the given iovecs with the encoded data, fills
|
|
|
|
* the metadata fields, and returns the size of the encoded data. It reads one
|
|
|
|
* extent per call. It can also read data which is not encoded.
|
|
|
|
*
|
|
|
|
* BTRFS_IOC_ENCODED_WRITE uses the metadata fields, writes the encoded data
|
|
|
|
* from the iovecs, and returns the size of the encoded data. Note that the
|
|
|
|
* encoded data is not validated when it is written; if it is not valid (e.g.,
|
|
|
|
* it cannot be decompressed), then a subsequent read may return an error.
|
|
|
|
*
|
|
|
|
* Since the filesystem page cache contains decoded data, encoded I/O bypasses
|
|
|
|
* the page cache. Encoded I/O requires CAP_SYS_ADMIN.
|
|
|
|
*/
|
|
|
|
struct btrfs_ioctl_encoded_io_args {
|
|
|
|
/* Input parameters for both reads and writes. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* iovecs containing encoded data.
|
|
|
|
*
|
|
|
|
* For reads, if the size of the encoded data is larger than the sum of
|
|
|
|
* iov[n].iov_len for 0 <= n < iovcnt, then the ioctl fails with
|
|
|
|
* ENOBUFS.
|
|
|
|
*
|
|
|
|
* For writes, the size of the encoded data is the sum of iov[n].iov_len
|
|
|
|
* for 0 <= n < iovcnt. This must be less than 128 KiB (this limit may
|
|
|
|
* increase in the future). This must also be less than or equal to
|
|
|
|
* unencoded_len.
|
|
|
|
*/
|
|
|
|
const struct iovec __user *iov;
|
|
|
|
/* Number of iovecs. */
|
|
|
|
unsigned long iovcnt;
|
|
|
|
/*
|
|
|
|
* Offset in file.
|
|
|
|
*
|
|
|
|
* For writes, must be aligned to the sector size of the filesystem.
|
|
|
|
*/
|
|
|
|
__s64 offset;
|
|
|
|
/* Currently must be zero. */
|
|
|
|
__u64 flags;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For reads, the following members are output parameters that will
|
|
|
|
* contain the returned metadata for the encoded data.
|
|
|
|
* For writes, the following members must be set to the metadata for the
|
|
|
|
* encoded data.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Length of the data in the file.
|
|
|
|
*
|
|
|
|
* Must be less than or equal to unencoded_len - unencoded_offset. For
|
|
|
|
* writes, must be aligned to the sector size of the filesystem unless
|
|
|
|
* the data ends at or beyond the current end of the file.
|
|
|
|
*/
|
|
|
|
__u64 len;
|
|
|
|
/*
|
|
|
|
* Length of the unencoded (i.e., decrypted and decompressed) data.
|
|
|
|
*
|
|
|
|
* For writes, must be no more than 128 KiB (this limit may increase in
|
|
|
|
* the future). If the unencoded data is actually longer than
|
|
|
|
* unencoded_len, then it is truncated; if it is shorter, then it is
|
|
|
|
* extended with zeroes.
|
|
|
|
*/
|
|
|
|
__u64 unencoded_len;
|
|
|
|
/*
|
|
|
|
* Offset from the first byte of the unencoded data to the first byte of
|
|
|
|
* logical data in the file.
|
|
|
|
*
|
|
|
|
* Must be less than unencoded_len.
|
|
|
|
*/
|
|
|
|
__u64 unencoded_offset;
|
|
|
|
/*
|
|
|
|
* BTRFS_ENCODED_IO_COMPRESSION_* type.
|
|
|
|
*
|
|
|
|
* For writes, must not be BTRFS_ENCODED_IO_COMPRESSION_NONE.
|
|
|
|
*/
|
|
|
|
__u32 compression;
|
|
|
|
/* Currently always BTRFS_ENCODED_IO_ENCRYPTION_NONE. */
|
|
|
|
__u32 encryption;
|
|
|
|
/*
|
|
|
|
* Reserved for future expansion.
|
|
|
|
*
|
|
|
|
* For reads, always returned as zero. Users should check for non-zero
|
|
|
|
* bytes. If there are any, then the kernel has a newer version of this
|
|
|
|
* structure with additional information that the user definition is
|
|
|
|
* missing.
|
|
|
|
*
|
|
|
|
* For writes, must be zeroed.
|
|
|
|
*/
|
|
|
|
__u8 reserved[64];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Data is not compressed. */
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_NONE 0
|
|
|
|
/* Data is compressed as a single zlib stream. */
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_ZLIB 1
|
|
|
|
/*
|
|
|
|
* Data is compressed as a single zstd frame with the windowLog compression
|
|
|
|
* parameter set to no more than 17.
|
|
|
|
*/
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_ZSTD 2
|
|
|
|
/*
|
|
|
|
* Data is compressed sector by sector (using the sector size indicated by the
|
|
|
|
* name of the constant) with LZO1X and wrapped in the format documented in
|
|
|
|
* fs/btrfs/lzo.c. For writes, the compression sector size must match the
|
|
|
|
* filesystem sector size.
|
|
|
|
*/
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_LZO_4K 3
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_LZO_8K 4
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_LZO_16K 5
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_LZO_32K 6
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_LZO_64K 7
|
|
|
|
#define BTRFS_ENCODED_IO_COMPRESSION_TYPES 8
|
|
|
|
|
|
|
|
/* Data is not encrypted. */
|
|
|
|
#define BTRFS_ENCODED_IO_ENCRYPTION_NONE 0
|
|
|
|
#define BTRFS_ENCODED_IO_ENCRYPTION_TYPES 1
|
|
|
|
|
2013-07-15 05:30:53 +00:00
|
|
|
/* Error codes as returned by the kernel */
|
|
|
|
enum btrfs_err_code {
|
|
|
|
notused,
|
|
|
|
BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET,
|
|
|
|
BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
|
|
|
|
BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
|
|
|
|
BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
|
|
|
|
BTRFS_ERROR_DEV_TGT_REPLACE,
|
|
|
|
BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
|
|
|
|
BTRFS_ERROR_DEV_ONLY_WRITABLE,
|
2019-10-31 18:43:17 +00:00
|
|
|
BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS,
|
|
|
|
BTRFS_ERROR_DEV_RAID1C3_MIN_NOT_MET,
|
|
|
|
BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET,
|
2013-07-15 05:30:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* An error code to error string mapping for the kernel
|
|
|
|
* error codes
|
|
|
|
*/
|
|
|
|
static inline char *btrfs_err_str(enum btrfs_err_code err_code)
|
|
|
|
{
|
|
|
|
switch (err_code) {
|
|
|
|
case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
|
|
|
|
return "unable to go below two devices on raid1";
|
2020-03-31 19:10:42 +00:00
|
|
|
case BTRFS_ERROR_DEV_RAID1C3_MIN_NOT_MET:
|
|
|
|
return "unable to go below three devices on raid1c3";
|
|
|
|
case BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET:
|
|
|
|
return "unable to go below four devices on raid1c4";
|
2013-07-15 05:30:53 +00:00
|
|
|
case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
|
2021-07-22 22:49:16 +00:00
|
|
|
return "unable to go below four/two devices on raid10";
|
2013-07-15 05:30:53 +00:00
|
|
|
case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
|
2014-04-10 03:55:36 +00:00
|
|
|
return "unable to go below two devices on raid5";
|
2013-07-15 05:30:53 +00:00
|
|
|
case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
|
2014-04-10 03:55:36 +00:00
|
|
|
return "unable to go below three devices on raid6";
|
2013-07-15 05:30:53 +00:00
|
|
|
case BTRFS_ERROR_DEV_TGT_REPLACE:
|
|
|
|
return "unable to remove the dev_replace target dev";
|
|
|
|
case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
|
|
|
|
return "no missing devices found to remove";
|
|
|
|
case BTRFS_ERROR_DEV_ONLY_WRITABLE:
|
|
|
|
return "unable to remove the only writeable device";
|
|
|
|
case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
|
|
|
|
return "add/delete/balance/replace/resize operation "
|
|
|
|
"in progress";
|
|
|
|
default:
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:27:30 +00:00
|
|
|
#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2007-08-07 20:15:59 +00:00
|
|
|
#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
|
2007-04-12 14:51:51 +00:00
|
|
|
struct btrfs_ioctl_vol_args)
|
2007-12-21 21:25:35 +00:00
|
|
|
#define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2008-03-24 19:04:49 +00:00
|
|
|
#define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2019-01-04 05:31:52 +00:00
|
|
|
#define BTRFS_IOC_FORGET_DEV _IOW(BTRFS_IOCTL_MAGIC, 5, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2021-06-12 20:39:14 +00:00
|
|
|
/*
|
|
|
|
* Removed in kernel since 4.17:
|
|
|
|
* BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6)
|
|
|
|
* BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7)
|
2008-06-10 14:09:18 +00:00
|
|
|
*/
|
2021-06-12 20:39:14 +00:00
|
|
|
|
2008-06-10 14:09:18 +00:00
|
|
|
#define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
|
|
|
|
|
2008-05-02 15:05:21 +00:00
|
|
|
#define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int)
|
2008-04-28 20:44:22 +00:00
|
|
|
#define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
|
|
|
#define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
|
|
|
#define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2015-06-03 14:35:51 +00:00
|
|
|
|
2012-06-20 16:42:19 +00:00
|
|
|
#define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \
|
|
|
|
struct btrfs_ioctl_clone_range_args)
|
2015-06-03 14:35:51 +00:00
|
|
|
|
2008-11-18 16:26:35 +00:00
|
|
|
#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2009-09-21 20:03:57 +00:00
|
|
|
#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2010-03-11 14:38:52 +00:00
|
|
|
#define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, \
|
|
|
|
struct btrfs_ioctl_defrag_range_args)
|
2010-02-28 20:29:47 +00:00
|
|
|
#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
|
|
|
|
struct btrfs_ioctl_search_args)
|
2014-11-25 17:46:16 +00:00
|
|
|
#define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
|
|
|
|
struct btrfs_ioctl_search_args_v2)
|
2010-02-28 20:29:47 +00:00
|
|
|
#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
|
|
|
|
struct btrfs_ioctl_ino_lookup_args)
|
2014-03-10 23:39:48 +00:00
|
|
|
#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
|
2010-01-13 18:21:23 +00:00
|
|
|
#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
|
|
|
|
struct btrfs_ioctl_space_args)
|
2013-12-12 18:11:26 +00:00
|
|
|
#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
|
|
|
|
#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
|
2011-04-26 08:02:40 +00:00
|
|
|
#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
|
|
|
|
struct btrfs_ioctl_vol_args_v2)
|
2012-08-07 10:37:54 +00:00
|
|
|
#define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, \
|
|
|
|
struct btrfs_ioctl_vol_args_v2)
|
2012-06-25 23:13:31 +00:00
|
|
|
#define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64)
|
|
|
|
#define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64)
|
2011-07-18 12:37:22 +00:00
|
|
|
#define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, \
|
|
|
|
struct btrfs_ioctl_scrub_args)
|
|
|
|
#define BTRFS_IOC_SCRUB_CANCEL _IO(BTRFS_IOCTL_MAGIC, 28)
|
|
|
|
#define BTRFS_IOC_SCRUB_PROGRESS _IOWR(BTRFS_IOCTL_MAGIC, 29, \
|
|
|
|
struct btrfs_ioctl_scrub_args)
|
|
|
|
#define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, \
|
|
|
|
struct btrfs_ioctl_dev_info_args)
|
|
|
|
#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \
|
2011-11-02 15:42:30 +00:00
|
|
|
struct btrfs_ioctl_fs_info_args)
|
2012-02-03 19:02:29 +00:00
|
|
|
#define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, \
|
|
|
|
struct btrfs_ioctl_balance_args)
|
|
|
|
#define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int)
|
|
|
|
#define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, \
|
|
|
|
struct btrfs_ioctl_balance_args)
|
2011-11-02 15:42:30 +00:00
|
|
|
#define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \
|
|
|
|
struct btrfs_ioctl_ino_path_args)
|
|
|
|
#define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \
|
2016-07-03 21:22:26 +00:00
|
|
|
struct btrfs_ioctl_logical_ino_args)
|
2012-07-25 16:01:24 +00:00
|
|
|
#define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, \
|
|
|
|
struct btrfs_ioctl_received_subvol_args)
|
2016-10-06 11:06:18 +00:00
|
|
|
|
|
|
|
#ifdef BTRFS_IOC_SET_RECEIVED_SUBVOL_32_COMPAT_DEFINED
|
|
|
|
#define BTRFS_IOC_SET_RECEIVED_SUBVOL_32 _IOWR(BTRFS_IOCTL_MAGIC, 37, \
|
|
|
|
struct btrfs_ioctl_received_subvol_args_32)
|
|
|
|
#endif
|
|
|
|
|
2016-10-06 11:11:17 +00:00
|
|
|
#ifdef BTRFS_IOC_SEND_64_COMPAT_DEFINED
|
|
|
|
#define BTRFS_IOC_SEND_64 _IOW(BTRFS_IOCTL_MAGIC, 38, \
|
|
|
|
struct btrfs_ioctl_send_args_64)
|
|
|
|
#endif
|
|
|
|
|
2012-06-20 16:44:04 +00:00
|
|
|
#define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args)
|
2015-06-03 14:35:51 +00:00
|
|
|
#define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \
|
|
|
|
struct btrfs_ioctl_vol_args)
|
2012-08-07 10:37:54 +00:00
|
|
|
#define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, \
|
|
|
|
struct btrfs_ioctl_quota_ctl_args)
|
|
|
|
#define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
|
|
|
|
struct btrfs_ioctl_qgroup_assign_args)
|
|
|
|
#define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, \
|
|
|
|
struct btrfs_ioctl_qgroup_create_args)
|
|
|
|
#define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, \
|
|
|
|
struct btrfs_ioctl_qgroup_limit_args)
|
2013-04-05 11:44:06 +00:00
|
|
|
#define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
|
|
|
|
struct btrfs_ioctl_quota_rescan_args)
|
|
|
|
#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
|
|
|
|
struct btrfs_ioctl_quota_rescan_args)
|
2013-05-06 19:15:18 +00:00
|
|
|
#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
|
2012-12-17 11:35:23 +00:00
|
|
|
#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \
|
|
|
|
char[BTRFS_LABEL_SIZE])
|
|
|
|
#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
|
|
|
|
char[BTRFS_LABEL_SIZE])
|
2012-05-15 09:30:39 +00:00
|
|
|
#define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
|
|
|
|
struct btrfs_ioctl_get_dev_stats)
|
2012-05-07 12:00:20 +00:00
|
|
|
#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
|
|
|
|
struct btrfs_ioctl_dev_replace_args)
|
2015-06-03 14:42:51 +00:00
|
|
|
#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
|
|
|
|
struct btrfs_ioctl_same_args)
|
2013-12-19 04:08:56 +00:00
|
|
|
#define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
|
|
|
|
struct btrfs_ioctl_feature_flags)
|
|
|
|
#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
|
|
|
|
struct btrfs_ioctl_feature_flags[2])
|
|
|
|
#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
|
|
|
|
struct btrfs_ioctl_feature_flags[3])
|
2016-03-14 08:31:49 +00:00
|
|
|
#define BTRFS_IOC_RM_DEV_V2 _IOW(BTRFS_IOCTL_MAGIC, 58, \
|
|
|
|
struct btrfs_ioctl_vol_args_v2)
|
2019-11-27 03:55:06 +00:00
|
|
|
#define BTRFS_IOC_LOGICAL_INO_V2 _IOWR(BTRFS_IOCTL_MAGIC, 59, \
|
|
|
|
struct btrfs_ioctl_logical_ino_args)
|
2018-06-18 08:40:50 +00:00
|
|
|
#define BTRFS_IOC_GET_SUBVOL_INFO _IOR(BTRFS_IOCTL_MAGIC, 60, \
|
|
|
|
struct btrfs_ioctl_get_subvol_info_args)
|
|
|
|
#define BTRFS_IOC_GET_SUBVOL_ROOTREF _IOWR(BTRFS_IOCTL_MAGIC, 61, \
|
|
|
|
struct btrfs_ioctl_get_subvol_rootref_args)
|
|
|
|
#define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \
|
|
|
|
struct btrfs_ioctl_ino_lookup_user_args)
|
2020-02-07 13:10:25 +00:00
|
|
|
#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \
|
|
|
|
struct btrfs_ioctl_vol_args_v2)
|
2022-03-17 17:25:48 +00:00
|
|
|
#define BTRFS_IOC_ENCODED_READ _IOR(BTRFS_IOCTL_MAGIC, 64, \
|
|
|
|
struct btrfs_ioctl_encoded_io_args)
|
|
|
|
#define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \
|
|
|
|
struct btrfs_ioctl_encoded_io_args)
|
2020-02-07 13:10:25 +00:00
|
|
|
|
2013-01-30 22:50:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-04-10 13:27:30 +00:00
|
|
|
#endif
|