minix_fs.h 2.0 KB

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