Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: btrfs.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* Copyright (C) 2007 Oracle. All rights reserved.
[2] Fix | Delete
*
[3] Fix | Delete
* This program is free software; you can redistribute it and/or
[4] Fix | Delete
* modify it under the terms of the GNU General Public
[5] Fix | Delete
* License v2 as published by the Free Software Foundation.
[6] Fix | Delete
*
[7] Fix | Delete
* This program is distributed in the hope that it will be useful,
[8] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[9] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[10] Fix | Delete
* General Public License for more details.
[11] Fix | Delete
*
[12] Fix | Delete
* You should have received a copy of the GNU General Public
[13] Fix | Delete
* License along with this program; if not, write to the
[14] Fix | Delete
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
[15] Fix | Delete
* Boston, MA 021110-1307, USA.
[16] Fix | Delete
*/
[17] Fix | Delete
[18] Fix | Delete
#ifndef _LINUX_BTRFS_H
[19] Fix | Delete
#define _LINUX_BTRFS_H
[20] Fix | Delete
#include <linux/types.h>
[21] Fix | Delete
#include <linux/ioctl.h>
[22] Fix | Delete
[23] Fix | Delete
#define BTRFS_IOCTL_MAGIC 0x94
[24] Fix | Delete
#define BTRFS_VOL_NAME_MAX 255
[25] Fix | Delete
#define BTRFS_LABEL_SIZE 256
[26] Fix | Delete
[27] Fix | Delete
/* this should be 4k */
[28] Fix | Delete
#define BTRFS_PATH_NAME_MAX 4087
[29] Fix | Delete
struct btrfs_ioctl_vol_args {
[30] Fix | Delete
__s64 fd;
[31] Fix | Delete
char name[BTRFS_PATH_NAME_MAX + 1];
[32] Fix | Delete
};
[33] Fix | Delete
[34] Fix | Delete
#define BTRFS_DEVICE_PATH_NAME_MAX 1024
[35] Fix | Delete
#define BTRFS_SUBVOL_NAME_MAX 4039
[36] Fix | Delete
[37] Fix | Delete
#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
[38] Fix | Delete
#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
[39] Fix | Delete
#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
[40] Fix | Delete
[41] Fix | Delete
#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
[42] Fix | Delete
[43] Fix | Delete
#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
[44] Fix | Delete
(BTRFS_SUBVOL_CREATE_ASYNC | \
[45] Fix | Delete
BTRFS_SUBVOL_RDONLY | \
[46] Fix | Delete
BTRFS_SUBVOL_QGROUP_INHERIT | \
[47] Fix | Delete
BTRFS_DEVICE_SPEC_BY_ID)
[48] Fix | Delete
[49] Fix | Delete
#define BTRFS_FSID_SIZE 16
[50] Fix | Delete
#define BTRFS_UUID_SIZE 16
[51] Fix | Delete
#define BTRFS_UUID_UNPARSED_SIZE 37
[52] Fix | Delete
[53] Fix | Delete
/*
[54] Fix | Delete
* flags definition for qgroup limits
[55] Fix | Delete
*
[56] Fix | Delete
* Used by:
[57] Fix | Delete
* struct btrfs_qgroup_limit.flags
[58] Fix | Delete
* struct btrfs_qgroup_limit_item.flags
[59] Fix | Delete
*/
[60] Fix | Delete
#define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0)
[61] Fix | Delete
#define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1)
[62] Fix | Delete
#define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2)
[63] Fix | Delete
#define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3)
[64] Fix | Delete
#define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4)
[65] Fix | Delete
#define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5)
[66] Fix | Delete
[67] Fix | Delete
struct btrfs_qgroup_limit {
[68] Fix | Delete
__u64 flags;
[69] Fix | Delete
__u64 max_rfer;
[70] Fix | Delete
__u64 max_excl;
[71] Fix | Delete
__u64 rsv_rfer;
[72] Fix | Delete
__u64 rsv_excl;
[73] Fix | Delete
};
[74] Fix | Delete
[75] Fix | Delete
/*
[76] Fix | Delete
* flags definition for qgroup inheritance
[77] Fix | Delete
*
[78] Fix | Delete
* Used by:
[79] Fix | Delete
* struct btrfs_qgroup_inherit.flags
[80] Fix | Delete
*/
[81] Fix | Delete
#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
[82] Fix | Delete
[83] Fix | Delete
struct btrfs_qgroup_inherit {
[84] Fix | Delete
__u64 flags;
[85] Fix | Delete
__u64 num_qgroups;
[86] Fix | Delete
__u64 num_ref_copies;
[87] Fix | Delete
__u64 num_excl_copies;
[88] Fix | Delete
struct btrfs_qgroup_limit lim;
[89] Fix | Delete
__u64 qgroups[0];
[90] Fix | Delete
};
[91] Fix | Delete
[92] Fix | Delete
struct btrfs_ioctl_qgroup_limit_args {
[93] Fix | Delete
__u64 qgroupid;
[94] Fix | Delete
struct btrfs_qgroup_limit lim;
[95] Fix | Delete
};
[96] Fix | Delete
[97] Fix | Delete
/*
[98] Fix | Delete
* flags for subvolumes
[99] Fix | Delete
*
[100] Fix | Delete
* Used by:
[101] Fix | Delete
* struct btrfs_ioctl_vol_args_v2.flags
[102] Fix | Delete
*
[103] Fix | Delete
* BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:
[104] Fix | Delete
* - BTRFS_IOC_SUBVOL_GETFLAGS
[105] Fix | Delete
* - BTRFS_IOC_SUBVOL_SETFLAGS
[106] Fix | Delete
*/
[107] Fix | Delete
[108] Fix | Delete
struct btrfs_ioctl_vol_args_v2 {
[109] Fix | Delete
__s64 fd;
[110] Fix | Delete
__u64 transid;
[111] Fix | Delete
__u64 flags;
[112] Fix | Delete
union {
[113] Fix | Delete
struct {
[114] Fix | Delete
__u64 size;
[115] Fix | Delete
struct btrfs_qgroup_inherit *qgroup_inherit;
[116] Fix | Delete
};
[117] Fix | Delete
__u64 unused[4];
[118] Fix | Delete
};
[119] Fix | Delete
union {
[120] Fix | Delete
char name[BTRFS_SUBVOL_NAME_MAX + 1];
[121] Fix | Delete
__u64 devid;
[122] Fix | Delete
};
[123] Fix | Delete
};
[124] Fix | Delete
[125] Fix | Delete
/*
[126] Fix | Delete
* structure to report errors and progress to userspace, either as a
[127] Fix | Delete
* result of a finished scrub, a canceled scrub or a progress inquiry
[128] Fix | Delete
*/
[129] Fix | Delete
struct btrfs_scrub_progress {
[130] Fix | Delete
__u64 data_extents_scrubbed; /* # of data extents scrubbed */
[131] Fix | Delete
__u64 tree_extents_scrubbed; /* # of tree extents scrubbed */
[132] Fix | Delete
__u64 data_bytes_scrubbed; /* # of data bytes scrubbed */
[133] Fix | Delete
__u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */
[134] Fix | Delete
__u64 read_errors; /* # of read errors encountered (EIO) */
[135] Fix | Delete
__u64 csum_errors; /* # of failed csum checks */
[136] Fix | Delete
__u64 verify_errors; /* # of occurences, where the metadata
[137] Fix | Delete
* of a tree block did not match the
[138] Fix | Delete
* expected values, like generation or
[139] Fix | Delete
* logical */
[140] Fix | Delete
__u64 no_csum; /* # of 4k data block for which no csum
[141] Fix | Delete
* is present, probably the result of
[142] Fix | Delete
* data written with nodatasum */
[143] Fix | Delete
__u64 csum_discards; /* # of csum for which no data was found
[144] Fix | Delete
* in the extent tree. */
[145] Fix | Delete
__u64 super_errors; /* # of bad super blocks encountered */
[146] Fix | Delete
__u64 malloc_errors; /* # of internal kmalloc errors. These
[147] Fix | Delete
* will likely cause an incomplete
[148] Fix | Delete
* scrub */
[149] Fix | Delete
__u64 uncorrectable_errors; /* # of errors where either no intact
[150] Fix | Delete
* copy was found or the writeback
[151] Fix | Delete
* failed */
[152] Fix | Delete
__u64 corrected_errors; /* # of errors corrected */
[153] Fix | Delete
__u64 last_physical; /* last physical address scrubbed. In
[154] Fix | Delete
* case a scrub was aborted, this can
[155] Fix | Delete
* be used to restart the scrub */
[156] Fix | Delete
__u64 unverified_errors; /* # of occurences where a read for a
[157] Fix | Delete
* full (64k) bio failed, but the re-
[158] Fix | Delete
* check succeeded for each 4k piece.
[159] Fix | Delete
* Intermittent error. */
[160] Fix | Delete
};
[161] Fix | Delete
[162] Fix | Delete
#define BTRFS_SCRUB_READONLY 1
[163] Fix | Delete
struct btrfs_ioctl_scrub_args {
[164] Fix | Delete
__u64 devid; /* in */
[165] Fix | Delete
__u64 start; /* in */
[166] Fix | Delete
__u64 end; /* in */
[167] Fix | Delete
__u64 flags; /* in */
[168] Fix | Delete
struct btrfs_scrub_progress progress; /* out */
[169] Fix | Delete
/* pad to 1k */
[170] Fix | Delete
__u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8];
[171] Fix | Delete
};
[172] Fix | Delete
[173] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
[174] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
[175] Fix | Delete
struct btrfs_ioctl_dev_replace_start_params {
[176] Fix | Delete
__u64 srcdevid; /* in, if 0, use srcdev_name instead */
[177] Fix | Delete
__u64 cont_reading_from_srcdev_mode; /* in, see #define
[178] Fix | Delete
* above */
[179] Fix | Delete
__u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
[180] Fix | Delete
__u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */
[181] Fix | Delete
};
[182] Fix | Delete
[183] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0
[184] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1
[185] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2
[186] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3
[187] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4
[188] Fix | Delete
struct btrfs_ioctl_dev_replace_status_params {
[189] Fix | Delete
__u64 replace_state; /* out, see #define above */
[190] Fix | Delete
__u64 progress_1000; /* out, 0 <= x <= 1000 */
[191] Fix | Delete
__u64 time_started; /* out, seconds since 1-Jan-1970 */
[192] Fix | Delete
__u64 time_stopped; /* out, seconds since 1-Jan-1970 */
[193] Fix | Delete
__u64 num_write_errors; /* out */
[194] Fix | Delete
__u64 num_uncorrectable_read_errors; /* out */
[195] Fix | Delete
};
[196] Fix | Delete
[197] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
[198] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
[199] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
[200] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
[201] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
[202] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2
[203] Fix | Delete
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS 3
[204] Fix | Delete
struct btrfs_ioctl_dev_replace_args {
[205] Fix | Delete
__u64 cmd; /* in */
[206] Fix | Delete
__u64 result; /* out */
[207] Fix | Delete
[208] Fix | Delete
union {
[209] Fix | Delete
struct btrfs_ioctl_dev_replace_start_params start;
[210] Fix | Delete
struct btrfs_ioctl_dev_replace_status_params status;
[211] Fix | Delete
}; /* in/out */
[212] Fix | Delete
[213] Fix | Delete
__u64 spare[64];
[214] Fix | Delete
};
[215] Fix | Delete
[216] Fix | Delete
struct btrfs_ioctl_dev_info_args {
[217] Fix | Delete
__u64 devid; /* in/out */
[218] Fix | Delete
__u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
[219] Fix | Delete
__u64 bytes_used; /* out */
[220] Fix | Delete
__u64 total_bytes; /* out */
[221] Fix | Delete
__u64 unused[379]; /* pad to 4k */
[222] Fix | Delete
__u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
[223] Fix | Delete
};
[224] Fix | Delete
[225] Fix | Delete
struct btrfs_ioctl_fs_info_args {
[226] Fix | Delete
__u64 max_id; /* out */
[227] Fix | Delete
__u64 num_devices; /* out */
[228] Fix | Delete
__u8 fsid[BTRFS_FSID_SIZE]; /* out */
[229] Fix | Delete
__u32 nodesize; /* out */
[230] Fix | Delete
__u32 sectorsize; /* out */
[231] Fix | Delete
__u32 clone_alignment; /* out */
[232] Fix | Delete
__u32 reserved32;
[233] Fix | Delete
__u64 reserved[122]; /* pad to 1k */
[234] Fix | Delete
};
[235] Fix | Delete
[236] Fix | Delete
/*
[237] Fix | Delete
* feature flags
[238] Fix | Delete
*
[239] Fix | Delete
* Used by:
[240] Fix | Delete
* struct btrfs_ioctl_feature_flags
[241] Fix | Delete
*/
[242] Fix | Delete
#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0)
[243] Fix | Delete
/*
[244] Fix | Delete
* Older kernels (< 4.9) on big-endian systems produced broken free space tree
[245] Fix | Delete
* bitmaps, and btrfs-progs also used to corrupt the free space tree (versions
[246] Fix | Delete
* < 4.7.3). If this bit is clear, then the free space tree cannot be trusted.
[247] Fix | Delete
* btrfs-progs can also intentionally clear this bit to ask the kernel to
[248] Fix | Delete
* rebuild the free space tree, however this might not work on older kernels
[249] Fix | Delete
* that do not know about this bit. If not sure, clear the cache manually on
[250] Fix | Delete
* first mount when booting older kernel versions.
[251] Fix | Delete
*/
[252] Fix | Delete
#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
[253] Fix | Delete
[254] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
[255] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
[256] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
[257] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3)
[258] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD (1ULL << 4)
[259] Fix | Delete
[260] Fix | Delete
/*
[261] Fix | Delete
* older kernels tried to do bigger metadata blocks, but the
[262] Fix | Delete
* code was pretty buggy. Lets not let them try anymore.
[263] Fix | Delete
*/
[264] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5)
[265] Fix | Delete
[266] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6)
[267] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
[268] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
[269] Fix | Delete
#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
[270] Fix | Delete
[271] Fix | Delete
struct btrfs_ioctl_feature_flags {
[272] Fix | Delete
__u64 compat_flags;
[273] Fix | Delete
__u64 compat_ro_flags;
[274] Fix | Delete
__u64 incompat_flags;
[275] Fix | Delete
};
[276] Fix | Delete
[277] Fix | Delete
/* balance control ioctl modes */
[278] Fix | Delete
#define BTRFS_BALANCE_CTL_PAUSE 1
[279] Fix | Delete
#define BTRFS_BALANCE_CTL_CANCEL 2
[280] Fix | Delete
[281] Fix | Delete
/*
[282] Fix | Delete
* this is packed, because it should be exactly the same as its disk
[283] Fix | Delete
* byte order counterpart (struct btrfs_disk_balance_args)
[284] Fix | Delete
*/
[285] Fix | Delete
struct btrfs_balance_args {
[286] Fix | Delete
__u64 profiles;
[287] Fix | Delete
union {
[288] Fix | Delete
__u64 usage;
[289] Fix | Delete
struct {
[290] Fix | Delete
__u32 usage_min;
[291] Fix | Delete
__u32 usage_max;
[292] Fix | Delete
};
[293] Fix | Delete
};
[294] Fix | Delete
__u64 devid;
[295] Fix | Delete
__u64 pstart;
[296] Fix | Delete
__u64 pend;
[297] Fix | Delete
__u64 vstart;
[298] Fix | Delete
__u64 vend;
[299] Fix | Delete
[300] Fix | Delete
__u64 target;
[301] Fix | Delete
[302] Fix | Delete
__u64 flags;
[303] Fix | Delete
[304] Fix | Delete
/*
[305] Fix | Delete
* BTRFS_BALANCE_ARGS_LIMIT with value 'limit'
[306] Fix | Delete
* BTRFS_BALANCE_ARGS_LIMIT_RANGE - the extend version can use minimum
[307] Fix | Delete
* and maximum
[308] Fix | Delete
*/
[309] Fix | Delete
union {
[310] Fix | Delete
__u64 limit; /* limit number of processed chunks */
[311] Fix | Delete
struct {
[312] Fix | Delete
__u32 limit_min;
[313] Fix | Delete
__u32 limit_max;
[314] Fix | Delete
};
[315] Fix | Delete
};
[316] Fix | Delete
[317] Fix | Delete
/*
[318] Fix | Delete
* Process chunks that cross stripes_min..stripes_max devices,
[319] Fix | Delete
* BTRFS_BALANCE_ARGS_STRIPES_RANGE
[320] Fix | Delete
*/
[321] Fix | Delete
__u32 stripes_min;
[322] Fix | Delete
__u32 stripes_max;
[323] Fix | Delete
[324] Fix | Delete
__u64 unused[6];
[325] Fix | Delete
} __attribute__ ((__packed__));
[326] Fix | Delete
[327] Fix | Delete
/* report balance progress to userspace */
[328] Fix | Delete
struct btrfs_balance_progress {
[329] Fix | Delete
__u64 expected; /* estimated # of chunks that will be
[330] Fix | Delete
* relocated to fulfill the request */
[331] Fix | Delete
__u64 considered; /* # of chunks we have considered so far */
[332] Fix | Delete
__u64 completed; /* # of chunks relocated so far */
[333] Fix | Delete
};
[334] Fix | Delete
[335] Fix | Delete
/*
[336] Fix | Delete
* flags definition for balance
[337] Fix | Delete
*
[338] Fix | Delete
* Restriper's general type filter
[339] Fix | Delete
*
[340] Fix | Delete
* Used by:
[341] Fix | Delete
* btrfs_ioctl_balance_args.flags
[342] Fix | Delete
* btrfs_balance_control.flags (internal)
[343] Fix | Delete
*/
[344] Fix | Delete
#define BTRFS_BALANCE_DATA (1ULL << 0)
[345] Fix | Delete
#define BTRFS_BALANCE_SYSTEM (1ULL << 1)
[346] Fix | Delete
#define BTRFS_BALANCE_METADATA (1ULL << 2)
[347] Fix | Delete
[348] Fix | Delete
#define BTRFS_BALANCE_TYPE_MASK (BTRFS_BALANCE_DATA | \
[349] Fix | Delete
BTRFS_BALANCE_SYSTEM | \
[350] Fix | Delete
BTRFS_BALANCE_METADATA)
[351] Fix | Delete
[352] Fix | Delete
#define BTRFS_BALANCE_FORCE (1ULL << 3)
[353] Fix | Delete
#define BTRFS_BALANCE_RESUME (1ULL << 4)
[354] Fix | Delete
[355] Fix | Delete
/*
[356] Fix | Delete
* flags definitions for per-type balance args
[357] Fix | Delete
*
[358] Fix | Delete
* Balance filters
[359] Fix | Delete
*
[360] Fix | Delete
* Used by:
[361] Fix | Delete
* struct btrfs_balance_args
[362] Fix | Delete
*/
[363] Fix | Delete
#define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
[364] Fix | Delete
#define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
[365] Fix | Delete
#define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
[366] Fix | Delete
#define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
[367] Fix | Delete
#define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
[368] Fix | Delete
#define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
[369] Fix | Delete
#define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
[370] Fix | Delete
#define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
[371] Fix | Delete
#define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
[372] Fix | Delete
[373] Fix | Delete
#define BTRFS_BALANCE_ARGS_MASK \
[374] Fix | Delete
(BTRFS_BALANCE_ARGS_PROFILES | \
[375] Fix | Delete
BTRFS_BALANCE_ARGS_USAGE | \
[376] Fix | Delete
BTRFS_BALANCE_ARGS_DEVID | \
[377] Fix | Delete
BTRFS_BALANCE_ARGS_DRANGE | \
[378] Fix | Delete
BTRFS_BALANCE_ARGS_VRANGE | \
[379] Fix | Delete
BTRFS_BALANCE_ARGS_LIMIT | \
[380] Fix | Delete
BTRFS_BALANCE_ARGS_LIMIT_RANGE | \
[381] Fix | Delete
BTRFS_BALANCE_ARGS_STRIPES_RANGE | \
[382] Fix | Delete
BTRFS_BALANCE_ARGS_USAGE_RANGE)
[383] Fix | Delete
[384] Fix | Delete
/*
[385] Fix | Delete
* Profile changing flags. When SOFT is set we won't relocate chunk if
[386] Fix | Delete
* it already has the target profile (even though it may be
[387] Fix | Delete
* half-filled).
[388] Fix | Delete
*/
[389] Fix | Delete
#define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
[390] Fix | Delete
#define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
[391] Fix | Delete
[392] Fix | Delete
[393] Fix | Delete
/*
[394] Fix | Delete
* flags definition for balance state
[395] Fix | Delete
*
[396] Fix | Delete
* Used by:
[397] Fix | Delete
* struct btrfs_ioctl_balance_args.state
[398] Fix | Delete
*/
[399] Fix | Delete
#define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
[400] Fix | Delete
#define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
[401] Fix | Delete
#define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
[402] Fix | Delete
[403] Fix | Delete
struct btrfs_ioctl_balance_args {
[404] Fix | Delete
__u64 flags; /* in/out */
[405] Fix | Delete
__u64 state; /* out */
[406] Fix | Delete
[407] Fix | Delete
struct btrfs_balance_args data; /* in/out */
[408] Fix | Delete
struct btrfs_balance_args meta; /* in/out */
[409] Fix | Delete
struct btrfs_balance_args sys; /* in/out */
[410] Fix | Delete
[411] Fix | Delete
struct btrfs_balance_progress stat; /* out */
[412] Fix | Delete
[413] Fix | Delete
__u64 unused[72]; /* pad to 1k */
[414] Fix | Delete
};
[415] Fix | Delete
[416] Fix | Delete
#define BTRFS_INO_LOOKUP_PATH_MAX 4080
[417] Fix | Delete
struct btrfs_ioctl_ino_lookup_args {
[418] Fix | Delete
__u64 treeid;
[419] Fix | Delete
__u64 objectid;
[420] Fix | Delete
char name[BTRFS_INO_LOOKUP_PATH_MAX];
[421] Fix | Delete
};
[422] Fix | Delete
[423] Fix | Delete
#define BTRFS_INO_LOOKUP_USER_PATH_MAX (4080 - BTRFS_VOL_NAME_MAX - 1)
[424] Fix | Delete
struct btrfs_ioctl_ino_lookup_user_args {
[425] Fix | Delete
/* in, inode number containing the subvolume of 'subvolid' */
[426] Fix | Delete
__u64 dirid;
[427] Fix | Delete
/* in */
[428] Fix | Delete
__u64 treeid;
[429] Fix | Delete
/* out, name of the subvolume of 'treeid' */
[430] Fix | Delete
char name[BTRFS_VOL_NAME_MAX + 1];
[431] Fix | Delete
/*
[432] Fix | Delete
* out, constructed path from the directory with which the ioctl is
[433] Fix | Delete
* called to dirid
[434] Fix | Delete
*/
[435] Fix | Delete
char path[BTRFS_INO_LOOKUP_USER_PATH_MAX];
[436] Fix | Delete
};
[437] Fix | Delete
[438] Fix | Delete
/* Search criteria for the btrfs SEARCH ioctl family. */
[439] Fix | Delete
struct btrfs_ioctl_search_key {
[440] Fix | Delete
/*
[441] Fix | Delete
* The tree we're searching in. 1 is the tree of tree roots, 2 is the
[442] Fix | Delete
* extent tree, etc...
[443] Fix | Delete
*
[444] Fix | Delete
* A special tree_id value of 0 will cause a search in the subvolume
[445] Fix | Delete
* tree that the inode which is passed to the ioctl is part of.
[446] Fix | Delete
*/
[447] Fix | Delete
__u64 tree_id; /* in */
[448] Fix | Delete
[449] Fix | Delete
/*
[450] Fix | Delete
* When doing a tree search, we're actually taking a slice from a
[451] Fix | Delete
* linear search space of 136-bit keys.
[452] Fix | Delete
*
[453] Fix | Delete
* A full 136-bit tree key is composed as:
[454] Fix | Delete
* (objectid << 72) + (type << 64) + offset
[455] Fix | Delete
*
[456] Fix | Delete
* The individual min and max values for objectid, type and offset
[457] Fix | Delete
* define the min_key and max_key values for the search range. All
[458] Fix | Delete
* metadata items with a key in the interval [min_key, max_key] will be
[459] Fix | Delete
* returned.
[460] Fix | Delete
*
[461] Fix | Delete
* Additionally, we can filter the items returned on transaction id of
[462] Fix | Delete
* the metadata block they're stored in by specifying a transid range.
[463] Fix | Delete
* Be aware that this transaction id only denotes when the metadata
[464] Fix | Delete
* page that currently contains the item got written the last time as
[465] Fix | Delete
* result of a COW operation. The number does not have any meaning
[466] Fix | Delete
* related to the transaction in which an individual item that is being
[467] Fix | Delete
* returned was created or changed.
[468] Fix | Delete
*/
[469] Fix | Delete
__u64 min_objectid; /* in */
[470] Fix | Delete
__u64 max_objectid; /* in */
[471] Fix | Delete
__u64 min_offset; /* in */
[472] Fix | Delete
__u64 max_offset; /* in */
[473] Fix | Delete
__u64 min_transid; /* in */
[474] Fix | Delete
__u64 max_transid; /* in */
[475] Fix | Delete
__u32 min_type; /* in */
[476] Fix | Delete
__u32 max_type; /* in */
[477] Fix | Delete
[478] Fix | Delete
/*
[479] Fix | Delete
* input: The maximum amount of results desired.
[480] Fix | Delete
* output: The actual amount of items returned, restricted by any of:
[481] Fix | Delete
* - reaching the upper bound of the search range
[482] Fix | Delete
* - reaching the input nr_items amount of items
[483] Fix | Delete
* - completely filling the supplied memory buffer
[484] Fix | Delete
*/
[485] Fix | Delete
__u32 nr_items; /* in/out */
[486] Fix | Delete
[487] Fix | Delete
/* align to 64 bits */
[488] Fix | Delete
__u32 unused;
[489] Fix | Delete
[490] Fix | Delete
/* some extra for later */
[491] Fix | Delete
__u64 unused1;
[492] Fix | Delete
__u64 unused2;
[493] Fix | Delete
__u64 unused3;
[494] Fix | Delete
__u64 unused4;
[495] Fix | Delete
};
[496] Fix | Delete
[497] Fix | Delete
struct btrfs_ioctl_search_header {
[498] Fix | Delete
__u64 transid;
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function