]> code.delx.au - refind/blob - filesystems/fsw_reiserfs.h
Fixed uninitialized-pointer bug that manifested as a crash with
[refind] / filesystems / fsw_reiserfs.h
1 /**
2 * \file fsw_reiserfs.h
3 * ReiserFS file system driver header.
4 */
5
6 /*-
7 * Copyright (c) 2006 Christoph Pfisterer
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24 #ifndef _FSW_REISERFS_H_
25 #define _FSW_REISERFS_H_
26
27 #define VOLSTRUCTNAME fsw_reiserfs_volume
28 #define DNODESTRUCTNAME fsw_reiserfs_dnode
29 #include "fsw_core.h"
30
31 #include "fsw_reiserfs_disk.h"
32
33
34 //! Block size (in shift bits) to be used when reading the reiserfs superblock.
35 #define REISERFS_SUPERBLOCK_BLOCKSIZEBITS 12
36 //! Block size (in bytes) to be used when reading the reiserfs superblock.
37 #define REISERFS_SUPERBLOCK_BLOCKSIZE (1<<REISERFS_SUPERBLOCK_BLOCKSIZEBITS)
38
39
40 /**
41 * ReiserFS: Results from a tree search.
42 */
43
44 struct fsw_reiserfs_item {
45 int valid;
46
47 // the found item
48 struct item_head ih;
49 fsw_u64 item_offset;
50 fsw_u32 item_type;
51
52 fsw_u8 *item_data;
53
54 // path information
55 fsw_u32 path_bno[MAX_HEIGHT];
56 fsw_u32 path_index[MAX_HEIGHT];
57
58 // block release information
59 fsw_u32 block_bno;
60 void *block_buffer;
61 };
62
63
64 /**
65 * ReiserFS: Volume structure with reiserfs-specific data.
66 */
67
68 struct fsw_reiserfs_volume {
69 struct fsw_volume g; //!< Generic volume structure
70
71 struct reiserfs_super_block *sb; //!< Full raw reiserfs superblock structure
72 int version; //!< Flag for 3.5 or 3.6 format
73 };
74
75 /**
76 * ReiserFS: Dnode structure with reiserfs-specific data.
77 */
78
79 struct fsw_reiserfs_dnode {
80 struct fsw_dnode g; //!< Generic dnode structure
81
82 fsw_u32 dir_id; //!< Locality ID for the reiserfs tree (parent dir id)
83 struct stat_data_v1 *sd_v1; //!< Full stat_data, version 1
84 struct stat_data *sd_v2; //!< Full stat_data, version 2
85 };
86
87
88 #endif