xref: /linux-6.15/include/uapi/linux/efs_fs_sb.h (revision 607ca46e)
1*607ca46eSDavid Howells /*
2*607ca46eSDavid Howells  * efs_fs_sb.h
3*607ca46eSDavid Howells  *
4*607ca46eSDavid Howells  * Copyright (c) 1999 Al Smith
5*607ca46eSDavid Howells  *
6*607ca46eSDavid Howells  * Portions derived from IRIX header files (c) 1988 Silicon Graphics
7*607ca46eSDavid Howells  */
8*607ca46eSDavid Howells 
9*607ca46eSDavid Howells #ifndef __EFS_FS_SB_H__
10*607ca46eSDavid Howells #define __EFS_FS_SB_H__
11*607ca46eSDavid Howells 
12*607ca46eSDavid Howells #include <linux/types.h>
13*607ca46eSDavid Howells #include <linux/magic.h>
14*607ca46eSDavid Howells 
15*607ca46eSDavid Howells /* EFS superblock magic numbers */
16*607ca46eSDavid Howells #define EFS_MAGIC	0x072959
17*607ca46eSDavid Howells #define EFS_NEWMAGIC	0x07295a
18*607ca46eSDavid Howells 
19*607ca46eSDavid Howells #define IS_EFS_MAGIC(x)	((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
20*607ca46eSDavid Howells 
21*607ca46eSDavid Howells #define EFS_SUPER		1
22*607ca46eSDavid Howells #define EFS_ROOTINODE		2
23*607ca46eSDavid Howells 
24*607ca46eSDavid Howells /* efs superblock on disk */
25*607ca46eSDavid Howells struct efs_super {
26*607ca46eSDavid Howells 	__be32		fs_size;        /* size of filesystem, in sectors */
27*607ca46eSDavid Howells 	__be32		fs_firstcg;     /* bb offset to first cg */
28*607ca46eSDavid Howells 	__be32		fs_cgfsize;     /* size of cylinder group in bb's */
29*607ca46eSDavid Howells 	__be16		fs_cgisize;     /* bb's of inodes per cylinder group */
30*607ca46eSDavid Howells 	__be16		fs_sectors;     /* sectors per track */
31*607ca46eSDavid Howells 	__be16		fs_heads;       /* heads per cylinder */
32*607ca46eSDavid Howells 	__be16		fs_ncg;         /* # of cylinder groups in filesystem */
33*607ca46eSDavid Howells 	__be16		fs_dirty;       /* fs needs to be fsck'd */
34*607ca46eSDavid Howells 	__be32		fs_time;        /* last super-block update */
35*607ca46eSDavid Howells 	__be32		fs_magic;       /* magic number */
36*607ca46eSDavid Howells 	char		fs_fname[6];    /* file system name */
37*607ca46eSDavid Howells 	char		fs_fpack[6];    /* file system pack name */
38*607ca46eSDavid Howells 	__be32		fs_bmsize;      /* size of bitmap in bytes */
39*607ca46eSDavid Howells 	__be32		fs_tfree;       /* total free data blocks */
40*607ca46eSDavid Howells 	__be32		fs_tinode;      /* total free inodes */
41*607ca46eSDavid Howells 	__be32		fs_bmblock;     /* bitmap location. */
42*607ca46eSDavid Howells 	__be32		fs_replsb;      /* Location of replicated superblock. */
43*607ca46eSDavid Howells 	__be32		fs_lastialloc;  /* last allocated inode */
44*607ca46eSDavid Howells 	char		fs_spare[20];   /* space for expansion - MUST BE ZERO */
45*607ca46eSDavid Howells 	__be32		fs_checksum;    /* checksum of volume portion of fs */
46*607ca46eSDavid Howells };
47*607ca46eSDavid Howells 
48*607ca46eSDavid Howells /* efs superblock information in memory */
49*607ca46eSDavid Howells struct efs_sb_info {
50*607ca46eSDavid Howells 	__u32	fs_magic;	/* superblock magic number */
51*607ca46eSDavid Howells 	__u32	fs_start;	/* first block of filesystem */
52*607ca46eSDavid Howells 	__u32	first_block;	/* first data block in filesystem */
53*607ca46eSDavid Howells 	__u32	total_blocks;	/* total number of blocks in filesystem */
54*607ca46eSDavid Howells 	__u32	group_size;	/* # of blocks a group consists of */
55*607ca46eSDavid Howells 	__u32	data_free;	/* # of free data blocks */
56*607ca46eSDavid Howells 	__u32	inode_free;	/* # of free inodes */
57*607ca46eSDavid Howells 	__u16	inode_blocks;	/* # of blocks used for inodes in every grp */
58*607ca46eSDavid Howells 	__u16	total_groups;	/* # of groups */
59*607ca46eSDavid Howells };
60*607ca46eSDavid Howells 
61*607ca46eSDavid Howells #endif /* __EFS_FS_SB_H__ */
62*607ca46eSDavid Howells 
63