1 #ifndef _SYSV_FS_SB
2 #define _SYSV_FS_SB
3 
4 /*
5  * SystemV/V7/Coherent super-block data in memory
6  * The SystemV/V7/Coherent superblock contains dynamic data (it gets modified
7  * while the system is running). This is in contrast to the Minix and Berkeley
8  * filesystems (where the superblock is never modified). This affects the
9  * sync() operation: we must keep the superblock in a disk buffer and use this
10  * one as our "working copy".
11  */
12 
13 struct sysv_sb_info {
14 	int	       s_type;		/* file system type: FSTYPE_{XENIX|SYSV|COH} */
15 	char	       s_bytesex;	/* bytesex (le/be/pdp) */
16 	char	       s_truncate;	/* if 1: names > SYSV_NAMELEN chars are truncated */
17 					/* if 0: they are disallowed (ENAMETOOLONG) */
18 	nlink_t        s_link_max;	/* max number of hard links to a file */
19 	unsigned int   s_inodes_per_block;	/* number of inodes per block */
20 	unsigned int   s_inodes_per_block_1;	/* inodes_per_block - 1 */
21 	unsigned int   s_inodes_per_block_bits;	/* log2(inodes_per_block) */
22 	unsigned int   s_ind_per_block;		/* number of indirections per block */
23 	unsigned int   s_ind_per_block_bits;	/* log2(ind_per_block) */
24 	unsigned int   s_ind_per_block_2;	/* ind_per_block ^ 2 */
25 	unsigned int   s_toobig_block;		/* 10 + ipb + ipb^2 + ipb^3 */
26 	unsigned int   s_block_base;	/* physical block number of block 0 */
27 	unsigned short s_fic_size;	/* free inode cache size, NICINOD */
28 	unsigned short s_flc_size;	/* free block list chunk size, NICFREE */
29 	/* The superblock is kept in one or two disk buffers: */
30 	struct buffer_head *s_bh1;
31 	struct buffer_head *s_bh2;
32 	/* These are pointers into the disk buffer, to compensate for
33 	   different superblock layout. */
34 	char *         s_sbd1;		/* entire superblock data, for part 1 */
35 	char *         s_sbd2;		/* entire superblock data, for part 2 */
36 	u16            *s_sb_fic_count;	/* pointer to s_sbd->s_ninode */
37         u16            *s_sb_fic_inodes; /* pointer to s_sbd->s_inode */
38 	u16            *s_sb_total_free_inodes; /* pointer to s_sbd->s_tinode */
39 	u16            *s_bcache_count;	/* pointer to s_sbd->s_nfree */
40 	u32	       *s_bcache;	/* pointer to s_sbd->s_free */
41 	u32            *s_free_blocks;	/* pointer to s_sbd->s_tfree */
42 	u32            *s_sb_time;	/* pointer to s_sbd->s_time */
43 	u32            *s_sb_state;	/* pointer to s_sbd->s_state, only FSTYPE_SYSV */
44 	/* We keep those superblock entities that don't change here;
45 	   this saves us an indirection and perhaps a conversion. */
46 	u32            s_firstinodezone; /* index of first inode zone */
47 	u32            s_firstdatazone;	/* same as s_sbd->s_isize */
48 	u32            s_ninodes;	/* total number of inodes */
49 	u32            s_ndatazones;	/* total number of data zones */
50 	u32            s_nzones;	/* same as s_sbd->s_fsize */
51 	u16	       s_namelen;       /* max length of dir entry */
52 };
53 /* The field s_toobig_block is currently unused. */
54 
55 /* sv_ == u.sysv_sb.s_ */
56 #define sv_type					u.sysv_sb.s_type
57 #define sv_bytesex				u.sysv_sb.s_bytesex
58 #define sv_truncate				u.sysv_sb.s_truncate
59 #define sv_link_max				u.sysv_sb.s_link_max
60 #define sv_inodes_per_block			u.sysv_sb.s_inodes_per_block
61 #define sv_inodes_per_block_1			u.sysv_sb.s_inodes_per_block_1
62 #define sv_inodes_per_block_bits		u.sysv_sb.s_inodes_per_block_bits
63 #define sv_ind_per_block			u.sysv_sb.s_ind_per_block
64 #define sv_ind_per_block_bits			u.sysv_sb.s_ind_per_block_bits
65 #define sv_ind_per_block_2			u.sysv_sb.s_ind_per_block_2
66 #define sv_toobig_block				u.sysv_sb.s_toobig_block
67 #define sv_block_base				u.sysv_sb.s_block_base
68 #define sv_fic_size				u.sysv_sb.s_fic_size
69 #define sv_flc_size				u.sysv_sb.s_flc_size
70 #define sv_bh1					u.sysv_sb.s_bh1
71 #define sv_bh2					u.sysv_sb.s_bh2
72 #define sv_sbd1					u.sysv_sb.s_sbd1
73 #define sv_sbd2					u.sysv_sb.s_sbd2
74 #define sv_sb_fic_count				u.sysv_sb.s_sb_fic_count
75 #define sv_sb_fic_inodes			u.sysv_sb.s_sb_fic_inodes
76 #define sv_sb_total_free_inodes			u.sysv_sb.s_sb_total_free_inodes
77 #define sv_bcache_count				u.sysv_sb.s_bcache_count
78 #define sv_bcache				u.sysv_sb.s_bcache
79 #define sv_free_blocks				u.sysv_sb.s_free_blocks
80 #define sv_sb_time				u.sysv_sb.s_sb_time
81 #define sv_sb_state				u.sysv_sb.s_sb_state
82 #define sv_firstinodezone			u.sysv_sb.s_firstinodezone
83 #define sv_firstdatazone			u.sysv_sb.s_firstdatazone
84 #define sv_ninodes				u.sysv_sb.s_ninodes
85 #define sv_ndatazones				u.sysv_sb.s_ndatazones
86 #define sv_nzones				u.sysv_sb.s_nzones
87 #define sv_namelen                              u.sysv_sb.s_namelen
88 
89 #endif
90