3 /* <project_name> -- <project_description>
5 * Copyright (C) 2006 - 2007
6 * Giuseppe Coviello <cjg@cruxppc.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 struct SfsBlockHeader
{
35 #define SBH(b) ((struct SfsBlockHeader *) (b))
38 struct SfsBlockHeader bheader
;
41 uint16_t sequencenumber
;
48 uint32_t reserved1
[2];
59 uint32_t reserved2
[2];
60 uint32_t reserved3
[8];
63 uint32_t adminspacecontainer
;
64 uint32_t rootobjectcontainer
;
65 uint32_t extentbnoderoot
;
67 uint32_t reserved4
[4];
69 #define SRB(b) ((struct SfsRootBlock *) (b))
70 #define SRB_ID 0x53465300
86 uint32_t firstdirblock
;
90 uint32_t datemodified
;
91 uint8_t bits
; /* see defines below */
96 #define SO(b) ((struct SfsObject *) (b))
97 #define SO_ID 0x53465300
99 #define OTYPE_DELETED (32)
100 #define OTYPE_LINK (64)
101 #define OTYPE_DIR (128)
103 struct SfsObjectContainer
{
104 struct SfsBlockHeader bheader
;
108 struct SfsObject object
[1];
110 #define SOC(b) ((struct SfsObjectContainer *) (b))
111 #define SOC_ID (('O'<<24)|('B'<<16)|('J'<<8)|'C')
118 struct BTreeContainer
{
123 struct BNode bnode
[0];
126 struct SfsBNodeContainer
{
127 struct SfsBlockHeader bheader
;
128 struct BTreeContainer btc
;
130 #define SBNC(b) ((struct SfsBNodeContainer *) (b))
132 struct SfsExtentBNode
{
139 boot_dev_t
*sfs_create(struct RdbPartition
*partition
);