btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / bfs / bfs_control.h
blob31388f5b8e8676fa5bb53371847cecb8ff88ec04
1 /*
2 * Copyright 2001-2014, Axel Dörfler, axeld@pinc-software.de
3 * This file may be used under the terms of the MIT License.
4 */
5 #ifndef BFS_CONTROL_H
6 #define BFS_CONTROL_H
9 //! additional functionality exported via ioctl()
12 #ifdef FS_SHELL
13 # include "system_dependencies.h"
14 #else
15 # include <SupportDefs.h>
16 #endif
19 /* ioctl to check the version of BFS used - parameter is a uint32 *
20 * where the number is stored
22 #define BFS_IOCTL_VERSION 14200
24 #define BFS_IOCTL_UPDATE_BOOT_BLOCK 14204
26 struct update_boot_block {
27 uint32 offset;
28 const uint8* data;
29 uint32 length;
32 /* ioctls to use the "chkbfs" feature from the outside
33 * all calls use a struct check_result as single parameter
35 #define BFS_IOCTL_START_CHECKING 14201
36 #define BFS_IOCTL_STOP_CHECKING 14202
37 #define BFS_IOCTL_CHECK_NEXT_NODE 14203
39 /* The "pass" field constants */
40 #define BFS_CHECK_PASS_BITMAP 0
41 #define BFS_CHECK_PASS_INDEX 1
43 /* All fields except "flags", and "name" must be set to zero before
44 * BFS_IOCTL_START_CHECKING is called, and magic must be set.
46 struct check_control {
47 uint32 magic;
48 uint32 pass;
49 uint32 flags;
50 char name[B_FILE_NAME_LENGTH];
51 ino_t inode;
52 uint32 mode;
53 uint32 errors;
54 struct {
55 uint64 missing;
56 uint64 already_set;
57 uint64 freed;
59 uint64 direct_block_runs;
60 uint64 indirect_block_runs;
61 uint64 indirect_array_blocks;
62 uint64 double_indirect_block_runs;
63 uint64 double_indirect_array_blocks;
64 uint64 blocks_in_direct;
65 uint64 blocks_in_indirect;
66 uint64 blocks_in_double_indirect;
67 uint64 partial_block_runs;
68 uint32 block_size;
69 } stats;
70 status_t status;
73 /* values for the flags field */
74 #define BFS_FIX_BITMAP_ERRORS 1
75 #define BFS_REMOVE_WRONG_TYPES 2
76 /* files that shouldn't be part of its parent will be removed
77 * (i.e. a directory contains an attribute, ...)
78 * Works only if B_FIX_BITMAP_ERRORS is set, too
80 #define BFS_REMOVE_INVALID 4
81 /* removes nodes that couldn't be opened at all from its parent
82 * directory.
83 * Also requires the B_FIX_BITMAP_ERRORS to be set.
85 #define BFS_FIX_NAME_MISMATCHES 8
86 #define BFS_FIX_BPLUSTREES 16
88 /* values for the errors field */
89 #define BFS_MISSING_BLOCKS 1
90 #define BFS_BLOCKS_ALREADY_SET 2
91 #define BFS_INVALID_BLOCK_RUN 4
92 #define BFS_COULD_NOT_OPEN 8
93 #define BFS_WRONG_TYPE 16
94 #define BFS_NAMES_DONT_MATCH 32
95 #define BFS_INVALID_BPLUSTREE 64
97 /* check control magic value */
98 #define BFS_IOCTL_CHECK_MAGIC 'BChk'
101 #endif /* BFS_CONTROL_H */