1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells /* 3607ca46eSDavid Howells * efs_fs_sb.h 4607ca46eSDavid Howells * 5607ca46eSDavid Howells * Copyright (c) 1999 Al Smith 6607ca46eSDavid Howells * 7607ca46eSDavid Howells * Portions derived from IRIX header files (c) 1988 Silicon Graphics 8607ca46eSDavid Howells */ 9607ca46eSDavid Howells 10607ca46eSDavid Howells #ifndef __EFS_FS_SB_H__ 11607ca46eSDavid Howells #define __EFS_FS_SB_H__ 12607ca46eSDavid Howells 13607ca46eSDavid Howells #include <linux/types.h> 14607ca46eSDavid Howells #include <linux/magic.h> 15607ca46eSDavid Howells 16607ca46eSDavid Howells /* EFS superblock magic numbers */ 17607ca46eSDavid Howells #define EFS_MAGIC 0x072959 18607ca46eSDavid Howells #define EFS_NEWMAGIC 0x07295a 19607ca46eSDavid Howells 20607ca46eSDavid Howells #define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC)) 21607ca46eSDavid Howells 22607ca46eSDavid Howells #define EFS_SUPER 1 23607ca46eSDavid Howells #define EFS_ROOTINODE 2 24607ca46eSDavid Howells 25607ca46eSDavid Howells /* efs superblock on disk */ 26607ca46eSDavid Howells struct efs_super { 27607ca46eSDavid Howells __be32 fs_size; /* size of filesystem, in sectors */ 28607ca46eSDavid Howells __be32 fs_firstcg; /* bb offset to first cg */ 29607ca46eSDavid Howells __be32 fs_cgfsize; /* size of cylinder group in bb's */ 30607ca46eSDavid Howells __be16 fs_cgisize; /* bb's of inodes per cylinder group */ 31607ca46eSDavid Howells __be16 fs_sectors; /* sectors per track */ 32607ca46eSDavid Howells __be16 fs_heads; /* heads per cylinder */ 33607ca46eSDavid Howells __be16 fs_ncg; /* # of cylinder groups in filesystem */ 34607ca46eSDavid Howells __be16 fs_dirty; /* fs needs to be fsck'd */ 35607ca46eSDavid Howells __be32 fs_time; /* last super-block update */ 36607ca46eSDavid Howells __be32 fs_magic; /* magic number */ 37607ca46eSDavid Howells char fs_fname[6]; /* file system name */ 38607ca46eSDavid Howells char fs_fpack[6]; /* file system pack name */ 39607ca46eSDavid Howells __be32 fs_bmsize; /* size of bitmap in bytes */ 40607ca46eSDavid Howells __be32 fs_tfree; /* total free data blocks */ 41607ca46eSDavid Howells __be32 fs_tinode; /* total free inodes */ 42607ca46eSDavid Howells __be32 fs_bmblock; /* bitmap location. */ 43607ca46eSDavid Howells __be32 fs_replsb; /* Location of replicated superblock. */ 44607ca46eSDavid Howells __be32 fs_lastialloc; /* last allocated inode */ 45607ca46eSDavid Howells char fs_spare[20]; /* space for expansion - MUST BE ZERO */ 46607ca46eSDavid Howells __be32 fs_checksum; /* checksum of volume portion of fs */ 47607ca46eSDavid Howells }; 48607ca46eSDavid Howells 49607ca46eSDavid Howells /* efs superblock information in memory */ 50607ca46eSDavid Howells struct efs_sb_info { 51607ca46eSDavid Howells __u32 fs_magic; /* superblock magic number */ 52607ca46eSDavid Howells __u32 fs_start; /* first block of filesystem */ 53607ca46eSDavid Howells __u32 first_block; /* first data block in filesystem */ 54607ca46eSDavid Howells __u32 total_blocks; /* total number of blocks in filesystem */ 55607ca46eSDavid Howells __u32 group_size; /* # of blocks a group consists of */ 56607ca46eSDavid Howells __u32 data_free; /* # of free data blocks */ 57607ca46eSDavid Howells __u32 inode_free; /* # of free inodes */ 58607ca46eSDavid Howells __u16 inode_blocks; /* # of blocks used for inodes in every grp */ 59607ca46eSDavid Howells __u16 total_groups; /* # of groups */ 60607ca46eSDavid Howells }; 61607ca46eSDavid Howells 62607ca46eSDavid Howells #endif /* __EFS_FS_SB_H__ */ 63607ca46eSDavid Howells 64