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