fs/ufs/ufs_fs.h
Source file repositories/reference/linux-study-clean/fs/ufs/ufs_fs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ufs/ufs_fs.h- Extension
.h- Size
- 35291 bytes
- Lines
- 959
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/kernel.hlinux/stat.hlinux/fs.hlinux/workqueue.hasm/div64.h
Detected Declarations
struct ufs_timevalstruct ufs_dir_entrystruct ufs_csumstruct ufs2_csum_totalstruct ufs_csum_corestruct ufs_super_blockstruct ufs_cylinder_groupstruct ufs_old_cylinder_groupstruct ufs_inodestruct ufs2_inodestruct ufs_buffer_headstruct ufs_cg_private_infostruct ufs_sb_private_infostruct ufs_super_block_firststruct ufs_super_block_secondstruct ufs_super_block_third
Annotated Snippet
struct ufs_timeval {
__fs32 tv_sec;
__fs32 tv_usec;
};
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 */
};
/*
* File system flags
*/
#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 */
#if 0
/*
* This is the actual superblock, as it is laid out on the disk.
* Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and
* it may occupy several blocks, use
* struct ufs_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 */
Annotation
- Immediate include surface: `linux/types.h`, `linux/kernel.h`, `linux/stat.h`, `linux/fs.h`, `linux/workqueue.h`, `asm/div64.h`.
- Detected declarations: `struct ufs_timeval`, `struct ufs_dir_entry`, `struct ufs_csum`, `struct ufs2_csum_total`, `struct ufs_csum_core`, `struct ufs_super_block`, `struct ufs_cylinder_group`, `struct ufs_old_cylinder_group`, `struct ufs_inode`, `struct ufs2_inode`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.