ReactOS  0.4.15-dev-4863-gba0d16f
btrfsioctl.h
Go to the documentation of this file.
1 // No copyright claimed in this file - do what you want with it.
2 
3 #pragma once
4 
5 #include "btrfs.h"
6 
7 #define FSCTL_BTRFS_GET_FILE_IDS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x829, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
8 #define FSCTL_BTRFS_CREATE_SUBVOL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x82a, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
9 #define FSCTL_BTRFS_CREATE_SNAPSHOT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x82b, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
10 #define FSCTL_BTRFS_GET_INODE_INFO CTL_CODE(FILE_DEVICE_UNKNOWN, 0x82c, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
11 #define FSCTL_BTRFS_SET_INODE_INFO CTL_CODE(FILE_DEVICE_UNKNOWN, 0x82d, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
12 #define FSCTL_BTRFS_GET_DEVICES CTL_CODE(FILE_DEVICE_UNKNOWN, 0x82e, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
13 #define FSCTL_BTRFS_GET_USAGE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x82f, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
14 #define FSCTL_BTRFS_START_BALANCE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x830, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
15 #define FSCTL_BTRFS_QUERY_BALANCE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x831, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
16 #define FSCTL_BTRFS_PAUSE_BALANCE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x832, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
17 #define FSCTL_BTRFS_RESUME_BALANCE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x833, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
18 #define FSCTL_BTRFS_STOP_BALANCE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x834, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
19 #define FSCTL_BTRFS_ADD_DEVICE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x835, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
20 #define FSCTL_BTRFS_REMOVE_DEVICE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x836, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
21 #define IOCTL_BTRFS_QUERY_FILESYSTEMS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x837, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
22 #define FSCTL_BTRFS_GET_UUID CTL_CODE(FILE_DEVICE_UNKNOWN, 0x838, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
23 #define FSCTL_BTRFS_START_SCRUB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x839, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
24 #define FSCTL_BTRFS_QUERY_SCRUB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x83a, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
25 #define FSCTL_BTRFS_PAUSE_SCRUB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x83b, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
26 #define FSCTL_BTRFS_RESUME_SCRUB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x83c, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
27 #define FSCTL_BTRFS_STOP_SCRUB CTL_CODE(FILE_DEVICE_UNKNOWN, 0x83d, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
28 #define IOCTL_BTRFS_PROBE_VOLUME CTL_CODE(FILE_DEVICE_UNKNOWN, 0x83e, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
29 #define FSCTL_BTRFS_RESET_STATS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x83f, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
30 #define FSCTL_BTRFS_MKNOD CTL_CODE(FILE_DEVICE_UNKNOWN, 0x840, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
31 #define FSCTL_BTRFS_RECEIVED_SUBVOL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x841, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
32 #define FSCTL_BTRFS_GET_XATTRS CTL_CODE(FILE_DEVICE_UNKNOWN, 0x842, METHOD_BUFFERED, FILE_ANY_ACCESS)
33 #define FSCTL_BTRFS_SET_XATTR CTL_CODE(FILE_DEVICE_UNKNOWN, 0x843, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
34 #define FSCTL_BTRFS_RESERVE_SUBVOL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x844, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
35 #define FSCTL_BTRFS_FIND_SUBVOL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x845, METHOD_BUFFERED, FILE_ANY_ACCESS)
36 #define FSCTL_BTRFS_SEND_SUBVOL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x846, METHOD_BUFFERED, FILE_ANY_ACCESS)
37 #define FSCTL_BTRFS_READ_SEND_BUFFER CTL_CODE(FILE_DEVICE_UNKNOWN, 0x847, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
38 #define FSCTL_BTRFS_RESIZE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x848, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
39 #define IOCTL_BTRFS_UNLOAD CTL_CODE(FILE_DEVICE_UNKNOWN, 0x849, METHOD_NEITHER, FILE_ANY_ACCESS)
40 #define FSCTL_BTRFS_GET_CSUM_INFO CTL_CODE(FILE_DEVICE_UNKNOWN, 0x84a, METHOD_BUFFERED, FILE_READ_ACCESS)
41 
42 typedef struct {
47 
48 typedef struct {
53  WCHAR name[1];
55 
56 typedef struct {
61  WCHAR name[1];
63 
64 #define BTRFS_COMPRESSION_ANY 0
65 #define BTRFS_COMPRESSION_ZLIB 1
66 #define BTRFS_COMPRESSION_LZO 2
67 #define BTRFS_COMPRESSION_ZSTD 3
68 
69 typedef struct {
88 
89 typedef struct {
101 
102 typedef struct {
111  uint64_t stats[5];
114 } btrfs_device;
115 
116 typedef struct {
120 
121 typedef struct {
128 } btrfs_usage;
129 
130 #define BTRFS_BALANCE_OPTS_ENABLED 0x001
131 #define BTRFS_BALANCE_OPTS_PROFILES 0x002
132 #define BTRFS_BALANCE_OPTS_DEVID 0x004
133 #define BTRFS_BALANCE_OPTS_DRANGE 0x008
134 #define BTRFS_BALANCE_OPTS_VRANGE 0x010
135 #define BTRFS_BALANCE_OPTS_LIMIT 0x020
136 #define BTRFS_BALANCE_OPTS_STRIPES 0x040
137 #define BTRFS_BALANCE_OPTS_USAGE 0x080
138 #define BTRFS_BALANCE_OPTS_CONVERT 0x100
139 #define BTRFS_BALANCE_OPTS_SOFT 0x200
140 
141 #define BLOCK_FLAG_SINGLE 0x1000000000000 // only used in balance
142 
143 typedef struct {
159 
160 #define BTRFS_BALANCE_STOPPED 0
161 #define BTRFS_BALANCE_RUNNING 1
162 #define BTRFS_BALANCE_PAUSED 2
163 #define BTRFS_BALANCE_REMOVAL 4
164 #define BTRFS_BALANCE_ERROR 8
165 #define BTRFS_BALANCE_SHRINKING 16
166 
167 typedef struct {
176 
177 typedef struct {
180 
181 typedef struct {
187 
188 typedef struct {
194 
195 #define BTRFS_SCRUB_STOPPED 0
196 #define BTRFS_SCRUB_RUNNING 1
197 #define BTRFS_SCRUB_PAUSED 2
198 
199 typedef struct {
206 
207  union {
208  struct {
213  } data;
214 
215  struct {
219  } metadata;
220  };
222 
223 typedef struct {
235 
236 typedef struct {
242 } btrfs_mknod;
243 
244 typedef struct {
248 
249 typedef struct {
252  char data[1];
254 
255 typedef struct {
261 
262 typedef struct {
266 
267 typedef struct {
270  HANDLE clones[1];
272 
273 typedef struct {
276  void* POINTER_32 clones[1];
278 
279 typedef struct {
282 } btrfs_resize;
283 
284 typedef struct {
btrfs_scrub_error errors
Definition: btrfsioctl.h:233
uint64_t total_chunks
Definition: btrfsioctl.h:170
uint32_t next_entry
Definition: btrfsioctl.h:200
uint16_t namelen
Definition: btrfsioctl.h:240
uint64_t type
Definition: btrfsioctl.h:123
USHORT namelen
Definition: btrfsioctl.h:112
btrfs_balance_opts metadata_opts
Definition: btrfsioctl.h:173
uint64_t num_sectors
Definition: btrfsioctl.h:287
LARGE_INTEGER start_time
Definition: btrfsioctl.h:225
uint64_t used
Definition: btrfsioctl.h:125
void *POINTER_32 parent
Definition: btrfsioctl.h:274
uint64_t num_devices
Definition: btrfsioctl.h:126
uint64_t disk_size_lzo
Definition: btrfsioctl.h:82
uint8_t compression_type
Definition: btrfsioctl.h:98
#define POINTER_32
Definition: basetsd.h:38
uint64_t data_scrubbed
Definition: btrfsioctl.h:229
uint64_t total_chunks
Definition: btrfsioctl.h:228
uint32_t num_errors
Definition: btrfsioctl.h:232
uint32_t next_entry
Definition: btrfsioctl.h:103
uint64_t size
Definition: btrfsioctl.h:281
const char * devices
Definition: diskspace.c:793
uint64_t chunks_left
Definition: btrfsioctl.h:169
LONG NTSTATUS
Definition: precomp.h:26
uint32_t st_uid
Definition: btrfsioctl.h:74
uint16_t stripes_end
Definition: btrfsioctl.h:154
uint32_t next_entry
Definition: btrfsioctl.h:122
uint8_t csum_length
Definition: btrfsioctl.h:286
uint32_t num_extents
Definition: btrfsioctl.h:86
unsigned short int uint16_t
Definition: acefiex.h:54
btrfs_balance_opts data_opts
Definition: btrfsioctl.h:172
const char * filename
Definition: ioapi.h:135
uint64_t disk_size_zstd
Definition: btrfsioctl.h:84
uint32_t st_mode
Definition: btrfsioctl.h:76
uint64_t limit_start
Definition: btrfsioctl.h:151
uint16_t filename_length
Definition: btrfsioctl.h:211
uint64_t vrange_start
Definition: btrfsioctl.h:149
ULONG device_number
Definition: btrfsioctl.h:109
uint32_t num_devices
Definition: btrfsioctl.h:191
uint32_t inline_length
Definition: btrfsioctl.h:79
uint32_t st_gid
Definition: btrfsioctl.h:75
uint64_t address
Definition: btrfsioctl.h:201
unsigned int BOOL
Definition: ntddk_ex.h:94
BTRFS_UUID uuid
Definition: btrfsioctl.h:263
uint64_t size
Definition: btrfsioctl.h:124
uint64_t st_rdev
Definition: btrfsioctl.h:77
ULONG partition_number
Definition: btrfsioctl.h:110
uint64_t limit_end
Definition: btrfsioctl.h:152
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint64_t duration
Definition: btrfsioctl.h:230
uint64_t drange_end
Definition: btrfsioctl.h:148
uint32_t next_entry
Definition: btrfsioctl.h:189
uint64_t disk_size_zlib
Definition: btrfsioctl.h:81
uint64_t flags
Definition: btrfsioctl.h:78
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL compression_type_changed
Definition: btrfsioctl.h:99
uint64_t inode
Definition: btrfsioctl.h:71
BYTE uint8_t
Definition: msvideo1.c:66
void *POINTER_32 subvol
Definition: btrfsioctl.h:57
uint64_t st_rdev
Definition: btrfsioctl.h:239
uint8_t type
Definition: btrfsioctl.h:238
Definition: btrfs.h:143
UINT64 uint64_t
Definition: types.h:77
uint16_t stripes_start
Definition: btrfsioctl.h:153
btrfs_balance_opts system_opts
Definition: btrfsioctl.h:174
unsigned short USHORT
Definition: pedump.c:61
LARGE_INTEGER finish_time
Definition: btrfsioctl.h:226
uint64_t vrange_end
Definition: btrfsioctl.h:150
uint64_t drange_start
Definition: btrfsioctl.h:147
UINT32 uint32_t
Definition: types.h:75
uint64_t max_size
Definition: btrfsioctl.h:106
uint64_t dev_id
Definition: btrfsioctl.h:104
uint64_t inode
Definition: btrfsioctl.h:237
Definition: name.c:38
uint8_t compression_type
Definition: btrfsioctl.h:83
Definition: msctf.idl:510
unsigned int ULONG
Definition: retypes.h:1
uint64_t device
Definition: btrfsioctl.h:280
uint64_t chunks_left
Definition: btrfsioctl.h:227
uint8_t csum_type
Definition: btrfsioctl.h:285
uint64_t sparse_size
Definition: btrfsioctl.h:85
uint64_t disk_size_uncompressed
Definition: btrfsioctl.h:80
uint64_t subvol
Definition: btrfsioctl.h:70
uint64_t ctransid
Definition: btrfsioctl.h:264
btrfs_filesystem_device device
Definition: btrfsioctl.h:192
uint64_t size
Definition: btrfsioctl.h:105