amigaffs.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. /* Seconds since Amiga epoch of 1978/01/01 to UNIX */
  30. #define AFFS_EPOCH_DELTA ((8 * 365 + 2) * 86400LL)
  31. struct affs_date {
  32. __be32 days;
  33. __be32 mins;
  34. __be32 ticks;
  35. };
  36. struct affs_short_date {
  37. __be16 days;
  38. __be16 mins;
  39. __be16 ticks;
  40. };
  41. struct affs_root_head {
  42. __be32 ptype;
  43. /* The following fields are not used, but kept as documentation. */
  44. __be32 spare1;
  45. __be32 spare2;
  46. __be32 hash_size;
  47. __be32 spare3;
  48. __be32 checksum;
  49. __be32 hashtable[];
  50. };
  51. struct affs_root_tail {
  52. __be32 bm_flag;
  53. __be32 bm_blk[AFFS_ROOT_BMAPS];
  54. __be32 bm_ext;
  55. struct affs_date root_change;
  56. u8 disk_name[32];
  57. __be32 spare1;
  58. __be32 spare2;
  59. struct affs_date disk_change;
  60. struct affs_date disk_create;
  61. __be32 spare3;
  62. __be32 spare4;
  63. __be32 dcache;
  64. __be32 stype;
  65. };
  66. struct affs_head {
  67. __be32 ptype;
  68. __be32 key;
  69. __be32 block_count;
  70. __be32 spare1;
  71. __be32 first_data;
  72. __be32 checksum;
  73. __be32 table[];
  74. };
  75. struct affs_tail {
  76. __be32 spare1;
  77. __be16 uid;
  78. __be16 gid;
  79. __be32 protect;
  80. __be32 size;
  81. u8 comment[92];
  82. struct affs_date change;
  83. u8 name[32];
  84. __be32 spare2;
  85. __be32 original;
  86. __be32 link_chain;
  87. __be32 spare[5];
  88. __be32 hash_chain;
  89. __be32 parent;
  90. __be32 extension;
  91. __be32 stype;
  92. };
  93. struct slink_front
  94. {
  95. __be32 ptype;
  96. __be32 key;
  97. __be32 spare1[3];
  98. __be32 checksum;
  99. u8 symname[]; /* depends on block size */
  100. };
  101. struct affs_data_head
  102. {
  103. __be32 ptype;
  104. __be32 key;
  105. __be32 sequence;
  106. __be32 size;
  107. __be32 next;
  108. __be32 checksum;
  109. u8 data[]; /* depends on block size */
  110. };
  111. /* Permission bits */
  112. #define FIBF_OTR_READ 0x8000
  113. #define FIBF_OTR_WRITE 0x4000
  114. #define FIBF_OTR_EXECUTE 0x2000
  115. #define FIBF_OTR_DELETE 0x1000
  116. #define FIBF_GRP_READ 0x0800
  117. #define FIBF_GRP_WRITE 0x0400
  118. #define FIBF_GRP_EXECUTE 0x0200
  119. #define FIBF_GRP_DELETE 0x0100
  120. #define FIBF_HIDDEN 0x0080
  121. #define FIBF_SCRIPT 0x0040
  122. #define FIBF_PURE 0x0020 /* no use under linux */
  123. #define FIBF_ARCHIVED 0x0010 /* never set, always cleared on write */
  124. #define FIBF_NOREAD 0x0008 /* 0 means allowed */
  125. #define FIBF_NOWRITE 0x0004 /* 0 means allowed */
  126. #define FIBF_NOEXECUTE 0x0002 /* 0 means allowed, ignored under linux */
  127. #define FIBF_NODELETE 0x0001 /* 0 means allowed */
  128. #define FIBF_OWNER 0x000F /* Bits pertaining to owner */
  129. #define FIBF_MASK 0xEE0E /* Bits modified by Linux */
  130. #endif