-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuse_UniFLEX.h
More file actions
204 lines (171 loc) · 4.03 KB
/
Copy pathfuse_UniFLEX.h
File metadata and controls
204 lines (171 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#ifndef __FUSE_UNIFLEX_H__
#define __FUSE_UNIFLEX_H__
// Uniflex epoch starts 1980, Linux starts 1970
#define SECONDS_IN_DAY (60*60*24)
#define NUM_OF_LEAP_DAYS_IN_10_YEARS 2
#define EPOCHOFFSET 315532800 // SECONDS_IN_DAY * 365 * 10 + SECONDS_IN_DAY * NUM_OF_LEAP_DAYS_IN_10_YEARS
#define ROOTFDN 1
#define SIRBLK 1
#define PATH_DEPTH 32
#define CFDN 50
#define CDBLKS 100
#define MAPSIZ 13
#define NAMELENGTH 14
#define MAXDIRENT 32 // 512/16
#define MAXNAMELENGTH NAMELENGTH*4
#define UFBLKSIZ 512
#define UFINDBLKS 128 // nr of indirect entries in block
#define UFINDFILL 43 // (128 + 43) * 3 = 513
// status
#define DIS_FLOCK 0B00000001
#define DIS_FMOD 0B00000010
#define DIS_FTEXT 0B00000100
#define DIS_FMNT 0B00001000
#define DIS_FWLCK 0B00010000
// mode
#define DIM_FBUSY 0B00000001
#define DIM_FSBLK 0B00000010
#define DIM_FSCHR 0B00000100
#define DIM_FSDIR 0B00001000
#define DIM_FPRDF 0B00010000
#define DIM_FPWRF 0B00100000
// access
#define DIA_FACUR 0B00000001 // user read
#define DIA_FACUW 0B00000010
#define DIA_FACUE 0B00000100
#define DIA_FACOR 0B00001000 // other read
#define DIA_FACOW 0B00010000
#define DIA_FACOE 0B00100000
#define DIA_FXSET 0B01000000 // uid exec set
typedef struct {
uint8_t fdn_h;
uint8_t fdn_l;
} UFDN;
typedef struct {
uint8_t blkad_h;
uint8_t blkad_m;
uint8_t blkad_l;
} UDSKAD;
//
// UniFLEX INO
//
typedef struct
{
uint8_t f_mode;
uint8_t f_access;
uint8_t f_dirlc;
uint8_t f_ouid_h;
uint8_t f_ouid_l;
uint8_t f_fsize_hh;
uint8_t f_fsize_mh;
uint8_t f_fsize_ml;
uint8_t f_fsize_ll;
UDSKAD f_ffmap[MAPSIZ];
uint8_t f_sutime_hh;
uint8_t f_sutime_mh;
uint8_t f_sutime_ml;
uint8_t f_sutime_ll;
uint8_t f_filler[12];
} DINODE;
typedef struct {
struct {
mode_t f_mode;
uint8_t f_dirlc;
uint16_t f_ouid;
uint32_t f_fsize;
int32_t f_ffmap[MAPSIZ];
uint32_t f_sutime;
uint8_t f_filler[12];
};
uint16_t l_ino;
uint16_t l_dirino;
} LINODE;
typedef struct {
uint8_t dino_h;
uint8_t dino_l;
char fname[NAMELENGTH];
} UDIRENT;
#define UDIRENTS UFBLKSIZ/sizeof(UDIRENT)
typedef struct {
uint16_t dirents;
uint16_t diridx;
UDIRENT;
} LDIRENT;
//
// UniFLEX SIR
//
typedef struct {
uint8_t us_supdt;
uint8_t us_swprot;
uint8_t us_slkfr;
uint8_t us_slkfdn;
uint8_t us_sintid_hh;
uint8_t us_sintid_mh;
uint8_t us_sintid_ml;
uint8_t us_sintid_ll;
uint8_t us_scrtim_hh;
uint8_t us_scrtim_mh;
uint8_t us_scrtim_ml;
uint8_t us_scrtim_ll;
uint8_t us_sutime_hh;
uint8_t us_sutime_mh;
uint8_t us_sutime_ml;
uint8_t us_sutime_ll;
uint8_t us_sszfdn_h;
uint8_t us_sszfdn_l;
UDSKAD us_ssizfr;
UDSKAD us_sfreec;
uint8_t us_sfdnc_h;
uint8_t us_sfdnc_l;
uint8_t us_sfname[14];
uint8_t us_spname[14];
uint8_t us_sfnumb_h;
uint8_t us_sfnumb_l;
uint8_t us_sflawc_h;
uint8_t us_sflawc_l;
uint8_t us_sdenf;
uint8_t us_ssidf;
UDSKAD us_sswpbg;
uint8_t us_sswpsz_h;
uint8_t us_sswpsz_l;
uint8_t us_s64k;
uint8_t us_swinc[11];
uint8_t us_sspare[11];
uint8_t us_snfdn;
UFDN us_scfdn[CFDN];
uint8_t us_snfree;
UDSKAD us_sfree[CDBLKS];
uint8_t us_filler[22];
} UFSIR;
//
// UniFLEX SIR in Linux format
//
typedef struct {
uint8_t ls_supdt;
uint8_t ls_swprot;
uint8_t ls_slkfr;
uint8_t ls_slkfdn;
uint32_t ls_sintid;
uint32_t ls_scrtim;
uint32_t ls_sutime;
uint16_t ls_sszfdn; // blocks fdn list
uint32_t ls_ssizfr; //blocks in volume
uint32_t ls_sfreec; // total free blocks
uint16_t ls_sfdnc; // free fdn count
char ls_sfname[14]; // file system name
char ls_spname[14]; // pack name
uint16_t ls_sfnumb; // file system number
uint16_t ls_sflawc; // flawed block count
uint8_t ls_sdenf; // single(0) density
uint8_t ls_ssidf; // single(0) side
uint32_t ls_sswpbg; // swap starting blokc
uint16_t ls_sswpsz; // swap size
uint8_t ls_s64k; // swap block multiple of 64k
uint8_t ls_swinc[11]; // Winchester config
uint8_t ls_sspare[11]; // spare
uint8_t ls_snfdn; // # in core fdns
uint16_t ls_cfdn[CFDN]; // in core free fdns
uint8_t ls_snfree; // in core free blocks
uint32_t ls_sfree[CDBLKS]; // in core free blocks
} LINSIR;
#endif // __FUSE_UNIFLEX_H__