struct ufs_dir_entry {
__fs32 d_ino; /* inode number of this entry */
__fs16 d_reclen; /* length of this entry */ union {
__fs16 d_namlen; /* actual length of d_name */ struct {
__u8 d_type; /* file type */
__u8 d_namlen; /* length of string in d_name */
} d_44;
} d_u;
__u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */
};
struct ufs_csum {
__fs32 cs_ndir; /* number of directories */
__fs32 cs_nbfree; /* number of free blocks */
__fs32 cs_nifree; /* number of free inodes */
__fs32 cs_nffree; /* number of free frags */
}; struct ufs2_csum_total {
__fs64 cs_ndir; /* number of directories */
__fs64 cs_nbfree; /* number of free blocks */
__fs64 cs_nifree; /* number of free inodes */
__fs64 cs_nffree; /* number of free frags */
__fs64 cs_numclusters; /* number of free clusters */
__fs64 cs_spare[3]; /* future expansion */
};
struct ufs_csum_core {
__u64 cs_ndir; /* number of directories */
__u64 cs_nbfree; /* number of free blocks */
__u64 cs_nifree; /* number of free inodes */
__u64 cs_nffree; /* number of free frags */
__u64 cs_numclusters; /* number of free clusters */
};
/* *Filesystemflags
*/ #define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */ #define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */ #define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */ #define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */ #define UFS_ACLS 0x10 /* file system has ACLs enabled */ #define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */ #define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */
#if0 /* *Thisistheactualsuperblock,asitislaidoutonthedisk. *DoNOTusethisstructure,becauseofsizeof(ufs_super_block)>512and *itmayoccupyseveralblocks,use *structufs_super_block_(first,second,third)instead.
*/ struct ufs_super_block { union { struct {
__fs32 fs_link; /* UNUSED */
} fs_42; struct {
__fs32 fs_state; /* file system state flag */
} fs_sun;
} fs_u0;
__fs32 fs_rlink; /* UNUSED */
__fs32 fs_sblkno; /* addr of super-block in filesys */
__fs32 fs_cblkno; /* offset of cyl-block in filesys */
__fs32 fs_iblkno; /* offset of inode-blocks in filesys */
__fs32 fs_dblkno; /* offset of first data after cg */
__fs32 fs_cgoffset; /* cylinder group offset in cylinder */
__fs32 fs_cgmask; /* used to calc mod fs_ntrak */
__fs32 fs_time; /* last time written -- time_t */
__fs32 fs_size; /* number of blocks in fs */
__fs32 fs_dsize; /* number of data blocks in fs */
__fs32 fs_ncg; /* number of cylinder groups */
__fs32 fs_bsize; /* size of basic blocks in fs */
__fs32 fs_fsize; /* size of frag blocks in fs */
__fs32 fs_frag; /* number of frags in a block in fs */ /* these are configuration parameters */
__fs32 fs_minfree; /* minimum percentage of free blocks */
__fs32 fs_rotdelay; /* num of ms for optimal next block */
__fs32 fs_rps; /* disk revolutions per second */ /* these fields can be computed from the others */
__fs32 fs_bmask; /* ``blkoff'' calc of blk offsets */
__fs32 fs_fmask; /* ``fragoff'' calc of frag offsets */
__fs32 fs_bshift; /* ``lblkno'' calc of logical blkno */
__fs32 fs_fshift; /* ``numfrags'' calc number of frags */ /* these are configuration parameters */
__fs32 fs_maxcontig; /* max number of contiguous blks */
__fs32 fs_maxbpg; /* max number of blks per cyl group */ /* these fields can be computed from the others */
__fs32 fs_fragshift; /* block to frag shift */
__fs32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
__fs32 fs_sbsize; /* actual size of super block */
__fs32 fs_csmask; /* csum block offset */
__fs32 fs_csshift; /* csum block number */
__fs32 fs_nindir; /* value of NINDIR */
__fs32 fs_inopb; /* value of INOPB */
__fs32 fs_nspf; /* value of NSPF */ /* yet another configuration parameter */
__fs32 fs_optim; /* optimization preference, see below */ /* these fields are derived from the hardware */ union { struct {
__fs32 fs_npsect; /* # sectors/track including spares */
} fs_sun; struct {
__fs32 fs_state; /* file system state time stamp */
} fs_sunx86;
} fs_u1;
__fs32 fs_interleave; /* hardware sector interleave */
__fs32 fs_trackskew; /* sector 0 skew, per track */ /* a unique id for this filesystem (currently unused and unmaintained) */ /* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */ /* Neither of those fields is used in the Tahoe code right now but */ /* there could be problems if they are. */
__fs32 fs_id[2]; /* file system id */ /* sizes determined by number of cylinder groups and their sizes */
__fs32 fs_csaddr; /* blk addr of cyl grp summary area */
__fs32 fs_cssize; /* size of cyl grp summary area */
__fs32 fs_cgsize; /* cylinder group size */ /* these fields are derived from the hardware */
__fs32 fs_ntrak; /* tracks per cylinder */
__fs32 fs_nsect; /* sectors per track */
__fs32 fs_spc; /* sectors per cylinder */ /* this comes from the disk driver partitioning */
__fs32 fs_ncyl; /* cylinders in file system */ /* these fields can be computed from the others */
__fs32 fs_cpg; /* cylinders per group */
__fs32 fs_ipg; /* inodes per cylinder group */
__fs32 fs_fpg; /* blocks per group * fs_frag */ /* this data must be re-computed after crashes */ struct ufs_csum fs_cstotal; /* cylinder summary information */ /* these fields are cleared at mount time */
__s8 fs_fmod; /* super block modified flag */
__s8 fs_clean; /* file system is clean flag */
__s8 fs_ronly; /* mounted read-only flag */
__s8 fs_flags; union { struct {
__s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */
__fs32 fs_cgrotor; /* last cg searched */
__fs32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */
__fs32 fs_maxcluster;
__fs32 fs_cpc; /* cyl per cycle in postbl */
__fs16 fs_opostbl[16][8]; /* old rotation block list head */
} fs_u1; struct {
__s8 fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */
__u8 fs_volname[UFS2_MAXVOLLEN]; /* volume name */
__fs64 fs_swuid; /* system-wide uid */
__fs32 fs_pad; /* due to alignment of fs_swuid */
__fs32 fs_cgrotor; /* last cg searched */
__fs32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */
__fs32 fs_contigdirs;/*# of contiguously allocated dirs */
__fs32 fs_csp; /* cg summary info buffer for fs_cs */
__fs32 fs_maxcluster;
__fs32 fs_active;/* used by snapshots to track fs */
__fs32 fs_old_cpc; /* cyl per cycle in postbl */
__fs32 fs_maxbsize;/*maximum blocking factor permitted */
__fs64 fs_sparecon64[17];/*old rotation block list head */
__fs64 fs_sblockloc; /* byte offset of standard superblock */ struct ufs2_csum_total fs_cstotal;/*cylinder summary information*/ struct ufs_timeval fs_time; /* last time written */
__fs64 fs_size; /* number of blocks in fs */
__fs64 fs_dsize; /* number of data blocks in fs */
__fs64 fs_csaddr; /* blk addr of cyl grp summary area */
__fs64 fs_pendingblocks;/* blocks in process of being freed */
__fs32 fs_pendinginodes;/*inodes in process of being freed */
} fs_u2;
} fs_u11; union { struct {
__fs32 fs_sparecon[53];/* reserved for future constants */
__fs32 fs_reclaim;
__fs32 fs_sparecon2[1];
__fs32 fs_state; /* file system state time stamp */
__fs32 fs_qbmask[2]; /* ~usb_bmask */
__fs32 fs_qfmask[2]; /* ~usb_fmask */
} fs_sun; struct {
__fs32 fs_sparecon[53];/* reserved for future constants */
__fs32 fs_reclaim;
__fs32 fs_sparecon2[1];
__fs32 fs_npsect; /* # sectors/track including spares */
__fs32 fs_qbmask[2]; /* ~usb_bmask */
__fs32 fs_qfmask[2]; /* ~usb_fmask */
} fs_sunx86; struct {
__fs32 fs_sparecon[50];/* reserved for future constants */
__fs32 fs_contigsumsize;/* size of cluster summary array */
__fs32 fs_maxsymlinklen;/* max length of an internal symlink */
__fs32 fs_inodefmt; /* format of on-disk inodes */
__fs32 fs_maxfilesize[2]; /* max representable file size */
__fs32 fs_qbmask[2]; /* ~usb_bmask */
__fs32 fs_qfmask[2]; /* ~usb_fmask */
__fs32 fs_state; /* file system state time stamp */
} fs_44;
} fs_u2;
__fs32 fs_postblformat; /* format of positional layout tables */
__fs32 fs_nrpos; /* number of rotational positions */
__fs32 fs_postbloff; /* (__s16) rotation block list head */
__fs32 fs_rotbloff; /* (__u8) blocks for each rotation */
__fs32 fs_magic; /* magic number */
__u8 fs_space[1]; /* list of blocks for each rotation */
}; #endif/*struct ufs_super_block*/
/* *Preferenceforoptimization.
*/ #define UFS_OPTTIME 0/* minimize allocation time */ #define UFS_OPTSPACE 1/* minimize disk fragmentation */
/* *Rotationallayouttableformattypes
*/ #define UFS_42POSTBLFMT -1/* 4.2BSD rotational table format */ #define UFS_DYNAMICPOSTBLFMT 1/* dynamic rotational table format */
/* *sizeofthisstructureis172B
*/ struct ufs_cylinder_group {
__fs32 cg_link; /* linked list of cyl groups */
__fs32 cg_magic; /* magic number */
__fs32 cg_time; /* time last written */
__fs32 cg_cgx; /* we are the cgx'th cylinder group */
__fs16 cg_ncyl; /* number of cyl's this cg */
__fs16 cg_niblk; /* number of inode blocks this cg */
__fs32 cg_ndblk; /* number of data blocks this cg */ struct ufs_csum cg_cs; /* cylinder summary information */
__fs32 cg_rotor; /* position of last used block */
__fs32 cg_frotor; /* position of last used frag */
__fs32 cg_irotor; /* position of last used inode */
__fs32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */
__fs32 cg_btotoff; /* (__u32) block totals per cylinder */
__fs32 cg_boff; /* (short) free block positions */
__fs32 cg_iusedoff; /* (char) used inode map */
__fs32 cg_freeoff; /* (u_char) free block map */
__fs32 cg_nextfreeoff; /* (u_char) next available space */ union { struct {
__fs32 cg_clustersumoff; /* (u_int32) counts of avail clusters */
__fs32 cg_clusteroff; /* (u_int8) free cluster map */
__fs32 cg_nclusterblks; /* number of clusters this cg */
__fs32 cg_sparecon[13]; /* reserved for future use */
} cg_44; struct {
__fs32 cg_clustersumoff;/* (u_int32) counts of avail clusters */
__fs32 cg_clusteroff; /* (u_int8) free cluster map */
__fs32 cg_nclusterblks;/* number of clusters this cg */
__fs32 cg_niblk; /* number of inode blocks this cg */
__fs32 cg_initediblk; /* last initialized inode */
__fs32 cg_sparecon32[3];/* reserved for future use */
__fs64 cg_time; /* time last written */
__fs64 cg_sparecon[3]; /* reserved for future use */
} cg_u2;
__fs32 cg_sparecon[16]; /* reserved for future use */
} cg_u;
__u8 cg_space[1]; /* space for cylinder group maps */ /* actually longer */
};
/* Historic Cylinder group info */ struct ufs_old_cylinder_group {
__fs32 cg_link; /* linked list of cyl groups */
__fs32 cg_rlink; /* for incore cyl groups */
__fs32 cg_time; /* time last written */
__fs32 cg_cgx; /* we are the cgx'th cylinder group */
__fs16 cg_ncyl; /* number of cyl's this cg */
__fs16 cg_niblk; /* number of inode blocks this cg */
__fs32 cg_ndblk; /* number of data blocks this cg */ struct ufs_csum cg_cs; /* cylinder summary information */
__fs32 cg_rotor; /* position of last used block */
__fs32 cg_frotor; /* position of last used frag */
__fs32 cg_irotor; /* position of last used inode */
__fs32 cg_frsum[8]; /* counts of available frags */
__fs32 cg_btot[32]; /* block totals per cylinder */
__fs16 cg_b[32][8]; /* positions of free blocks */
__u8 cg_iused[256]; /* used inode map */
__fs32 cg_magic; /* magic number */
__u8 cg_free[1]; /* free block map */ /* actually longer */
};
/* FreeBSD has these in sys/stat.h */ /* ui_flags that can be set by a file owner */ #define UFS_UF_SETTABLE 0x0000ffff #define UFS_UF_NODUMP 0x00000001 /* do not dump */ #define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */ #define UFS_UF_APPEND 0x00000004 /* append-only */ #define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */ #define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */ /* ui_flags that only root can set */ #define UFS_SF_SETTABLE 0xffff0000 #define UFS_SF_ARCHIVED 0x00010000 /* archived */ #define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */ #define UFS_SF_APPEND 0x00040000 /* append-only */ #define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */
/* *Thisstructureisusedforreadingdiskstructureslarger *thanthesizeoffragment.
*/ struct ufs_buffer_head {
__u64 fragment; /* first fragment */
__u64 count; /* number of fragments */ struct buffer_head * bh[UFS_MAXFRAG]; /* buffers */
};
struct ufs_cg_private_info { struct ufs_buffer_head c_ubh;
__u32 c_cgx; /* number of cylidner group */
__u16 c_ncyl; /* number of cyl's this cg */
__u16 c_niblk; /* number of inode blocks this cg */
__u32 c_ndblk; /* number of data blocks this cg */
__u32 c_rotor; /* position of last used block */
__u32 c_frotor; /* position of last used frag */
__u32 c_irotor; /* position of last used inode */
__u32 c_btotoff; /* (__u32) block totals per cylinder */
__u32 c_boff; /* (short) free block positions */
__u32 c_iusedoff; /* (char) used inode map */
__u32 c_freeoff; /* (u_char) free block map */
__u32 c_nextfreeoff; /* (u_char) next available space */
__u32 c_clustersumoff;/* (u_int32) counts of avail clusters */
__u32 c_clusteroff; /* (u_int8) free cluster map */
__u32 c_nclusterblks; /* number of clusters this cg */
};
struct ufs_sb_private_info { struct ufs_buffer_head s_ubh; /* buffer containing super block */ struct ufs_csum_core cs_total;
__u32 s_sblkno; /* offset of super-blocks in filesys */
__u32 s_cblkno; /* offset of cg-block in filesys */
__u32 s_iblkno; /* offset of inode-blocks in filesys */
__u32 s_dblkno; /* offset of first data after cg */
__u32 s_cgoffset; /* cylinder group offset in cylinder */
__u32 s_cgmask; /* used to calc mod fs_ntrak */
__u64 s_size; /* number of blocks (fragments) in fs */
__u64 s_dsize; /* number of data blocks in fs */
__u32 s_ncg; /* number of cylinder groups */
__u32 s_bsize; /* size of basic blocks */
__u32 s_fsize; /* size of fragments */
__u32 s_fpb; /* fragments per block */
__u32 s_minfree; /* minimum percentage of free blocks */
__u32 s_bmask; /* `blkoff'' calc of blk offsets */
__u32 s_fmask; /* s_fsize mask */
__u32 s_bshift; /* `lblkno'' calc of logical blkno */
__u32 s_fshift; /* s_fsize shift */
__u32 s_fpbshift; /* fragments per block shift */
__u32 s_fsbtodb; /* fsbtodb and dbtofsb shift constant */
__u32 s_sbsize; /* actual size of super block */
__u32 s_csmask; /* csum block offset */
__u32 s_csshift; /* csum block number */
__u32 s_nindir; /* value of NINDIR */
__u32 s_inopb; /* value of INOPB */
__u32 s_nspf; /* value of NSPF */
__u32 s_npsect; /* # sectors/track including spares */
__u32 s_interleave; /* hardware sector interleave */
__u32 s_trackskew; /* sector 0 skew, per track */
__u64 s_csaddr; /* blk addr of cyl grp summary area */
__u32 s_cssize; /* size of cyl grp summary area */
__u32 s_cgsize; /* cylinder group size */
__u32 s_ntrak; /* tracks per cylinder */
__u32 s_nsect; /* sectors per track */
__u32 s_spc; /* sectors per cylinder */
__u32 s_ipg; /* inodes per cylinder group */
__u32 s_fpg; /* fragments per group */
__u32 s_cpc; /* cyl per cycle in postbl */
__s32 s_contigsumsize;/* size of cluster summary array, 44bsd */
__s64 s_qbmask; /* ~usb_bmask */
__s64 s_qfmask; /* ~usb_fmask */
__s32 s_postblformat; /* format of positional layout tables */
__s32 s_nrpos; /* number of rotational positions */
__s32 s_postbloff; /* (__s16) rotation block list head */
__s32 s_rotbloff; /* (__u8) blocks for each rotation */
__u32 s_fpbmask; /* fragments per block mask */
__u32 s_apb; /* address per block */
__u32 s_apbmask; /* address per block mask */
__u32 s_apbshift; /* address per block shift */
__u32 s_nspfshift; /* number of sector per fragment shift */
__u32 s_nspb; /* number of sector per block */
__u32 s_inopf; /* inodes per fragment */
__u32 s_sbbase; /* offset of NeXTstep superblock */
__u32 s_bpf; /* bits per fragment */
__u32 s_bpfshift; /* bits per fragment shift*/
__u32 s_bpfmask; /* bits per fragment mask */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.