📄 ufs_fs.h
字号:
} ui_u3;};#define UFS_NXADDR 2 /* External addresses in inode. */struct ufs2_inode { __fs16 ui_mode; /* 0: IFMT, permissions; see below. */ __fs16 ui_nlink; /* 2: File link count. */ __fs32 ui_uid; /* 4: File owner. */ __fs32 ui_gid; /* 8: File group. */ __fs32 ui_blksize; /* 12: Inode blocksize. */ __fs64 ui_size; /* 16: File byte count. */ __fs64 ui_blocks; /* 24: Bytes actually held. */ __fs64 ui_atime; /* 32: Last access time. */ __fs64 ui_mtime; /* 40: Last modified time. */ __fs64 ui_ctime; /* 48: Last inode change time. */ __fs64 ui_birthtime; /* 56: Inode creation time. */ __fs32 ui_mtimensec; /* 64: Last modified time. */ __fs32 ui_atimensec; /* 68: Last access time. */ __fs32 ui_ctimensec; /* 72: Last inode change time. */ __fs32 ui_birthnsec; /* 76: Inode creation time. */ __fs32 ui_gen; /* 80: Generation number. */ __fs32 ui_kernflags; /* 84: Kernel flags. */ __fs32 ui_flags; /* 88: Status flags (chflags). */ __fs32 ui_extsize; /* 92: External attributes block. */ __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */ union { struct { __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/ } ui_addr; __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ } ui_u2; __fs64 ui_spare[3]; /* 232: Reserved; currently unused */};/* 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 *//* * This structure is used for reading disk structures larger * than the size of fragment. */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 */ __u32 s_size; /* number of blocks (fragments) in fs */ __u32 s_dsize; /* number of data blocks in fs */ __u64 s_u2_size; /* ufs2: number of blocks (fragments) in fs */ __u64 s_u2_dsize; /*ufs2: 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_2apb; /* address per block^2 */ __u32 s_3apb; /* address per block^3 */ __u32 s_apbmask; /* address per block mask */ __u32 s_apbshift; /* address per block shift */ __u32 s_2apbshift; /* address per block shift * 2 */ __u32 s_3apbshift; /* address per block shift * 3 */ __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 */ __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ __s32 fs_magic; /* filesystem magic */ unsigned int s_dirblksize;};/* * Sizes of this structures are: * ufs_super_block_first 512 * ufs_super_block_second 512 * ufs_super_block_third 356 */struct ufs_super_block_first { union { struct { __fs32 fs_link; /* UNUSED */ } fs_42; struct { __fs32 fs_state; /* file system state flag */ } fs_sun; } fs_u0; __fs32 fs_rlink; __fs32 fs_sblkno; __fs32 fs_cblkno; __fs32 fs_iblkno; __fs32 fs_dblkno; __fs32 fs_cgoffset; __fs32 fs_cgmask; __fs32 fs_time; __fs32 fs_size; __fs32 fs_dsize; __fs32 fs_ncg; __fs32 fs_bsize; __fs32 fs_fsize; __fs32 fs_frag; __fs32 fs_minfree; __fs32 fs_rotdelay; __fs32 fs_rps; __fs32 fs_bmask; __fs32 fs_fmask; __fs32 fs_bshift; __fs32 fs_fshift; __fs32 fs_maxcontig; __fs32 fs_maxbpg; __fs32 fs_fragshift; __fs32 fs_fsbtodb; __fs32 fs_sbsize; __fs32 fs_csmask; __fs32 fs_csshift; __fs32 fs_nindir; __fs32 fs_inopb; __fs32 fs_nspf; __fs32 fs_optim; union { struct { __fs32 fs_npsect; } fs_sun; struct { __fs32 fs_state; } fs_sunx86; } fs_u1; __fs32 fs_interleave; __fs32 fs_trackskew; __fs32 fs_id[2]; __fs32 fs_csaddr; __fs32 fs_cssize; __fs32 fs_cgsize; __fs32 fs_ntrak; __fs32 fs_nsect; __fs32 fs_spc; __fs32 fs_ncyl; __fs32 fs_cpg; __fs32 fs_ipg; __fs32 fs_fpg; struct ufs_csum fs_cstotal; __s8 fs_fmod; __s8 fs_clean; __s8 fs_ronly; __s8 fs_flags; __s8 fs_fsmnt[UFS_MAXMNTLEN - 212];};struct ufs_super_block_second { union { struct { __s8 fs_fsmnt[212]; __fs32 fs_cgrotor; __fs32 fs_csp[UFS_MAXCSBUFS]; __fs32 fs_maxcluster; __fs32 fs_cpc; __fs16 fs_opostbl[82]; } fs_u1; struct { __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212]; __u8 fs_volname[UFS2_MAXVOLLEN]; __fs64 fs_swuid; __fs32 fs_pad; __fs32 fs_cgrotor; __fs32 fs_ocsp[UFS2_NOCSPTRS]; __fs32 fs_contigdirs; __fs32 fs_csp; __fs32 fs_maxcluster; __fs32 fs_active; __fs32 fs_old_cpc; __fs32 fs_maxbsize; __fs64 fs_sparecon64[17]; __fs64 fs_sblockloc; __fs64 cs_ndir; __fs64 cs_nbfree; } fs_u2; } fs_un;};struct ufs_super_block_third { union { struct { __fs16 fs_opostbl[46]; } fs_u1; struct { __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_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 */ } __attribute__ ((packed)) fs_u2; } fs_un1; 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_un2; __fs32 fs_postblformat; __fs32 fs_nrpos; __fs32 fs_postbloff; __fs32 fs_rotbloff; __fs32 fs_magic; __u8 fs_space[1];};#endif /* __LINUX_UFS_FS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -