amigaffs.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef AMIGAFFS_H
  3. #define AMIGAFFS_H
  4. #include <linux/types.h>
  5. #include <asm/byteorder.h>
  6. #define FS_OFS 0x444F5300
  7. #define FS_FFS 0x444F5301
  8. #define FS_INTLOFS 0x444F5302
  9. #define FS_INTLFFS 0x444F5303
  10. #define FS_DCOFS 0x444F5304
  11. #define FS_DCFFS 0x444F5305
  12. #define MUFS_FS 0x6d754653 /* 'muFS' */
  13. #define MUFS_OFS 0x6d754600 /* 'muF\0' */
  14. #define MUFS_FFS 0x6d754601 /* 'muF\1' */
  15. #define MUFS_INTLOFS 0x6d754602 /* 'muF\2' */
  16. #define MUFS_INTLFFS 0x6d754603 /* 'muF\3' */
  17. #define MUFS_DCOFS 0x6d754604 /* 'muF\4' */
  18. #define MUFS_DCFFS 0x6d754605 /* 'muF\5' */
  19. #define T_SHORT 2
  20. #define T_LIST 16
  21. #define T_DATA 8
  22. #define ST_LINKFILE -4
  23. #define ST_FILE -3
  24. #define ST_ROOT 1
  25. #define ST_USERDIR 2
  26. #define ST_SOFTLINK 3
  27. #define ST_LINKDIR 4
  28. #define AFFS_ROOT_BMAPS 25
  29. struct affs_date {
  30. __be32 days;
  31. __be32 mins;
  32. __be32 ticks;
  33. };
  34. struct affs_short_date {
  35. __be16 days;
  36. __be16 mins;
  37. __be16 ticks;
  38. };
  39. struct affs_root_head {
  40. __be32 ptype;
  41. __be32 spare1;
  42. __be32 spare2;
  43. __be32 hash_size;
  44. __be32 spare3;
  45. __be32 checksum;
  46. __be32 hashtable[1];
  47. };
  48. struct affs_root_tail {
  49. __be32 bm_flag;
  50. __be32 bm_blk[AFFS_ROOT_BMAPS];
  51. __be32 bm_ext;
  52. struct affs_date root_change;
  53. u8 disk_name[32];
  54. __be32 spare1;
  55. __be32 spare2;
  56. struct affs_date disk_change;
  57. struct affs_date disk_create;
  58. __be32 spare3;
  59. __be32 spare4;
  60. __be32 dcache;
  61. __be32 stype;
  62. };
  63. struct affs_head {
  64. __be32 ptype;
  65. __be32 key;
  66. __be32 block_count;
  67. __be32 spare1;
  68. __be32 first_data;
  69. __be32 checksum;
  70. __be32 table[1];
  71. };
  72. struct affs_tail {
  73. __be32 spare1;
  74. __be16 uid;
  75. __be16 gid;
  76. __be32 protect;
  77. __be32 size;
  78. u8 comment[92];
  79. struct affs_date change;
  80. u8 name[32];
  81. __be32 spare2;
  82. __be32 original;
  83. __be32 link_chain;
  84. __be32 spare[5];
  85. __be32 hash_chain;
  86. __be32 parent;
  87. __be32 extension;
  88. __be32 stype;
  89. };
  90. struct slink_front
  91. {
  92. __be32 ptype;
  93. __be32 key;
  94. __be32 spare1[3];
  95. __be32 checksum;
  96. u8 symname[1]; /* depends on block size */
  97. };
  98. struct affs_data_head
  99. {
  100. __be32 ptype;
  101. __be32 key;
  102. __be32 sequence;
  103. __be32 size;
  104. __be32 next;
  105. __be32 checksum;
  106. u8 data[1]; /* depends on block size */
  107. };
  108. /* Permission bits */
  109. #define FIBF_OTR_READ 0x8000
  110. #define FIBF_OTR_WRITE 0x4000
  111. #define FIBF_OTR_EXECUTE 0x2000
  112. #define FIBF_OTR_DELETE 0x1000
  113. #define FIBF_GRP_READ 0x0800
  114. #define FIBF_GRP_WRITE 0x0400
  115. #define FIBF_GRP_EXECUTE 0x0200
  116. #define FIBF_GRP_DELETE 0x0100
  117. #define FIBF_HIDDEN 0x0080
  118. #define FIBF_SCRIPT 0x0040
  119. #define FIBF_PURE 0x0020 /* no use under linux */
  120. #define FIBF_ARCHIVED 0x0010 /* never set, always cleared on write */
  121. #define FIBF_NOREAD 0x0008 /* 0 means allowed */
  122. #define FIBF_NOWRITE 0x0004 /* 0 means allowed */
  123. #define FIBF_NOEXECUTE 0x0002 /* 0 means allowed, ignored under linux */
  124. #define FIBF_NODELETE 0x0001 /* 0 means allowed */
  125. #define FIBF_OWNER 0x000F /* Bits pertaining to owner */
  126. #define FIBF_MASK 0xEE0E /* Bits modified by Linux */
  127. #endif