minix_fs.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef _LINUX_MINIX_FS_H
  2. #define _LINUX_MINIX_FS_H
  3. /*
  4. * The minix filesystem constants/structures
  5. */
  6. /*
  7. * Thanks to Kees J Bot for sending me the definitions of the new
  8. * minix filesystem (aka V2) with bigger inodes and 32-bit block
  9. * pointers.
  10. */
  11. #define MINIX_ROOT_INO 1
  12. /* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
  13. #define MINIX_LINK_MAX 250
  14. #define MINIX2_LINK_MAX 65530
  15. #define MINIX_I_MAP_SLOTS 8
  16. #define MINIX_Z_MAP_SLOTS 64
  17. #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
  18. #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
  19. #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
  20. #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
  21. #define MINIX_VALID_FS 0x0001 /* Clean fs. */
  22. #define MINIX_ERROR_FS 0x0002 /* fs has errors. */
  23. #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
  24. #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
  25. /*
  26. * This is the original minix inode layout on disk.
  27. * Note the 8-bit gid and atime and ctime.
  28. */
  29. struct minix_inode {
  30. __u16 i_mode;
  31. __u16 i_uid;
  32. __u32 i_size;
  33. __u32 i_time;
  34. __u8 i_gid;
  35. __u8 i_nlinks;
  36. __u16 i_zone[9];
  37. };
  38. /*
  39. * The new minix inode has all the time entries, as well as
  40. * long block numbers and a third indirect block (7+1+1+1
  41. * instead of 7+1+1). Also, some previously 8-bit values are
  42. * now 16-bit. The inode is now 64 bytes instead of 32.
  43. */
  44. struct minix2_inode {
  45. __u16 i_mode;
  46. __u16 i_nlinks;
  47. __u16 i_uid;
  48. __u16 i_gid;
  49. __u32 i_size;
  50. __u32 i_atime;
  51. __u32 i_mtime;
  52. __u32 i_ctime;
  53. __u32 i_zone[10];
  54. };
  55. /*
  56. * minix super-block data on disk
  57. */
  58. struct minix_super_block {
  59. __u16 s_ninodes;
  60. __u16 s_nzones;
  61. __u16 s_imap_blocks;
  62. __u16 s_zmap_blocks;
  63. __u16 s_firstdatazone;
  64. __u16 s_log_zone_size;
  65. __u32 s_max_size;
  66. __u16 s_magic;
  67. __u16 s_state;
  68. __u32 s_zones;
  69. };
  70. struct minix_dir_entry {
  71. __u16 inode;
  72. char name[0];
  73. };
  74. #endif