Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  linux/include/linux/ufs_fs.h
0004  *
0005  * Copyright (C) 1996
0006  * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
0007  * Laboratory for Computer Science Research Computing Facility
0008  * Rutgers, The State University of New Jersey
0009  *
0010  * Clean swab support by Fare <fare@tunes.org>
0011  * just hope no one is using NNUUXXI on __?64 structure elements
0012  * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl>
0013  *
0014  * 4.4BSD (FreeBSD) support added on February 1st 1998 by
0015  * Niels Kristian Bech Jensen <nkbj@image.dk> partially based
0016  * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
0017  *
0018  * NeXTstep support added on February 5th 1998 by
0019  * Niels Kristian Bech Jensen <nkbj@image.dk>.
0020  *
0021  * Write support by Daniel Pirkl <daniel.pirkl@email.cz>
0022  *
0023  * HP/UX hfs filesystem support added by
0024  * Martin K. Petersen <mkp@mkp.net>, August 1999
0025  *
0026  * UFS2 (of FreeBSD 5.x) support added by
0027  * Niraj Kumar <niraj17@iitbombay.org>  , Jan 2004
0028  *
0029  */
0030 
0031 #ifndef __LINUX_UFS_FS_H
0032 #define __LINUX_UFS_FS_H
0033 
0034 #include <linux/types.h>
0035 #include <linux/kernel.h>
0036 #include <linux/stat.h>
0037 #include <linux/fs.h>
0038 #include <linux/workqueue.h>
0039 
0040 #include <asm/div64.h>
0041 typedef __u64 __bitwise __fs64;
0042 typedef __u32 __bitwise __fs32;
0043 typedef __u16 __bitwise __fs16;
0044 
0045 #define UFS_BBLOCK 0
0046 #define UFS_BBSIZE 8192
0047 #define UFS_SBLOCK 8192
0048 #define UFS_SBSIZE 8192
0049 
0050 #define UFS_SECTOR_SIZE 512
0051 #define UFS_SECTOR_BITS 9
0052 #define UFS_MAGIC  0x00011954
0053 #define UFS_MAGIC_BW 0x0f242697
0054 #define UFS2_MAGIC 0x19540119
0055 #define UFS_CIGAM  0x54190100 /* byteswapped MAGIC */
0056 
0057 /* Copied from FreeBSD */
0058 /*
0059  * Each disk drive contains some number of filesystems.
0060  * A filesystem consists of a number of cylinder groups.
0061  * Each cylinder group has inodes and data.
0062  *
0063  * A filesystem is described by its super-block, which in turn
0064  * describes the cylinder groups.  The super-block is critical
0065  * data and is replicated in each cylinder group to protect against
0066  * catastrophic loss.  This is done at `newfs' time and the critical
0067  * super-block data does not change, so the copies need not be
0068  * referenced further unless disaster strikes.
0069  *
0070  * For filesystem fs, the offsets of the various blocks of interest
0071  * are given in the super block as:
0072  *      [fs->fs_sblkno]         Super-block
0073  *      [fs->fs_cblkno]         Cylinder group block
0074  *      [fs->fs_iblkno]         Inode blocks
0075  *      [fs->fs_dblkno]         Data blocks
0076  * The beginning of cylinder group cg in fs, is given by
0077  * the ``cgbase(fs, cg)'' macro.
0078  *
0079  * Depending on the architecture and the media, the superblock may
0080  * reside in any one of four places. For tiny media where every block
0081  * counts, it is placed at the very front of the partition. Historically,
0082  * UFS1 placed it 8K from the front to leave room for the disk label and
0083  * a small bootstrap. For UFS2 it got moved to 64K from the front to leave
0084  * room for the disk label and a bigger bootstrap, and for really piggy
0085  * systems we check at 256K from the front if the first three fail. In
0086  * all cases the size of the superblock will be SBLOCKSIZE. All values are
0087  * given in byte-offset form, so they do not imply a sector size. The
0088  * SBLOCKSEARCH specifies the order in which the locations should be searched.
0089  */
0090 #define SBLOCK_FLOPPY        0
0091 #define SBLOCK_UFS1       8192
0092 #define SBLOCK_UFS2      65536
0093 #define SBLOCK_PIGGY    262144
0094 #define SBLOCKSIZE        8192
0095 #define SBLOCKSEARCH \
0096         { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 }
0097 
0098 
0099 /* HP specific MAGIC values */
0100 
0101 #define UFS_MAGIC_LFN   0x00095014 /* fs supports filenames > 14 chars */
0102 #define UFS_CIGAM_LFN   0x14500900 /* srahc 41 < semanelif stroppus sf */
0103 
0104 #define UFS_MAGIC_SEC   0x00612195 /* B1 security fs */
0105 #define UFS_CIGAM_SEC   0x95216100
0106 
0107 #define UFS_MAGIC_FEA   0x00195612 /* fs_featurebits supported */
0108 #define UFS_CIGAM_FEA   0x12561900
0109 
0110 #define UFS_MAGIC_4GB   0x05231994 /* fs > 4 GB && fs_featurebits */
0111 #define UFS_CIGAM_4GB   0x94192305
0112 
0113 /* Seems somebody at HP goofed here. B1 and lfs are both 0x2 !?! */
0114 #define UFS_FSF_LFN     0x00000001 /* long file names */
0115 #define UFS_FSF_B1      0x00000002 /* B1 security */
0116 #define UFS_FSF_LFS     0x00000002 /* large files */
0117 #define UFS_FSF_LUID    0x00000004 /* large UIDs */
0118 
0119 /* End of HP stuff */
0120 
0121 
0122 #define UFS_BSIZE   8192
0123 #define UFS_MINBSIZE    4096
0124 #define UFS_FSIZE   1024
0125 #define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE)
0126 
0127 #define UFS_NDADDR 12
0128 #define UFS_NINDIR 3
0129 
0130 #define UFS_IND_BLOCK   (UFS_NDADDR + 0)
0131 #define UFS_DIND_BLOCK  (UFS_NDADDR + 1)
0132 #define UFS_TIND_BLOCK  (UFS_NDADDR + 2)
0133 
0134 #define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift)
0135 #define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift)
0136 #define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift)
0137 #define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift)
0138 
0139 #define UFS_ROOTINO 2
0140 #define UFS_FIRST_INO (UFS_ROOTINO + 1)
0141 
0142 #define UFS_USEEFT  ((__u16)65535)
0143 
0144 /* fs_clean values */
0145 #define UFS_FSOK      0x7c269d38
0146 #define UFS_FSACTIVE  ((__s8)0x00)
0147 #define UFS_FSCLEAN   ((__s8)0x01)
0148 #define UFS_FSSTABLE  ((__s8)0x02)
0149 #define UFS_FSOSF1    ((__s8)0x03)  /* is this correct for DEC OSF/1? */
0150 #define UFS_FSBAD     ((__s8)0xff)
0151 
0152 /* Solaris-specific fs_clean values */
0153 #define UFS_FSSUSPEND ((__s8)0xfe)  /* temporarily suspended */
0154 #define UFS_FSLOG     ((__s8)0xfd)  /* logging fs */
0155 #define UFS_FSFIX     ((__s8)0xfc)  /* being repaired while mounted */
0156 
0157 /* From here to next blank line, s_flags for ufs_sb_info */
0158 /* directory entry encoding */
0159 #define UFS_DE_MASK     0x00000010  /* mask for the following */
0160 #define UFS_DE_OLD      0x00000000
0161 #define UFS_DE_44BSD        0x00000010
0162 /* uid encoding */
0163 #define UFS_UID_MASK        0x00000060  /* mask for the following */
0164 #define UFS_UID_OLD     0x00000000
0165 #define UFS_UID_44BSD       0x00000020
0166 #define UFS_UID_EFT     0x00000040
0167 /* superblock state encoding */
0168 #define UFS_ST_MASK     0x00000700  /* mask for the following */
0169 #define UFS_ST_OLD      0x00000000
0170 #define UFS_ST_44BSD        0x00000100
0171 #define UFS_ST_SUN      0x00000200 /* Solaris */
0172 #define UFS_ST_SUNOS        0x00000300
0173 #define UFS_ST_SUNx86       0x00000400 /* Solaris x86 */
0174 /*cylinder group encoding */
0175 #define UFS_CG_MASK     0x00003000  /* mask for the following */
0176 #define UFS_CG_OLD      0x00000000
0177 #define UFS_CG_44BSD        0x00002000
0178 #define UFS_CG_SUN      0x00001000
0179 /* filesystem type encoding */
0180 #define UFS_TYPE_MASK       0x00010000  /* mask for the following */
0181 #define UFS_TYPE_UFS1       0x00000000
0182 #define UFS_TYPE_UFS2       0x00010000
0183 
0184 
0185 /* fs_inodefmt options */
0186 #define UFS_42INODEFMT  -1
0187 #define UFS_44INODEFMT  2
0188 
0189 /*
0190  * MINFREE gives the minimum acceptable percentage of file system
0191  * blocks which may be free. If the freelist drops below this level
0192  * only the superuser may continue to allocate blocks. This may
0193  * be set to 0 if no reserve of free blocks is deemed necessary,
0194  * however throughput drops by fifty percent if the file system
0195  * is run at between 95% and 100% full; thus the minimum default
0196  * value of fs_minfree is 5%. However, to get good clustering
0197  * performance, 10% is a better choice. hence we use 10% as our
0198  * default value. With 10% free space, fragmentation is not a
0199  * problem, so we choose to optimize for time.
0200  */
0201 #define UFS_MINFREE         5
0202 #define UFS_DEFAULTOPT      UFS_OPTTIME
0203 
0204 /*
0205  * Turn file system block numbers into disk block addresses.
0206  * This maps file system blocks to device size blocks.
0207  */
0208 #define ufs_fsbtodb(uspi, b)    ((b) << (uspi)->s_fsbtodb)
0209 #define ufs_dbtofsb(uspi, b)    ((b) >> (uspi)->s_fsbtodb)
0210 
0211 /*
0212  * Cylinder group macros to locate things in cylinder groups.
0213  * They calc file system addresses of cylinder group data structures.
0214  */
0215 #define ufs_cgbase(c)   (uspi->s_fpg * (c))
0216 #define ufs_cgstart(c)  ((uspi)->fs_magic == UFS2_MAGIC ?  ufs_cgbase(c) : \
0217     (ufs_cgbase(c)  + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask)))
0218 #define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno)   /* super blk */
0219 #define ufs_cgcmin(c)   (ufs_cgstart(c) + uspi->s_cblkno)   /* cg block */
0220 #define ufs_cgimin(c)   (ufs_cgstart(c) + uspi->s_iblkno)   /* inode blk */
0221 #define ufs_cgdmin(c)   (ufs_cgstart(c) + uspi->s_dblkno)   /* 1st data */
0222 
0223 /*
0224  * Macros for handling inode numbers:
0225  *     inode number to file system block offset.
0226  *     inode number to cylinder group number.
0227  *     inode number to file system block address.
0228  */
0229 #define ufs_inotocg(x)      ((x) / uspi->s_ipg)
0230 #define ufs_inotocgoff(x)   ((x) % uspi->s_ipg)
0231 #define ufs_inotofsba(x)    (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
0232 #define ufs_inotofsbo(x)    ((x) % uspi->s_inopf)
0233 
0234 /*
0235  * Compute the cylinder and rotational position of a cyl block addr.
0236  */
0237 #define ufs_cbtocylno(bno) \
0238     ((bno) * uspi->s_nspf / uspi->s_spc)
0239 #define ufs_cbtorpos(bno)                     \
0240     ((UFS_SB(sb)->s_flags & UFS_CG_SUN) ?             \
0241      (((((bno) * uspi->s_nspf % uspi->s_spc) %        \
0242         uspi->s_nsect) *                      \
0243        uspi->s_nrpos) / uspi->s_nsect)            \
0244      :                            \
0245     ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
0246     * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
0247     % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
0248       * uspi->s_nrpos) / uspi->s_npsect))
0249 
0250 /*
0251  * The following macros optimize certain frequently calculated
0252  * quantities by using shifts and masks in place of divisions
0253  * modulos and multiplications.
0254  */
0255 #define ufs_blkoff(loc)     ((loc) & uspi->s_qbmask)
0256 #define ufs_fragoff(loc)    ((loc) & uspi->s_qfmask)
0257 #define ufs_lblktosize(blk) ((blk) << uspi->s_bshift)
0258 #define ufs_lblkno(loc)     ((loc) >> uspi->s_bshift)
0259 #define ufs_numfrags(loc)   ((loc) >> uspi->s_fshift)
0260 #define ufs_blkroundup(size)    (((size) + uspi->s_qbmask) & uspi->s_bmask)
0261 #define ufs_fragroundup(size)   (((size) + uspi->s_qfmask) & uspi->s_fmask)
0262 #define ufs_fragstoblks(frags)  ((frags) >> uspi->s_fpbshift)
0263 #define ufs_blkstofrags(blks)   ((blks) << uspi->s_fpbshift)
0264 #define ufs_fragnum(fsb)    ((fsb) & uspi->s_fpbmask)
0265 #define ufs_blknum(fsb)     ((fsb) & ~uspi->s_fpbmask)
0266 
0267 #define UFS_MAXNAMLEN 255
0268 #define UFS_MAXMNTLEN 512
0269 #define UFS2_MAXMNTLEN 468
0270 #define UFS2_MAXVOLLEN 32
0271 #define UFS_MAXCSBUFS 31
0272 #define UFS_LINK_MAX 32000
0273 /*
0274 #define UFS2_NOCSPTRS   ((128 / sizeof(void *)) - 4)
0275 */
0276 #define UFS2_NOCSPTRS   28
0277 
0278 /*
0279  * UFS_DIR_PAD defines the directory entries boundaries
0280  * (must be a multiple of 4)
0281  */
0282 #define UFS_DIR_PAD         4
0283 #define UFS_DIR_ROUND           (UFS_DIR_PAD - 1)
0284 #define UFS_DIR_REC_LEN(name_len)   (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND)
0285 
0286 struct ufs_timeval {
0287     __fs32  tv_sec;
0288     __fs32  tv_usec;
0289 };
0290 
0291 struct ufs_dir_entry {
0292     __fs32  d_ino;          /* inode number of this entry */
0293     __fs16  d_reclen;       /* length of this entry */
0294     union {
0295         __fs16  d_namlen;       /* actual length of d_name */
0296         struct {
0297             __u8    d_type;     /* file type */
0298             __u8    d_namlen;   /* length of string in d_name */
0299         } d_44;
0300     } d_u;
0301     __u8    d_name[UFS_MAXNAMLEN + 1];  /* file name */
0302 };
0303 
0304 struct ufs_csum {
0305     __fs32  cs_ndir;    /* number of directories */
0306     __fs32  cs_nbfree;  /* number of free blocks */
0307     __fs32  cs_nifree;  /* number of free inodes */
0308     __fs32  cs_nffree;  /* number of free frags */
0309 };
0310 struct ufs2_csum_total {
0311     __fs64  cs_ndir;    /* number of directories */
0312     __fs64  cs_nbfree;  /* number of free blocks */
0313     __fs64  cs_nifree;  /* number of free inodes */
0314     __fs64  cs_nffree;  /* number of free frags */
0315     __fs64   cs_numclusters;    /* number of free clusters */
0316     __fs64   cs_spare[3];   /* future expansion */
0317 };
0318 
0319 struct ufs_csum_core {
0320     __u64   cs_ndir;    /* number of directories */
0321     __u64   cs_nbfree;  /* number of free blocks */
0322     __u64   cs_nifree;  /* number of free inodes */
0323     __u64   cs_nffree;  /* number of free frags */
0324     __u64   cs_numclusters; /* number of free clusters */
0325 };
0326 
0327 /*
0328  * File system flags
0329  */
0330 #define UFS_UNCLEAN      0x01    /* file system not clean at mount (unused) */
0331 #define UFS_DOSOFTDEP    0x02    /* file system using soft dependencies */
0332 #define UFS_NEEDSFSCK    0x04    /* needs sync fsck (FreeBSD compat, unused) */
0333 #define UFS_INDEXDIRS    0x08    /* kernel supports indexed directories */
0334 #define UFS_ACLS         0x10    /* file system has ACLs enabled */
0335 #define UFS_MULTILABEL   0x20    /* file system is MAC multi-label */
0336 #define UFS_FLAGS_UPDATED 0x80   /* flags have been moved to new location */
0337 
0338 #if 0
0339 /*
0340  * This is the actual superblock, as it is laid out on the disk.
0341  * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and
0342  * it may occupy several blocks, use
0343  * struct ufs_super_block_(first,second,third) instead.
0344  */
0345 struct ufs_super_block {
0346     union {
0347         struct {
0348             __fs32  fs_link;    /* UNUSED */
0349         } fs_42;
0350         struct {
0351             __fs32  fs_state;   /* file system state flag */
0352         } fs_sun;
0353     } fs_u0;
0354     __fs32  fs_rlink;   /* UNUSED */
0355     __fs32  fs_sblkno;  /* addr of super-block in filesys */
0356     __fs32  fs_cblkno;  /* offset of cyl-block in filesys */
0357     __fs32  fs_iblkno;  /* offset of inode-blocks in filesys */
0358     __fs32  fs_dblkno;  /* offset of first data after cg */
0359     __fs32  fs_cgoffset;    /* cylinder group offset in cylinder */
0360     __fs32  fs_cgmask;  /* used to calc mod fs_ntrak */
0361     __fs32  fs_time;    /* last time written -- time_t */
0362     __fs32  fs_size;    /* number of blocks in fs */
0363     __fs32  fs_dsize;   /* number of data blocks in fs */
0364     __fs32  fs_ncg;     /* number of cylinder groups */
0365     __fs32  fs_bsize;   /* size of basic blocks in fs */
0366     __fs32  fs_fsize;   /* size of frag blocks in fs */
0367     __fs32  fs_frag;    /* number of frags in a block in fs */
0368 /* these are configuration parameters */
0369     __fs32  fs_minfree; /* minimum percentage of free blocks */
0370     __fs32  fs_rotdelay;    /* num of ms for optimal next block */
0371     __fs32  fs_rps;     /* disk revolutions per second */
0372 /* these fields can be computed from the others */
0373     __fs32  fs_bmask;   /* ``blkoff'' calc of blk offsets */
0374     __fs32  fs_fmask;   /* ``fragoff'' calc of frag offsets */
0375     __fs32  fs_bshift;  /* ``lblkno'' calc of logical blkno */
0376     __fs32  fs_fshift;  /* ``numfrags'' calc number of frags */
0377 /* these are configuration parameters */
0378     __fs32  fs_maxcontig;   /* max number of contiguous blks */
0379     __fs32  fs_maxbpg;  /* max number of blks per cyl group */
0380 /* these fields can be computed from the others */
0381     __fs32  fs_fragshift;   /* block to frag shift */
0382     __fs32  fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
0383     __fs32  fs_sbsize;  /* actual size of super block */
0384     __fs32  fs_csmask;  /* csum block offset */
0385     __fs32  fs_csshift; /* csum block number */
0386     __fs32  fs_nindir;  /* value of NINDIR */
0387     __fs32  fs_inopb;   /* value of INOPB */
0388     __fs32  fs_nspf;    /* value of NSPF */
0389 /* yet another configuration parameter */
0390     __fs32  fs_optim;   /* optimization preference, see below */
0391 /* these fields are derived from the hardware */
0392     union {
0393         struct {
0394             __fs32  fs_npsect;  /* # sectors/track including spares */
0395         } fs_sun;
0396         struct {
0397             __fs32  fs_state;   /* file system state time stamp */
0398         } fs_sunx86;
0399     } fs_u1;
0400     __fs32  fs_interleave;  /* hardware sector interleave */
0401     __fs32  fs_trackskew;   /* sector 0 skew, per track */
0402 /* a unique id for this filesystem (currently unused and unmaintained) */
0403 /* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */
0404 /* Neither of those fields is used in the Tahoe code right now but */
0405 /* there could be problems if they are.                            */
0406     __fs32  fs_id[2];   /* file system id */
0407 /* sizes determined by number of cylinder groups and their sizes */
0408     __fs32  fs_csaddr;  /* blk addr of cyl grp summary area */
0409     __fs32  fs_cssize;  /* size of cyl grp summary area */
0410     __fs32  fs_cgsize;  /* cylinder group size */
0411 /* these fields are derived from the hardware */
0412     __fs32  fs_ntrak;   /* tracks per cylinder */
0413     __fs32  fs_nsect;   /* sectors per track */
0414     __fs32  fs_spc;     /* sectors per cylinder */
0415 /* this comes from the disk driver partitioning */
0416     __fs32  fs_ncyl;    /* cylinders in file system */
0417 /* these fields can be computed from the others */
0418     __fs32  fs_cpg;     /* cylinders per group */
0419     __fs32  fs_ipg;     /* inodes per cylinder group */
0420     __fs32  fs_fpg;     /* blocks per group * fs_frag */
0421 /* this data must be re-computed after crashes */
0422     struct ufs_csum fs_cstotal; /* cylinder summary information */
0423 /* these fields are cleared at mount time */
0424     __s8    fs_fmod;    /* super block modified flag */
0425     __s8    fs_clean;   /* file system is clean flag */
0426     __s8    fs_ronly;   /* mounted read-only flag */
0427     __s8    fs_flags;
0428     union {
0429         struct {
0430             __s8    fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */
0431             __fs32  fs_cgrotor; /* last cg searched */
0432             __fs32  fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */
0433             __fs32  fs_maxcluster;
0434             __fs32  fs_cpc;     /* cyl per cycle in postbl */
0435             __fs16  fs_opostbl[16][8]; /* old rotation block list head */
0436         } fs_u1;
0437         struct {
0438             __s8  fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */
0439             __u8   fs_volname[UFS2_MAXVOLLEN]; /* volume name */
0440             __fs64  fs_swuid;       /* system-wide uid */
0441             __fs32  fs_pad; /* due to alignment of fs_swuid */
0442             __fs32   fs_cgrotor;     /* last cg searched */
0443             __fs32   fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */
0444             __fs32   fs_contigdirs;/*# of contiguously allocated dirs */
0445             __fs32   fs_csp;    /* cg summary info buffer for fs_cs */
0446             __fs32   fs_maxcluster;
0447             __fs32   fs_active;/* used by snapshots to track fs */
0448             __fs32   fs_old_cpc;    /* cyl per cycle in postbl */
0449             __fs32   fs_maxbsize;/*maximum blocking factor permitted */
0450             __fs64   fs_sparecon64[17];/*old rotation block list head */
0451             __fs64   fs_sblockloc; /* byte offset of standard superblock */
0452             struct  ufs2_csum_total fs_cstotal;/*cylinder summary information*/
0453             struct  ufs_timeval    fs_time;     /* last time written */
0454             __fs64    fs_size;      /* number of blocks in fs */
0455             __fs64    fs_dsize; /* number of data blocks in fs */
0456             __fs64   fs_csaddr; /* blk addr of cyl grp summary area */
0457             __fs64    fs_pendingblocks;/* blocks in process of being freed */
0458             __fs32    fs_pendinginodes;/*inodes in process of being freed */
0459         } fs_u2;
0460     }  fs_u11;
0461     union {
0462         struct {
0463             __fs32  fs_sparecon[53];/* reserved for future constants */
0464             __fs32  fs_reclaim;
0465             __fs32  fs_sparecon2[1];
0466             __fs32  fs_state;   /* file system state time stamp */
0467             __fs32  fs_qbmask[2];   /* ~usb_bmask */
0468             __fs32  fs_qfmask[2];   /* ~usb_fmask */
0469         } fs_sun;
0470         struct {
0471             __fs32  fs_sparecon[53];/* reserved for future constants */
0472             __fs32  fs_reclaim;
0473             __fs32  fs_sparecon2[1];
0474             __fs32  fs_npsect;  /* # sectors/track including spares */
0475             __fs32  fs_qbmask[2];   /* ~usb_bmask */
0476             __fs32  fs_qfmask[2];   /* ~usb_fmask */
0477         } fs_sunx86;
0478         struct {
0479             __fs32  fs_sparecon[50];/* reserved for future constants */
0480             __fs32  fs_contigsumsize;/* size of cluster summary array */
0481             __fs32  fs_maxsymlinklen;/* max length of an internal symlink */
0482             __fs32  fs_inodefmt;    /* format of on-disk inodes */
0483             __fs32  fs_maxfilesize[2];  /* max representable file size */
0484             __fs32  fs_qbmask[2];   /* ~usb_bmask */
0485             __fs32  fs_qfmask[2];   /* ~usb_fmask */
0486             __fs32  fs_state;   /* file system state time stamp */
0487         } fs_44;
0488     } fs_u2;
0489     __fs32  fs_postblformat;    /* format of positional layout tables */
0490     __fs32  fs_nrpos;       /* number of rotational positions */
0491     __fs32  fs_postbloff;       /* (__s16) rotation block list head */
0492     __fs32  fs_rotbloff;        /* (__u8) blocks for each rotation */
0493     __fs32  fs_magic;       /* magic number */
0494     __u8    fs_space[1];        /* list of blocks for each rotation */
0495 };
0496 #endif/*struct ufs_super_block*/
0497 
0498 /*
0499  * Preference for optimization.
0500  */
0501 #define UFS_OPTTIME 0   /* minimize allocation time */
0502 #define UFS_OPTSPACE    1   /* minimize disk fragmentation */
0503 
0504 /*
0505  * Rotational layout table format types
0506  */
0507 #define UFS_42POSTBLFMT     -1  /* 4.2BSD rotational table format */
0508 #define UFS_DYNAMICPOSTBLFMT    1   /* dynamic rotational table format */
0509 
0510 /*
0511  * Convert cylinder group to base address of its global summary info.
0512  */
0513 #define fs_cs(indx) s_csp[(indx)]
0514 
0515 /*
0516  * Cylinder group block for a file system.
0517  *
0518  * Writable fields in the cylinder group are protected by the associated
0519  * super block lock fs->fs_lock.
0520  */
0521 #define CG_MAGIC    0x090255
0522 #define ufs_cg_chkmagic(sb, ucg) \
0523     (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC)
0524 /*
0525  * Macros for access to old cylinder group array structures
0526  */
0527 #define ufs_ocg_blktot(sb, ucg)      fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot)
0528 #define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno])
0529 #define ufs_ocg_inosused(sb, ucg)    fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused)
0530 #define ufs_ocg_blksfree(sb, ucg)    fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free)
0531 #define ufs_ocg_chkmagic(sb, ucg) \
0532     (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC)
0533 
0534 /*
0535  * size of this structure is 172 B
0536  */
0537 struct  ufs_cylinder_group {
0538     __fs32  cg_link;        /* linked list of cyl groups */
0539     __fs32  cg_magic;       /* magic number */
0540     __fs32  cg_time;        /* time last written */
0541     __fs32  cg_cgx;         /* we are the cgx'th cylinder group */
0542     __fs16  cg_ncyl;        /* number of cyl's this cg */
0543     __fs16  cg_niblk;       /* number of inode blocks this cg */
0544     __fs32  cg_ndblk;       /* number of data blocks this cg */
0545     struct  ufs_csum cg_cs;     /* cylinder summary information */
0546     __fs32  cg_rotor;       /* position of last used block */
0547     __fs32  cg_frotor;      /* position of last used frag */
0548     __fs32  cg_irotor;      /* position of last used inode */
0549     __fs32  cg_frsum[UFS_MAXFRAG];  /* counts of available frags */
0550     __fs32  cg_btotoff;     /* (__u32) block totals per cylinder */
0551     __fs32  cg_boff;        /* (short) free block positions */
0552     __fs32  cg_iusedoff;        /* (char) used inode map */
0553     __fs32  cg_freeoff;     /* (u_char) free block map */
0554     __fs32  cg_nextfreeoff;     /* (u_char) next available space */
0555     union {
0556         struct {
0557             __fs32  cg_clustersumoff;   /* (u_int32) counts of avail clusters */
0558             __fs32  cg_clusteroff;      /* (u_int8) free cluster map */
0559             __fs32  cg_nclusterblks;    /* number of clusters this cg */
0560             __fs32  cg_sparecon[13];    /* reserved for future use */
0561         } cg_44;
0562         struct {
0563             __fs32  cg_clustersumoff;/* (u_int32) counts of avail clusters */
0564             __fs32  cg_clusteroff;  /* (u_int8) free cluster map */
0565             __fs32  cg_nclusterblks;/* number of clusters this cg */
0566             __fs32   cg_niblk; /* number of inode blocks this cg */
0567             __fs32   cg_initediblk; /* last initialized inode */
0568             __fs32   cg_sparecon32[3];/* reserved for future use */
0569             __fs64   cg_time;   /* time last written */
0570             __fs64  cg_sparecon[3]; /* reserved for future use */
0571         } cg_u2;
0572         __fs32  cg_sparecon[16];    /* reserved for future use */
0573     } cg_u;
0574     __u8    cg_space[1];        /* space for cylinder group maps */
0575 /* actually longer */
0576 };
0577 
0578 /* Historic Cylinder group info */
0579 struct ufs_old_cylinder_group {
0580     __fs32  cg_link;        /* linked list of cyl groups */
0581     __fs32  cg_rlink;       /* for incore cyl groups     */
0582     __fs32  cg_time;        /* time last written */
0583     __fs32  cg_cgx;         /* we are the cgx'th cylinder group */
0584     __fs16  cg_ncyl;        /* number of cyl's this cg */
0585     __fs16  cg_niblk;       /* number of inode blocks this cg */
0586     __fs32  cg_ndblk;       /* number of data blocks this cg */
0587     struct  ufs_csum cg_cs;     /* cylinder summary information */
0588     __fs32  cg_rotor;       /* position of last used block */
0589     __fs32  cg_frotor;      /* position of last used frag */
0590     __fs32  cg_irotor;      /* position of last used inode */
0591     __fs32  cg_frsum[8];        /* counts of available frags */
0592     __fs32  cg_btot[32];        /* block totals per cylinder */
0593     __fs16  cg_b[32][8];        /* positions of free blocks */
0594     __u8    cg_iused[256];      /* used inode map */
0595     __fs32  cg_magic;       /* magic number */
0596     __u8    cg_free[1];     /* free block map */
0597 /* actually longer */
0598 };
0599 
0600 /*
0601  * structure of an on-disk inode
0602  */
0603 struct ufs_inode {
0604     __fs16  ui_mode;        /*  0x0 */
0605     __fs16  ui_nlink;       /*  0x2 */
0606     union {
0607         struct {
0608             __fs16  ui_suid;    /*  0x4 */
0609             __fs16  ui_sgid;    /*  0x6 */
0610         } oldids;
0611         __fs32  ui_inumber;     /*  0x4 lsf: inode number */
0612         __fs32  ui_author;      /*  0x4 GNU HURD: author */
0613     } ui_u1;
0614     __fs64  ui_size;        /*  0x8 */
0615     struct ufs_timeval ui_atime;    /* 0x10 access */
0616     struct ufs_timeval ui_mtime;    /* 0x18 modification */
0617     struct ufs_timeval ui_ctime;    /* 0x20 creation */
0618     union {
0619         struct {
0620             __fs32  ui_db[UFS_NDADDR];/* 0x28 data blocks */
0621             __fs32  ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */
0622         } ui_addr;
0623         __u8    ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
0624     } ui_u2;
0625     __fs32  ui_flags;       /* 0x64 immutable, append-only... */
0626     __fs32  ui_blocks;      /* 0x68 blocks in use */
0627     __fs32  ui_gen;         /* 0x6c like ext2 i_version, for NFS support */
0628     union {
0629         struct {
0630             __fs32  ui_shadow;  /* 0x70 shadow inode with security data */
0631             __fs32  ui_uid;     /* 0x74 long EFT version of uid */
0632             __fs32  ui_gid;     /* 0x78 long EFT version of gid */
0633             __fs32  ui_oeftflag;    /* 0x7c reserved */
0634         } ui_sun;
0635         struct {
0636             __fs32  ui_uid;     /* 0x70 File owner */
0637             __fs32  ui_gid;     /* 0x74 File group */
0638             __fs32  ui_spare[2];    /* 0x78 reserved */
0639         } ui_44;
0640         struct {
0641             __fs32  ui_uid;     /* 0x70 */
0642             __fs32  ui_gid;     /* 0x74 */
0643             __fs16  ui_modeh;   /* 0x78 mode high bits */
0644             __fs16  ui_spare;   /* 0x7A unused */
0645             __fs32  ui_trans;   /* 0x7c filesystem translator */
0646         } ui_hurd;
0647     } ui_u3;
0648 };
0649 
0650 #define UFS_NXADDR  2            /* External addresses in inode. */
0651 struct ufs2_inode {
0652     __fs16     ui_mode;        /*   0: IFMT, permissions; see below. */
0653     __fs16     ui_nlink;       /*   2: File link count. */
0654     __fs32     ui_uid;         /*   4: File owner. */
0655     __fs32     ui_gid;         /*   8: File group. */
0656     __fs32     ui_blksize;     /*  12: Inode blocksize. */
0657     __fs64     ui_size;        /*  16: File byte count. */
0658     __fs64     ui_blocks;      /*  24: Bytes actually held. */
0659     __fs64   ui_atime;       /*  32: Last access time. */
0660     __fs64   ui_mtime;       /*  40: Last modified time. */
0661     __fs64   ui_ctime;       /*  48: Last inode change time. */
0662     __fs64   ui_birthtime;   /*  56: Inode creation time. */
0663     __fs32     ui_mtimensec;   /*  64: Last modified time. */
0664     __fs32     ui_atimensec;   /*  68: Last access time. */
0665     __fs32     ui_ctimensec;   /*  72: Last inode change time. */
0666     __fs32     ui_birthnsec;   /*  76: Inode creation time. */
0667     __fs32     ui_gen;         /*  80: Generation number. */
0668     __fs32     ui_kernflags;   /*  84: Kernel flags. */
0669     __fs32     ui_flags;       /*  88: Status flags (chflags). */
0670     __fs32     ui_extsize;     /*  92: External attributes block. */
0671     __fs64     ui_extb[UFS_NXADDR];/*  96: External attributes block. */
0672     union {
0673         struct {
0674             __fs64     ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */
0675             __fs64     ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/
0676         } ui_addr;
0677     __u8    ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
0678     } ui_u2;
0679     __fs64     ui_spare[3];    /* 232: Reserved; currently unused */
0680 };
0681 
0682 
0683 /* FreeBSD has these in sys/stat.h */
0684 /* ui_flags that can be set by a file owner */
0685 #define UFS_UF_SETTABLE   0x0000ffff
0686 #define UFS_UF_NODUMP     0x00000001  /* do not dump */
0687 #define UFS_UF_IMMUTABLE  0x00000002  /* immutable (can't "change") */
0688 #define UFS_UF_APPEND     0x00000004  /* append-only */
0689 #define UFS_UF_OPAQUE     0x00000008  /* directory is opaque (unionfs) */
0690 #define UFS_UF_NOUNLINK   0x00000010  /* can't be removed or renamed */
0691 /* ui_flags that only root can set */
0692 #define UFS_SF_SETTABLE   0xffff0000
0693 #define UFS_SF_ARCHIVED   0x00010000  /* archived */
0694 #define UFS_SF_IMMUTABLE  0x00020000  /* immutable (can't "change") */
0695 #define UFS_SF_APPEND     0x00040000  /* append-only */
0696 #define UFS_SF_NOUNLINK   0x00100000  /* can't be removed or renamed */
0697 
0698 /*
0699  * This structure is used for reading disk structures larger
0700  * than the size of fragment.
0701  */
0702 struct ufs_buffer_head {
0703     __u64 fragment;         /* first fragment */
0704     __u64 count;                /* number of fragments */
0705     struct buffer_head * bh[UFS_MAXFRAG];   /* buffers */
0706 };
0707 
0708 struct ufs_cg_private_info {
0709     struct ufs_buffer_head c_ubh;
0710     __u32   c_cgx;      /* number of cylidner group */
0711     __u16   c_ncyl;     /* number of cyl's this cg */
0712     __u16   c_niblk;    /* number of inode blocks this cg */
0713     __u32   c_ndblk;    /* number of data blocks this cg */
0714     __u32   c_rotor;    /* position of last used block */
0715     __u32   c_frotor;   /* position of last used frag */
0716     __u32   c_irotor;   /* position of last used inode */
0717     __u32   c_btotoff;  /* (__u32) block totals per cylinder */
0718     __u32   c_boff;     /* (short) free block positions */
0719     __u32   c_iusedoff; /* (char) used inode map */
0720     __u32   c_freeoff;  /* (u_char) free block map */
0721     __u32   c_nextfreeoff;  /* (u_char) next available space */
0722     __u32   c_clustersumoff;/* (u_int32) counts of avail clusters */
0723     __u32   c_clusteroff;   /* (u_int8) free cluster map */
0724     __u32   c_nclusterblks; /* number of clusters this cg */
0725 };
0726 
0727 
0728 struct ufs_sb_private_info {
0729     struct ufs_buffer_head s_ubh; /* buffer containing super block */
0730     struct ufs_csum_core cs_total;
0731     __u32   s_sblkno;   /* offset of super-blocks in filesys */
0732     __u32   s_cblkno;   /* offset of cg-block in filesys */
0733     __u32   s_iblkno;   /* offset of inode-blocks in filesys */
0734     __u32   s_dblkno;   /* offset of first data after cg */
0735     __u32   s_cgoffset; /* cylinder group offset in cylinder */
0736     __u32   s_cgmask;   /* used to calc mod fs_ntrak */
0737     __u64   s_size;     /* number of blocks (fragments) in fs */
0738     __u64   s_dsize;    /* number of data blocks in fs */
0739     __u32   s_ncg;      /* number of cylinder groups */
0740     __u32   s_bsize;    /* size of basic blocks */
0741     __u32   s_fsize;    /* size of fragments */
0742     __u32   s_fpb;      /* fragments per block */
0743     __u32   s_minfree;  /* minimum percentage of free blocks */
0744     __u32   s_bmask;    /* `blkoff'' calc of blk offsets */
0745     __u32   s_fmask;    /* s_fsize mask */
0746     __u32   s_bshift;   /* `lblkno'' calc of logical blkno */
0747     __u32   s_fshift;   /* s_fsize shift */
0748     __u32   s_fpbshift; /* fragments per block shift */
0749     __u32   s_fsbtodb;  /* fsbtodb and dbtofsb shift constant */
0750     __u32   s_sbsize;   /* actual size of super block */
0751     __u32   s_csmask;   /* csum block offset */
0752     __u32   s_csshift;  /* csum block number */
0753     __u32   s_nindir;   /* value of NINDIR */
0754     __u32   s_inopb;    /* value of INOPB */
0755     __u32   s_nspf;     /* value of NSPF */
0756     __u32   s_npsect;   /* # sectors/track including spares */
0757     __u32   s_interleave;   /* hardware sector interleave */
0758     __u32   s_trackskew;    /* sector 0 skew, per track */
0759     __u64   s_csaddr;   /* blk addr of cyl grp summary area */
0760     __u32   s_cssize;   /* size of cyl grp summary area */
0761     __u32   s_cgsize;   /* cylinder group size */
0762     __u32   s_ntrak;    /* tracks per cylinder */
0763     __u32   s_nsect;    /* sectors per track */
0764     __u32   s_spc;      /* sectors per cylinder */
0765     __u32   s_ipg;      /* inodes per cylinder group */
0766     __u32   s_fpg;      /* fragments per group */
0767     __u32   s_cpc;      /* cyl per cycle in postbl */
0768     __s32   s_contigsumsize;/* size of cluster summary array, 44bsd */
0769     __s64   s_qbmask;   /* ~usb_bmask */
0770     __s64   s_qfmask;   /* ~usb_fmask */
0771     __s32   s_postblformat; /* format of positional layout tables */
0772     __s32   s_nrpos;    /* number of rotational positions */
0773         __s32   s_postbloff;    /* (__s16) rotation block list head */
0774     __s32   s_rotbloff; /* (__u8) blocks for each rotation */
0775 
0776     __u32   s_fpbmask;  /* fragments per block mask */
0777     __u32   s_apb;      /* address per block */
0778     __u32   s_2apb;     /* address per block^2 */
0779     __u32   s_3apb;     /* address per block^3 */
0780     __u32   s_apbmask;  /* address per block mask */
0781     __u32   s_apbshift; /* address per block shift */
0782     __u32   s_2apbshift;    /* address per block shift * 2 */
0783     __u32   s_3apbshift;    /* address per block shift * 3 */
0784     __u32   s_nspfshift;    /* number of sector per fragment shift */
0785     __u32   s_nspb;     /* number of sector per block */
0786     __u32   s_inopf;    /* inodes per fragment */
0787     __u32   s_sbbase;   /* offset of NeXTstep superblock */
0788     __u32   s_bpf;      /* bits per fragment */
0789     __u32   s_bpfshift; /* bits per fragment shift*/
0790     __u32   s_bpfmask;  /* bits per fragment mask */
0791 
0792     __u32   s_maxsymlinklen;/* upper limit on fast symlinks' size */
0793     __s32   fs_magic;       /* filesystem magic */
0794     unsigned int s_dirblksize;
0795     __u64   s_root_blocks;
0796     __u64   s_time_to_space;
0797     __u64   s_space_to_time;
0798 };
0799 
0800 /*
0801  * Sizes of this structures are:
0802  *  ufs_super_block_first   512
0803  *  ufs_super_block_second  512
0804  *  ufs_super_block_third   356
0805  */
0806 struct ufs_super_block_first {
0807     union {
0808         struct {
0809             __fs32  fs_link;    /* UNUSED */
0810         } fs_42;
0811         struct {
0812             __fs32  fs_state;   /* file system state flag */
0813         } fs_sun;
0814     } fs_u0;
0815     __fs32  fs_rlink;
0816     __fs32  fs_sblkno;
0817     __fs32  fs_cblkno;
0818     __fs32  fs_iblkno;
0819     __fs32  fs_dblkno;
0820     __fs32  fs_cgoffset;
0821     __fs32  fs_cgmask;
0822     __fs32  fs_time;
0823     __fs32  fs_size;
0824     __fs32  fs_dsize;
0825     __fs32  fs_ncg;
0826     __fs32  fs_bsize;
0827     __fs32  fs_fsize;
0828     __fs32  fs_frag;
0829     __fs32  fs_minfree;
0830     __fs32  fs_rotdelay;
0831     __fs32  fs_rps;
0832     __fs32  fs_bmask;
0833     __fs32  fs_fmask;
0834     __fs32  fs_bshift;
0835     __fs32  fs_fshift;
0836     __fs32  fs_maxcontig;
0837     __fs32  fs_maxbpg;
0838     __fs32  fs_fragshift;
0839     __fs32  fs_fsbtodb;
0840     __fs32  fs_sbsize;
0841     __fs32  fs_csmask;
0842     __fs32  fs_csshift;
0843     __fs32  fs_nindir;
0844     __fs32  fs_inopb;
0845     __fs32  fs_nspf;
0846     __fs32  fs_optim;
0847     union {
0848         struct {
0849             __fs32  fs_npsect;
0850         } fs_sun;
0851         struct {
0852             __fs32  fs_state;
0853         } fs_sunx86;
0854     } fs_u1;
0855     __fs32  fs_interleave;
0856     __fs32  fs_trackskew;
0857     __fs32  fs_id[2];
0858     __fs32  fs_csaddr;
0859     __fs32  fs_cssize;
0860     __fs32  fs_cgsize;
0861     __fs32  fs_ntrak;
0862     __fs32  fs_nsect;
0863     __fs32  fs_spc;
0864     __fs32  fs_ncyl;
0865     __fs32  fs_cpg;
0866     __fs32  fs_ipg;
0867     __fs32  fs_fpg;
0868     struct ufs_csum fs_cstotal;
0869     __s8    fs_fmod;
0870     __s8    fs_clean;
0871     __s8    fs_ronly;
0872     __s8    fs_flags;
0873     __s8    fs_fsmnt[UFS_MAXMNTLEN - 212];
0874 
0875 };
0876 
0877 struct ufs_super_block_second {
0878     union {
0879         struct {
0880             __s8    fs_fsmnt[212];
0881             __fs32  fs_cgrotor;
0882             __fs32  fs_csp[UFS_MAXCSBUFS];
0883             __fs32  fs_maxcluster;
0884             __fs32  fs_cpc;
0885             __fs16  fs_opostbl[82];
0886         } fs_u1;
0887         struct {
0888             __s8  fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212];
0889             __u8   fs_volname[UFS2_MAXVOLLEN];
0890             __fs64  fs_swuid;
0891             __fs32  fs_pad;
0892             __fs32   fs_cgrotor;
0893             __fs32   fs_ocsp[UFS2_NOCSPTRS];
0894             __fs32   fs_contigdirs;
0895             __fs32   fs_csp;
0896             __fs32   fs_maxcluster;
0897             __fs32   fs_active;
0898             __fs32   fs_old_cpc;
0899             __fs32   fs_maxbsize;
0900             __fs64   fs_sparecon64[17];
0901             __fs64   fs_sblockloc;
0902             __fs64  cs_ndir;
0903             __fs64  cs_nbfree;
0904         } fs_u2;
0905     } fs_un;
0906 };
0907 
0908 struct ufs_super_block_third {
0909     union {
0910         struct {
0911             __fs16  fs_opostbl[46];
0912         } fs_u1;
0913         struct {
0914             __fs64  cs_nifree;  /* number of free inodes */
0915             __fs64  cs_nffree;  /* number of free frags */
0916             __fs64   cs_numclusters;    /* number of free clusters */
0917             __fs64   cs_spare[3];   /* future expansion */
0918             struct  ufs_timeval    fs_time;     /* last time written */
0919             __fs64    fs_size;      /* number of blocks in fs */
0920             __fs64    fs_dsize; /* number of data blocks in fs */
0921             __fs64   fs_csaddr; /* blk addr of cyl grp summary area */
0922             __fs64    fs_pendingblocks;/* blocks in process of being freed */
0923             __fs32    fs_pendinginodes;/*inodes in process of being freed */
0924         } __attribute__ ((packed)) fs_u2;
0925     } fs_un1;
0926     union {
0927         struct {
0928             __fs32  fs_sparecon[53];/* reserved for future constants */
0929             __fs32  fs_reclaim;
0930             __fs32  fs_sparecon2[1];
0931             __fs32  fs_state;   /* file system state time stamp */
0932             __fs32  fs_qbmask[2];   /* ~usb_bmask */
0933             __fs32  fs_qfmask[2];   /* ~usb_fmask */
0934         } fs_sun;
0935         struct {
0936             __fs32  fs_sparecon[53];/* reserved for future constants */
0937             __fs32  fs_reclaim;
0938             __fs32  fs_sparecon2[1];
0939             __fs32  fs_npsect;  /* # sectors/track including spares */
0940             __fs32  fs_qbmask[2];   /* ~usb_bmask */
0941             __fs32  fs_qfmask[2];   /* ~usb_fmask */
0942         } fs_sunx86;
0943         struct {
0944             __fs32  fs_sparecon[50];/* reserved for future constants */
0945             __fs32  fs_contigsumsize;/* size of cluster summary array */
0946             __fs32  fs_maxsymlinklen;/* max length of an internal symlink */
0947             __fs32  fs_inodefmt;    /* format of on-disk inodes */
0948             __fs32  fs_maxfilesize[2];  /* max representable file size */
0949             __fs32  fs_qbmask[2];   /* ~usb_bmask */
0950             __fs32  fs_qfmask[2];   /* ~usb_fmask */
0951             __fs32  fs_state;   /* file system state time stamp */
0952         } fs_44;
0953     } fs_un2;
0954     __fs32  fs_postblformat;
0955     __fs32  fs_nrpos;
0956     __fs32  fs_postbloff;
0957     __fs32  fs_rotbloff;
0958     __fs32  fs_magic;
0959     __u8    fs_space[1];
0960 };
0961 
0962 #endif /* __LINUX_UFS_FS_H */