blob: 81fb396d4dfa37fe7f4296e50751eb5ad1b797df [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#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
Deepa Dinamani487b25b2019-03-21 14:05:12 -070035/* Seconds since Amiga epoch of 1978/01/01 to UNIX */
36#define AFFS_EPOCH_DELTA ((8 * 365 + 2) * 86400LL)
37
Linus Torvalds1da177e2005-04-16 15:20:36 -070038struct affs_date {
39 __be32 days;
40 __be32 mins;
41 __be32 ticks;
42};
43
44struct affs_short_date {
45 __be16 days;
46 __be16 mins;
47 __be16 ticks;
48};
49
50struct affs_root_head {
51 __be32 ptype;
52 __be32 spare1;
53 __be32 spare2;
54 __be32 hash_size;
55 __be32 spare3;
56 __be32 checksum;
57 __be32 hashtable[1];
58};
59
60struct affs_root_tail {
61 __be32 bm_flag;
62 __be32 bm_blk[AFFS_ROOT_BMAPS];
63 __be32 bm_ext;
64 struct affs_date root_change;
65 u8 disk_name[32];
66 __be32 spare1;
67 __be32 spare2;
68 struct affs_date disk_change;
69 struct affs_date disk_create;
70 __be32 spare3;
71 __be32 spare4;
72 __be32 dcache;
73 __be32 stype;
74};
75
76struct affs_head {
77 __be32 ptype;
78 __be32 key;
79 __be32 block_count;
80 __be32 spare1;
81 __be32 first_data;
82 __be32 checksum;
83 __be32 table[1];
84};
85
86struct affs_tail {
87 __be32 spare1;
88 __be16 uid;
89 __be16 gid;
90 __be32 protect;
91 __be32 size;
92 u8 comment[92];
93 struct affs_date change;
94 u8 name[32];
95 __be32 spare2;
96 __be32 original;
97 __be32 link_chain;
98 __be32 spare[5];
99 __be32 hash_chain;
100 __be32 parent;
101 __be32 extension;
102 __be32 stype;
103};
104
105struct slink_front
106{
107 __be32 ptype;
108 __be32 key;
109 __be32 spare1[3];
110 __be32 checksum;
111 u8 symname[1]; /* depends on block size */
112};
113
114struct affs_data_head
115{
116 __be32 ptype;
117 __be32 key;
118 __be32 sequence;
119 __be32 size;
120 __be32 next;
121 __be32 checksum;
122 u8 data[1]; /* depends on block size */
123};
124
125/* Permission bits */
126
127#define FIBF_OTR_READ 0x8000
128#define FIBF_OTR_WRITE 0x4000
129#define FIBF_OTR_EXECUTE 0x2000
130#define FIBF_OTR_DELETE 0x1000
131#define FIBF_GRP_READ 0x0800
132#define FIBF_GRP_WRITE 0x0400
133#define FIBF_GRP_EXECUTE 0x0200
134#define FIBF_GRP_DELETE 0x0100
135
136#define FIBF_HIDDEN 0x0080
137#define FIBF_SCRIPT 0x0040
138#define FIBF_PURE 0x0020 /* no use under linux */
139#define FIBF_ARCHIVED 0x0010 /* never set, always cleared on write */
140#define FIBF_NOREAD 0x0008 /* 0 means allowed */
141#define FIBF_NOWRITE 0x0004 /* 0 means allowed */
142#define FIBF_NOEXECUTE 0x0002 /* 0 means allowed, ignored under linux */
143#define FIBF_NODELETE 0x0001 /* 0 means allowed */
144
145#define FIBF_OWNER 0x000F /* Bits pertaining to owner */
146#define FIBF_MASK 0xEE0E /* Bits modified by Linux */
147
148#endif