1 /*
2 libparted - a library for manipulating disk partitions
3 Copyright (C) 2000, 2007 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef REISERFS_H
20 #define REISERFS_H
21
22 #define REISERFS_API_VERSION 0
23
24 #define REISERFS_SIGNATURE "ReIsErFs"
25 #define REISER2FS_SIGNATURE "ReIsEr2Fs"
26 #define REISER3FS_SIGNATURE "ReIsEr3Fs"
27
28 #define DEFAULT_BLOCK_SIZE 4096
29
30 struct reiserfs_super_block {
31 uint32_t s_block_count;
32 uint32_t s_free_blocks;
33 uint32_t s_root_block;
34 uint32_t s_journal_block;
35 uint32_t s_journal_dev;
36 uint32_t s_orig_journal_size;
37 uint32_t s_journal_trans_max;
38 uint32_t s_journal_block_count;
39 uint32_t s_journal_max_batch;
40 uint32_t s_journal_max_commit_age;
41 uint32_t s_journal_max_trans_age;
42 uint16_t s_blocksize;
43 uint16_t s_oid_maxsize;
44 uint16_t s_oid_cursize;
45 uint16_t s_state;
46 char s_magic[10];
47 uint16_t s_fsck_state;
48 uint32_t s_hash_function_code;
49 uint16_t s_tree_height;
50 uint16_t s_bmap_nr;
51 uint16_t s_version;
52 char padding[438];
53 };
54
55 typedef struct reiserfs_super_block reiserfs_super_block_t;
56
57 enum reiserfs_exception_type {
58 EXCEPTION_INFORMATION = 1,
59 EXCEPTION_WARNING = 2,
60 EXCEPTION_ERROR = 3,
61 EXCEPTION_FATAL = 4,
62 EXCEPTION_BUG = 5,
63 EXCEPTION_NO_FEATURE = 6
64 };
65
66 typedef enum reiserfs_exception_type reiserfs_exception_type_t;
67
68 enum reiserfs_exception_option {
69 EXCEPTION_UNHANDLED = 1 << 0,
70 EXCEPTION_FIX = 1 << 1,
71 EXCEPTION_YES = 1 << 2,
72 EXCEPTION_NO = 1 << 3,
73 EXCEPTION_OK = 1 << 4,
74 EXCEPTION_RETRY = 1 << 5,
75 EXCEPTION_IGNORE = 1 << 6,
76 EXCEPTION_CANCEL = 1 << 7
77 };
78
79 typedef enum reiserfs_exception_option reiserfs_exception_option_t;
80
81 typedef void (reiserfs_gauge_handler_t)(const char *, unsigned int, void *, int, int, int);
82
83 typedef void * reiserfs_exception_t;
84 typedef void * reiserfs_gauge_t;
85 typedef void * reiserfs_fs_t;
86
87 #define FS_FORMAT_3_5 0
88 #define FS_FORMAT_3_6 2
89
90 #define SUPER_OFFSET_IN_BYTES 64*1024
91
92 #define DEFAULT_JOURNAL_SIZE 8192
93
94 #define JOURNAL_MIN_SIZE 512
95 #define JOURNAL_MIN_TRANS 256
96 #define JOURNAL_MAX_TRANS 1024
97
98 #define JOURNAL_DEF_RATIO 8
99 #define JOURNAL_MIN_RATIO 2
100 #define JOURNAL_MAX_BATCH 900
101 #define JOURNAL_MAX_COMMIT_AGE 30
102 #define JOURNAL_MAX_TRANS_AGE 30
103
104 #define TEA_HASH 1
105 #define YURA_HASH 2
106 #define R5_HASH 3
107
108 #endif