xref: /minix3/minix/usr.sbin/mkfs.mfs/v1/super.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #ifndef _MKFS_MFS_SUPER_H__
2*433d6423SLionel Sambuc #define _MKFS_MFS_SUPER_H__
3*433d6423SLionel Sambuc 
4*433d6423SLionel Sambuc /* Super block table.  The entry holds information about the sizes of the bit
5*433d6423SLionel Sambuc  * maps and inodes.  The s_ninodes field gives the number of inodes available
6*433d6423SLionel Sambuc  * for files and directories, including the root directory.  Inode 0 is
7*433d6423SLionel Sambuc  * on the disk, but not used.  Thus s_ninodes = 4 means that 5 bits will be
8*433d6423SLionel Sambuc  * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
9*433d6423SLionel Sambuc  * for files and directories.  The disk layout is:
10*433d6423SLionel Sambuc  *
11*433d6423SLionel Sambuc  *    Item        # blocks
12*433d6423SLionel Sambuc  *    boot block      1
13*433d6423SLionel Sambuc  *    super block     1
14*433d6423SLionel Sambuc  *    inode map     s_imap_blocks
15*433d6423SLionel Sambuc  *    zone map      s_zmap_blocks
16*433d6423SLionel Sambuc  *    inodes        (s_ninodes + 'inodes per block' - 1)/'inodes per block'
17*433d6423SLionel Sambuc  *    unused        whatever is needed to fill out the current zone
18*433d6423SLionel Sambuc  *    data zones    (s_zones - s_firstdatazone) << s_log_zone_size
19*433d6423SLionel Sambuc  */
20*433d6423SLionel Sambuc 
21*433d6423SLionel Sambuc struct super_block {
22*433d6423SLionel Sambuc   uint16_t s_ninodes;		/* # usable inodes on the minor device */
23*433d6423SLionel Sambuc   uint16_t  s_nzones;		/* total device size, including bit maps etc */
24*433d6423SLionel Sambuc   int16_t s_imap_blocks;	/* # of blocks used by inode bit map */
25*433d6423SLionel Sambuc   int16_t s_zmap_blocks;	/* # of blocks used by zone bit map */
26*433d6423SLionel Sambuc   uint16_t s_firstdatazone;	/* number of first data zone (small) */
27*433d6423SLionel Sambuc   int16_t s_log_zone_size;	/* log2 of blocks/zone */
28*433d6423SLionel Sambuc   uint32_t s_max_size;		/* maximum file size on this device */
29*433d6423SLionel Sambuc   int16_t s_magic;		/* magic number to recognize super-blocks */
30*433d6423SLionel Sambuc } superblock;
31*433d6423SLionel Sambuc 
32*433d6423SLionel Sambuc /* Some members have been overidden in later versions: */
33*433d6423SLionel Sambuc #define s_firstdatazone_old	s_firstdatazone
34*433d6423SLionel Sambuc #define s_zones			s_nzones
35*433d6423SLionel Sambuc 
36*433d6423SLionel Sambuc #undef MFSFLAG_CLEAN
37*433d6423SLionel Sambuc #undef MFSFLAG_MANDATORY_MASK
38*433d6423SLionel Sambuc 
39*433d6423SLionel Sambuc #endif
40