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