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