-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmfs.h
More file actions
72 lines (63 loc) · 1.5 KB
/
mfs.h
File metadata and controls
72 lines (63 loc) · 1.5 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
/*
There are a couple of symbols that need to be #defined before
#including all the headers.
*/
// The FUSE API has been changed a number of times. So, our code
// needs to define the version of the API that we assume. As of this
// writing, the most current API version is 26
#define FUSE_USE_VERSION 26
// need this to get pwrite(). I have to use setvbuf() instead of
// setlinebuf() later in consequence.
#define _XOPEN_SOURCE 500
#include <stdint.h>
#include <stdio.h>
#include <fuse.h>
typedef uint16_t word9;
typedef uint32_t word18;
typedef uint32_t word24;
typedef uint64_t word36;
typedef unsigned int uint;
typedef __uint128_t word72;
struct entry
{
char * name;
word36 uid;
word24 bitcnt;
// 4 directory
// 5 link
// 7 segment
int type;
char * link_target;
int pri_ind;
};
struct m_state
{
FILE * logfile;
char * dsknam;
int fd;
struct vtoc
{
word36 uid;
char * name;
char * dir_name;
char * fq_name;
word36 attr;
time_t dtu;
time_t dtm;
time_t time_created;
int sv;
int vtoce;
int32_t filemap [256];
// directory
int seg_cnt;
int dir_cnt;
int lnk_cnt;
int ent_cnt;
struct entry * entries;
} * vtoc;
int vtoc_no [3];
int total_vtoc_no;
int vtoc_cnt;
};
#define M_DATA ((struct m_state *) fuse_get_context () -> private_data)
void log_msg (const char * format, ...) __attribute__ ((format (printf, 1, 2)));