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.

Dependency Surface

Detected Declarations

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

Implementation Notes