/usr/include/reiser4/types.h is in libreiser4-dev 1.0.7-6.3fakesync2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | /* Copyright (C) 2001-2005 by Hans Reiser, licensing governed by
reiser4progs/COPYING.
types.h -- reiser4 filesystem structures and macros. */
#ifndef REISER4_TYPES_H
#define REISER4_TYPES_H
#include <aal/libaal.h>
#include <reiser4/bitmap.h>
#include <reiser4/plugin.h>
/* Minimal block number needed for a reiser4 filesystem: Master, Format40,
Bitmap, JHeader, JFooter, Status, Backup, Twig, Leaf + skipped ones. */
#define REISER4_FS_MIN_SIZE(blksize) \
(9 + REISER4_MASTER_BLOCKNR(blksize))
/* Master super block structure. It is the same for all reiser4 filesystems,
so, we can declare it here. It contains common for all format fields like
block size etc. */
typedef struct reiser4_master_sb {
/* Master super block magic. */
char ms_magic[16];
/* Disk format in use. */
d16_t ms_format;
/* Filesyetem block size in use. */
d16_t ms_blksize;
/* Filesyetm uuid in use. */
char ms_uuid[16];
/* Filesystem label in use. */
char ms_label[16];
} reiser4_master_sb_t;
#define get_ms_format(ms) aal_get_le16(ms, ms_format)
#define set_ms_format(ms, val) aal_set_le16(ms, ms_format, val)
#define get_ms_blksize(ms) aal_get_le16(ms, ms_blksize)
#define set_ms_blksize(ms, val) aal_set_le16(ms, ms_blksize, val)
#define SS_MAGIC_SIZE 16
#define SS_STACK_SIZE 10
#define SS_MESSAGE_SIZE 256
typedef struct reiser4_status_sb {
/* Status block magic string. */
char ss_magic[16];
/* Flags that contains current fs status like, corrupted, etc. */
d64_t ss_status;
/* Extended status flags. May be used as addition to main ones. */
d64_t ss_extended;
/* If there was some errors in last time filesystem was used, here may
be stored stack trace where it was. */
d64_t ss_stack[SS_STACK_SIZE];
/* Error message related to saved status and stack trace. */
char ss_message[SS_MESSAGE_SIZE];
} reiser4_status_sb_t;
#define get_ss_status(ss) aal_get_le64(ss, ss_status)
#define set_ss_status(ss, val) aal_set_le64(ss, ss_status, val)
#define get_ss_extended(ss) aal_get_le64(ss, ss_extended)
#define set_ss_extended(ss, val) aal_set_le64(ss, ss_extended, val)
#define ss_stack(ss, n) LE64_TO_CPU(ss->ss_stack[n])
typedef struct reiser4_fs reiser4_fs_t;
#ifndef ENABLE_MINIMAL
typedef struct reiser4_backup {
reiser4_fs_t *fs;
/* The backup data are stored here. */
backup_hint_t hint;
bool_t dirty;
void *data;
} reiser4_backup_t;
#endif
enum reiser4_state {
FS_OK = 0,
FS_CORRUPTED = 1 << 0,
FS_DAMAGED = 1 << 1,
FS_DESTROYED = 1 << 2,
FS_IO = 1 << 3
};
typedef struct reiser4_master {
/* Flag for marking master dirty */
bool_t dirty;
/* Device master is opened on */
aal_device_t *device;
/* Loaded master data */
reiser4_master_sb_t ent;
} reiser4_master_t;
typedef struct reiser4_status {
/* Flag for marking status block dirty */
bool_t dirty;
/* Block size */
uint32_t blksize;
/* Device status is opened on */
aal_device_t *device;
/* Loaded status data */
reiser4_status_sb_t ent;
} reiser4_status_t;
typedef struct reiser4_tree reiser4_tree_t;
/* Calback types used in object code. */
typedef reiser4_object_t *(*object_open_func_t) (reiser4_object_t *,
entry_hint_t *, void *);
#ifndef ENABLE_MINIMAL
typedef enum reiser4_owner {
O_MASTER = 1 << 0,
O_FORMAT = 1 << 1,
O_JOURNAL = 1 << 2,
O_ALLOC = 1 << 3,
O_OID = 1 << 4,
O_STATUS = 1 << 5,
O_BACKUP = 1 << 6,
O_UNKNOWN = 1 << 7
} reiser4_owner_t;
#endif
/* Reiser4 wrappers for all filesystem objects (journal, block allocator,
etc.). They are used for make its plugins access simple. */
typedef struct reiser4_format {
reiser4_fs_t *fs;
/* Disk-format entity. It is initialized by disk-format plugin during
initialization. */
reiser4_format_ent_t *ent;
} reiser4_format_t;
#ifndef ENABLE_MINIMAL
/* Journal structure */
typedef struct reiser4_journal {
reiser4_fs_t *fs;
/* Device journal will be opened on. In the case journal lie on the same
device as filesystem does, this field will point to the same device
instance as in fs struct. */
aal_device_t *device;
/* Journal entity. Initializied by plugin */
reiser4_journal_ent_t *ent;
} reiser4_journal_t;
typedef struct reiser4_alloc reiser4_alloc_t;
typedef errno_t (*hook_alloc_t) (reiser4_alloc_t *,
uint64_t, uint64_t, void *);
/* Block allocator structure */
struct reiser4_alloc {
reiser4_fs_t *fs;
reiser4_alloc_ent_t *ent;
struct {
hook_alloc_t alloc;
hook_alloc_t release;
void *data;
} hook;
};
#endif
/* Oid allocator structure */
typedef struct reiser4_oid {
reiser4_fs_t *fs;
reiser4_oid_ent_t *ent;
} reiser4_oid_t;
#ifndef ENABLE_MINIMAL
typedef errno_t (*estimate_func_t) (reiser4_place_t *place,
trans_hint_t *hint);
typedef errno_t (*modify_func_t) (reiser4_node_t *node,
pos_t *pos, trans_hint_t *hint);
#endif
typedef int (*mpc_func_t) (reiser4_tree_t *);
/* Tree structure. */
struct reiser4_tree {
tree_entity_t ent;
/* Flag that shows, that tree adjusting is running now and should not be
called again until this flag is turned off. */
int adjusting;
/* Reference to filesystem instance tree opened on. */
reiser4_fs_t *fs;
/* Reference to root node. */
reiser4_node_t *root;
/* Tree root key. */
reiser4_key_t key;
/* Memory pressure detect function. */
mpc_func_t mpc_func;
/* Formatted nodes hash table. */
aal_hash_table_t *nodes;
#ifndef ENABLE_MINIMAL
/* Extents data stored here. */
aal_hash_table_t *blocks;
#endif
};
#ifndef ENABLE_MINIMAL
/* Callback function type for opening node. */
typedef reiser4_node_t *(*tree_open_func_t) (reiser4_tree_t *,
reiser4_place_t *,
void *);
#endif
/* Filesystem compound structure */
struct reiser4_fs {
/* Device filesystem is opened/created on */
aal_device_t *device;
/* Pointer to the master super block wrapper object */
reiser4_master_t *master;
/* Pointer to the disk-format instance */
reiser4_format_t *format;
#ifndef ENABLE_MINIMAL
/* Pointer to the journal in use */
reiser4_journal_t *journal;
/* Pointer to the block allocator in use */
reiser4_alloc_t *alloc;
/* Filesystem status block. */
reiser4_status_t *status;
/* Filesystem backup. */
reiser4_backup_t *backup;
/* Pointer to the oid allocator in use */
reiser4_oid_t *oid;
#endif
/* Pointer to the storage tree wrapper object */
reiser4_tree_t *tree;
#ifndef ENABLE_MINIMAL
/* Pointer to the semantic tree wrapper object */
reiser4_object_t *root;
/* Applications using this library sometimes need to embed information
into the objects of our library for their own use. */
void *data;
#endif
};
typedef struct fs_hint {
count_t blocks;
uint32_t blksize;
char uuid[17];
char label[17];
} fs_hint_t;
typedef void (*uuid_unparse_t) (char *uuid, char *string);
typedef errno_t (*walk_func_t) (reiser4_tree_t *, reiser4_node_t *);
typedef errno_t (*walk_on_func_t) (reiser4_tree_t *, reiser4_place_t *);
#endif
|