Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef AMIGAFFS_H
0003 #define AMIGAFFS_H
0004 
0005 #include <linux/types.h>
0006 #include <asm/byteorder.h>
0007 
0008 #define FS_OFS      0x444F5300
0009 #define FS_FFS      0x444F5301
0010 #define FS_INTLOFS  0x444F5302
0011 #define FS_INTLFFS  0x444F5303
0012 #define FS_DCOFS    0x444F5304
0013 #define FS_DCFFS    0x444F5305
0014 #define MUFS_FS     0x6d754653   /* 'muFS' */
0015 #define MUFS_OFS    0x6d754600   /* 'muF\0' */
0016 #define MUFS_FFS    0x6d754601   /* 'muF\1' */
0017 #define MUFS_INTLOFS    0x6d754602   /* 'muF\2' */
0018 #define MUFS_INTLFFS    0x6d754603   /* 'muF\3' */
0019 #define MUFS_DCOFS  0x6d754604   /* 'muF\4' */
0020 #define MUFS_DCFFS  0x6d754605   /* 'muF\5' */
0021 
0022 #define T_SHORT     2
0023 #define T_LIST      16
0024 #define T_DATA      8
0025 
0026 #define ST_LINKFILE -4
0027 #define ST_FILE     -3
0028 #define ST_ROOT     1
0029 #define ST_USERDIR  2
0030 #define ST_SOFTLINK 3
0031 #define ST_LINKDIR  4
0032 
0033 #define AFFS_ROOT_BMAPS     25
0034 
0035 /* Seconds since Amiga epoch of 1978/01/01 to UNIX */
0036 #define AFFS_EPOCH_DELTA ((8 * 365 + 2) * 86400LL)
0037 
0038 struct affs_date {
0039     __be32 days;
0040     __be32 mins;
0041     __be32 ticks;
0042 };
0043 
0044 struct affs_short_date {
0045     __be16 days;
0046     __be16 mins;
0047     __be16 ticks;
0048 };
0049 
0050 struct affs_root_head {
0051     __be32 ptype;
0052     __be32 spare1;
0053     __be32 spare2;
0054     __be32 hash_size;
0055     __be32 spare3;
0056     __be32 checksum;
0057     __be32 hashtable[1];
0058 };
0059 
0060 struct affs_root_tail {
0061     __be32 bm_flag;
0062     __be32 bm_blk[AFFS_ROOT_BMAPS];
0063     __be32 bm_ext;
0064     struct affs_date root_change;
0065     u8 disk_name[32];
0066     __be32 spare1;
0067     __be32 spare2;
0068     struct affs_date disk_change;
0069     struct affs_date disk_create;
0070     __be32 spare3;
0071     __be32 spare4;
0072     __be32 dcache;
0073     __be32 stype;
0074 };
0075 
0076 struct affs_head {
0077     __be32 ptype;
0078     __be32 key;
0079     __be32 block_count;
0080     __be32 spare1;
0081     __be32 first_data;
0082     __be32 checksum;
0083     __be32 table[1];
0084 };
0085 
0086 struct affs_tail {
0087     __be32 spare1;
0088     __be16 uid;
0089     __be16 gid;
0090     __be32 protect;
0091     __be32 size;
0092     u8 comment[92];
0093     struct affs_date change;
0094     u8 name[32];
0095     __be32 spare2;
0096     __be32 original;
0097     __be32 link_chain;
0098     __be32 spare[5];
0099     __be32 hash_chain;
0100     __be32 parent;
0101     __be32 extension;
0102     __be32 stype;
0103 };
0104 
0105 struct slink_front
0106 {
0107     __be32 ptype;
0108     __be32 key;
0109     __be32 spare1[3];
0110     __be32 checksum;
0111     u8 symname[1];  /* depends on block size */
0112 };
0113 
0114 struct affs_data_head
0115 {
0116     __be32 ptype;
0117     __be32 key;
0118     __be32 sequence;
0119     __be32 size;
0120     __be32 next;
0121     __be32 checksum;
0122     u8 data[1]; /* depends on block size */
0123 };
0124 
0125 /* Permission bits */
0126 
0127 #define FIBF_OTR_READ       0x8000
0128 #define FIBF_OTR_WRITE      0x4000
0129 #define FIBF_OTR_EXECUTE    0x2000
0130 #define FIBF_OTR_DELETE     0x1000
0131 #define FIBF_GRP_READ       0x0800
0132 #define FIBF_GRP_WRITE      0x0400
0133 #define FIBF_GRP_EXECUTE    0x0200
0134 #define FIBF_GRP_DELETE     0x0100
0135 
0136 #define FIBF_HIDDEN     0x0080
0137 #define FIBF_SCRIPT     0x0040
0138 #define FIBF_PURE       0x0020      /* no use under linux */
0139 #define FIBF_ARCHIVED       0x0010      /* never set, always cleared on write */
0140 #define FIBF_NOREAD     0x0008      /* 0 means allowed */
0141 #define FIBF_NOWRITE        0x0004      /* 0 means allowed */
0142 #define FIBF_NOEXECUTE      0x0002      /* 0 means allowed, ignored under linux */
0143 #define FIBF_NODELETE       0x0001      /* 0 means allowed */
0144 
0145 #define FIBF_OWNER      0x000F      /* Bits pertaining to owner */
0146 #define FIBF_MASK       0xEE0E      /* Bits modified by Linux */
0147 
0148 #endif