2 * linux/include/linux/ufs_fs_sb.h
5 * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
6 * Laboratory for Computer Science Research Computing Facility
7 * Rutgers, The State University of New Jersey
9 * $Id: ufs_fs_sb.h,v 1.1.1.1 2005/04/11 02:51:04 jack Exp $
11 * Write support by Daniel Pirkl <daniel.pirkl@email.cz>
14 #ifndef __LINUX_UFS_FS_SB_H
15 #define __LINUX_UFS_FS_SB_H
17 #include <linux/ufs_fs.h>
20 * This structure is used for reading disk structures larger
21 * than the size of fragment.
23 struct ufs_buffer_head {
24 unsigned fragment; /* first fragment */
25 unsigned count; /* number of fragments */
26 struct buffer_head * bh[UFS_MAXFRAG]; /* buffers */
29 struct ufs_cg_private_info {
30 struct ufs_cylinder_group ucg;
31 __u32 c_cgx; /* number of cylidner group */
32 __u16 c_ncyl; /* number of cyl's this cg */
33 __u16 c_niblk; /* number of inode blocks this cg */
34 __u32 c_ndblk; /* number of data blocks this cg */
35 __u32 c_rotor; /* position of last used block */
36 __u32 c_frotor; /* position of last used frag */
37 __u32 c_irotor; /* position of last used inode */
38 __u32 c_btotoff; /* (__u32) block totals per cylinder */
39 __u32 c_boff; /* (short) free block positions */
40 __u32 c_iusedoff; /* (char) used inode map */
41 __u32 c_freeoff; /* (u_char) free block map */
42 __u32 c_nextfreeoff; /* (u_char) next available space */
43 __u32 c_clustersumoff;/* (u_int32) counts of avail clusters */
44 __u32 c_clusteroff; /* (u_int8) free cluster map */
45 __u32 c_nclusterblks; /* number of clusters this cg */
48 struct ufs_sb_private_info {
49 struct ufs_buffer_head s_ubh; /* buffer containing super block */
50 __u32 s_sblkno; /* offset of super-blocks in filesys */
51 __u32 s_cblkno; /* offset of cg-block in filesys */
52 __u32 s_iblkno; /* offset of inode-blocks in filesys */
53 __u32 s_dblkno; /* offset of first data after cg */
54 __u32 s_cgoffset; /* cylinder group offset in cylinder */
55 __u32 s_cgmask; /* used to calc mod fs_ntrak */
56 __u32 s_size; /* number of blocks (fragments) in fs */
57 __u32 s_dsize; /* number of data blocks in fs */
58 __u32 s_ncg; /* number of cylinder groups */
59 __u32 s_bsize; /* size of basic blocks */
60 __u32 s_fsize; /* size of fragments */
61 __u32 s_fpb; /* fragments per block */
62 __u32 s_minfree; /* minimum percentage of free blocks */
63 __u32 s_bmask; /* `blkoff'' calc of blk offsets */
64 __u32 s_fmask; /* s_fsize mask */
65 __u32 s_bshift; /* `lblkno'' calc of logical blkno */
66 __u32 s_fshift; /* s_fsize shift */
67 __u32 s_fpbshift; /* fragments per block shift */
68 __u32 s_fsbtodb; /* fsbtodb and dbtofsb shift constant */
69 __u32 s_sbsize; /* actual size of super block */
70 __u32 s_csmask; /* csum block offset */
71 __u32 s_csshift; /* csum block number */
72 __u32 s_nindir; /* value of NINDIR */
73 __u32 s_inopb; /* value of INOPB */
74 __u32 s_nspf; /* value of NSPF */
75 __u32 s_npsect; /* # sectors/track including spares */
76 __u32 s_interleave; /* hardware sector interleave */
77 __u32 s_trackskew; /* sector 0 skew, per track */
78 __u32 s_csaddr; /* blk addr of cyl grp summary area */
79 __u32 s_cssize; /* size of cyl grp summary area */
80 __u32 s_cgsize; /* cylinder group size */
81 __u32 s_ntrak; /* tracks per cylinder */
82 __u32 s_nsect; /* sectors per track */
83 __u32 s_spc; /* sectors per cylinder */
84 __u32 s_ipg; /* inodes per group */
85 __u32 s_fpg; /* fragments per group */
86 __u32 s_cpc; /* cyl per cycle in postbl */
87 __s32 s_contigsumsize;/* size of cluster summary array, 44bsd */
88 __s64 s_qbmask; /* ~usb_bmask */
89 __s64 s_qfmask; /* ~usb_fmask */
90 __s32 s_postblformat; /* format of positional layout tables */
91 __s32 s_nrpos; /* number of rotational positions */
92 __s32 s_postbloff; /* (__s16) rotation block list head */
93 __s32 s_rotbloff; /* (__u8) blocks for each rotation */
95 __u32 s_fpbmask; /* fragments per block mask */
96 __u32 s_apb; /* address per block */
97 __u32 s_2apb; /* address per block^2 */
98 __u32 s_3apb; /* address per block^3 */
99 __u32 s_apbmask; /* address per block mask */
100 __u32 s_apbshift; /* address per block shift */
101 __u32 s_2apbshift; /* address per block shift * 2 */
102 __u32 s_3apbshift; /* address per block shift * 3 */
103 __u32 s_nspfshift; /* number of sector per fragment shift */
104 __u32 s_nspb; /* number of sector per block */
105 __u32 s_inopf; /* inodes per fragment */
106 __u32 s_sbbase; /* offset of NeXTstep superblock */
107 __u32 s_bpf; /* bits per fragment */
108 __u32 s_bpfshift; /* bits per fragment shift*/
109 __u32 s_bpfmask; /* bits per fragment mask */
111 __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */
115 #define UFS_MAX_GROUP_LOADED 8
116 #define UFS_CGNO_EMPTY ((unsigned)-1)
119 struct ufs_sb_private_info * s_uspi;
120 struct ufs_csum * s_csp[UFS_MAXCSBUFS];
123 struct buffer_head ** s_ucg;
124 struct ufs_cg_private_info * s_ucpi[UFS_MAX_GROUP_LOADED];
125 unsigned s_cgno[UFS_MAX_GROUP_LOADED];
126 unsigned short s_cg_loaded;
127 unsigned s_mount_opt;
131 * Sizes of this structures are:
132 * ufs_super_block_first 512
133 * ufs_super_block_second 512
134 * ufs_super_block_third 356
136 struct ufs_super_block_first {
191 struct ufs_csum fs_cstotal;
196 __s8 fs_fsmnt[UFS_MAXMNTLEN - 212];
200 struct ufs_super_block_second {
203 __u32 fs_csp[UFS_MAXCSBUFS];
206 __u16 fs_opostbl[82];
209 struct ufs_super_block_third {
210 __u16 fs_opostbl[46];
213 __s32 fs_sparecon[53];/* reserved for future constants */
215 __s32 fs_sparecon2[1];
216 __s32 fs_state; /* file system state time stamp */
217 __u32 fs_qbmask[2]; /* ~usb_bmask */
218 __u32 fs_qfmask[2]; /* ~usb_fmask */
221 __s32 fs_sparecon[53];/* reserved for future constants */
223 __s32 fs_sparecon2[1];
224 __u32 fs_npsect; /* # sectors/track including spares */
225 __u32 fs_qbmask[2]; /* ~usb_bmask */
226 __u32 fs_qfmask[2]; /* ~usb_fmask */
229 __s32 fs_sparecon[50];/* reserved for future constants */
230 __s32 fs_contigsumsize;/* size of cluster summary array */
231 __s32 fs_maxsymlinklen;/* max length of an internal symlink */
232 __s32 fs_inodefmt; /* format of on-disk inodes */
233 __u32 fs_maxfilesize[2]; /* max representable file size */
234 __u32 fs_qbmask[2]; /* ~usb_bmask */
235 __u32 fs_qfmask[2]; /* ~usb_fmask */
236 __s32 fs_state; /* file system state time stamp */
239 __s32 fs_postblformat;
247 #endif /* __LINUX_UFS_FS_SB_H */