minix_fs.h 2.1 KB

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