efs_fs_sb.h 2.1 KB

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