Changes to ext4fs driver to support 64-bit pointers.
[refind] / filesystems / fsw_ext4.h
1 /**
2 * \file fsw_ext4.h
3 * ext4 file system driver header.
4 */
5
6 /*-
7 * Copyright (c) 2012 Stefan Agner
8 * Portions Copyright (c) 2006 Christoph Pfisterer
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 */
24
25 #ifndef _FSW_EXT4_H_
26 #define _FSW_EXT4_H_
27
28 #define VOLSTRUCTNAME fsw_ext4_volume
29 #define DNODESTRUCTNAME fsw_ext4_dnode
30 #include "fsw_core.h"
31
32 #include "fsw_ext4_disk.h"
33
34
35 //! Block size to be used when reading the ext4 superblock.
36 #define EXT4_SUPERBLOCK_BLOCKSIZE 1024
37 //! Block number where the (master copy of the) ext4 superblock resides.
38 #define EXT4_SUPERBLOCK_BLOCKNO 1
39
40
41 /**
42 * ext4: Volume structure with ext2-specific data.
43 */
44
45 struct fsw_ext4_volume {
46 struct fsw_volume g; //!< Generic volume structure
47
48 struct ext4_super_block *sb; //!< Full raw ext2 superblock structure
49 fsw_u64 *inotab_bno; //!< Block numbers of the inode tables
50 fsw_u32 ind_bcnt; //!< Number of blocks addressable through an indirect block
51 fsw_u32 dind_bcnt; //!< Number of blocks addressable through a double-indirect block
52 fsw_u32 inode_size; //!< Size of inode structure in bytes
53 };
54
55 /**
56 * ext2: Dnode structure with ext2-specific data.
57 */
58
59 struct fsw_ext4_dnode {
60 struct fsw_dnode g; //!< Generic dnode structure
61
62 struct ext4_inode *raw; //!< Full raw inode structure
63 };
64
65
66 #endif