]> code.delx.au - refind/blob - filesystems/fsw_ext2.h
Fixed uninitialized-pointer bug that manifested as a crash with
[refind] / filesystems / fsw_ext2.h
1 /**
2 * \file fsw_ext2.h
3 * ext2 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_EXT2_H_
25 #define _FSW_EXT2_H_
26
27 #define VOLSTRUCTNAME fsw_ext2_volume
28 #define DNODESTRUCTNAME fsw_ext2_dnode
29 #include "fsw_core.h"
30
31 #include "fsw_ext2_disk.h"
32
33
34 //! Block size to be used when reading the ext2 superblock.
35 #define EXT2_SUPERBLOCK_BLOCKSIZE 1024
36 //! Block number where the (master copy of the) ext2 superblock resides.
37 #define EXT2_SUPERBLOCK_BLOCKNO 1
38
39
40 /**
41 * ext2: Volume structure with ext2-specific data.
42 */
43
44 struct fsw_ext2_volume {
45 struct fsw_volume g; //!< Generic volume structure
46
47 struct ext2_super_block *sb; //!< Full raw ext2 superblock structure
48 fsw_u32 *inotab_bno; //!< Block numbers of the inode tables
49 fsw_u32 ind_bcnt; //!< Number of blocks addressable through an indirect block
50 fsw_u32 dind_bcnt; //!< Number of blocks addressable through a double-indirect block
51 fsw_u32 inode_size; //!< Size of inode structure in bytes
52 };
53
54 /**
55 * ext2: Dnode structure with ext2-specific data.
56 */
57
58 struct fsw_ext2_dnode {
59 struct fsw_dnode g; //!< Generic dnode structure
60
61 struct ext2_inode *raw; //!< Full raw inode structure
62 };
63
64
65 #endif