sofs19  0.1
FUSE based file system
superblock.h
Go to the documentation of this file.
1 
10 #ifndef __SOFS19_SUPERBLOCK__
11 #define __SOFS19_SUPERBLOCK__
12 
13 #include <inttypes.h>
14 
15 namespace sofs19
16 {
17 
26 #define MAGIC_NUMBER 0x50F5
27 
31 #define VERSION_NUMBER 0x2019
32 
36 #define PARTITION_NAME_SIZE 21
37 
41 #define HEAD_CACHE_SIZE 64
42 
46 #define TAIL_CACHE_SIZE 170
47 
55  struct SOSuperBlock
56  {
57 
59  uint16_t magic;
60 
62  uint16_t version;
63 
66 
68  uint8_t mntstat;
69 
71  uint8_t mntcnt;
72 
74  uint32_t ntotal;
75 
76 
77  /* Inode meta data */
78 
80  uint32_t it_size;
81 
83  uint32_t itotal;
84 
86  uint32_t ifree;
87 
89  uint32_t ihead;
90 
92  uint32_t itail;
93 
94 
95  /* Data blocks' metadata */
96 
98  uint32_t dz_start;
99 
101  uint32_t dz_total;
102 
104  uint32_t dz_free;
105 
107  uint32_t head_blk;
108 
110  uint32_t head_idx;
111 
113  uint32_t tail_blk;
114 
116  uint32_t tail_idx;
117 
119  struct HeadCache
120  {
121  uint32_t idx;
122  uint32_t ref[HEAD_CACHE_SIZE];
123  } head_cache;
124 
126  struct TailCache
127  {
128  uint32_t idx;
129  uint32_t ref[TAIL_CACHE_SIZE];
130  } tail_cache;
131 
132  };
133 
136 };
137 
138 #endif /*__SOFS19_SUPERBLOCK__ */
sofs19::SOSuperBlock::itotal
uint32_t itotal
total number of inodes
Definition: superblock.h:83
sofs19::SOSuperBlock::TailCache
tail cache of references to free data blocks
Definition: superblock.h:126
sofs19::SOSuperBlock
Definition of the superblock data type.
Definition: superblock.h:55
sofs19::SOSuperBlock::magic
uint16_t magic
magic number - file system identification number
Definition: superblock.h:59
sofs19::SOSuperBlock::dz_start
uint32_t dz_start
physical number of the block where the data zone starts
Definition: superblock.h:98
sofs19::SOSuperBlock::tail_blk
uint32_t tail_blk
number of tail reference data block
Definition: superblock.h:113
PARTITION_NAME_SIZE
#define PARTITION_NAME_SIZE
maximum length of volume name
Definition: superblock.h:36
sofs19::SOSuperBlock::itail
uint32_t itail
number of last free inode
Definition: superblock.h:92
sofs19::SOSuperBlock::ihead
uint32_t ihead
number of fist free inode
Definition: superblock.h:89
sofs19::SOSuperBlock::HeadCache
head cache of references to free data blocks
Definition: superblock.h:119
sofs19::SOSuperBlock::name
char name[PARTITION_NAME_SIZE+1]
volume name
Definition: superblock.h:65
sofs19::SOSuperBlock::dz_free
uint32_t dz_free
number of free blocks in data zone
Definition: superblock.h:104
sofs19::SOSuperBlock::tail_idx
uint32_t tail_idx
first empty position in tail reference data block
Definition: superblock.h:116
sofs19::SOSuperBlock::version
uint16_t version
version number
Definition: superblock.h:62
HEAD_CACHE_SIZE
#define HEAD_CACHE_SIZE
size of caches in superblock for inode references
Definition: superblock.h:41
sofs19::SOSuperBlock::dz_total
uint32_t dz_total
total number of data blocks
Definition: superblock.h:101
TAIL_CACHE_SIZE
#define TAIL_CACHE_SIZE
size of caches in superblock for block references
Definition: superblock.h:46
sofs19::SOSuperBlock::it_size
uint32_t it_size
number of blocks that the inode table comprises
Definition: superblock.h:80
sofs19::SOSuperBlock::head_idx
uint32_t head_idx
first occupied position in head reference data block
Definition: superblock.h:110
sofs19::SOSuperBlock::head_blk
uint32_t head_blk
number of head reference data block
Definition: superblock.h:107
sofs19::SOSuperBlock::mntstat
uint8_t mntstat
mount status (1: properly unmounted; 0: otherwise)
Definition: superblock.h:68
sofs19::SOSuperBlock::ifree
uint32_t ifree
number of free inodes
Definition: superblock.h:86
sofs19::SOSuperBlock::ntotal
uint32_t ntotal
total number of blocks in the device
Definition: superblock.h:74
sofs19::SOSuperBlock::mntcnt
uint8_t mntcnt
number of mounts since last file system check
Definition: superblock.h:71