-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhammer2fs.c
More file actions
69 lines (59 loc) · 1.12 KB
/
Copy pathhammer2fs.c
File metadata and controls
69 lines (59 loc) · 1.12 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
#include <u.h>
#include <libc.h>
#include <stdio.h>
#include <fcall.h>
#include <flate.h>
#include <thread.h>
#include <9p.h>
#include "uuid.h"
#include "hammer2_disk.h"
#include "hammer2.h"
#include "9phammer.h"
#include "lz4.h"
extern char *filename;
extern root_t root;
extern int devfd;
void mythreadpostmountsrv(Srv *s, char *name, char *mtpt, int flag);
static Srv fs = {
.open = fsopen,
.attach = fsattach,
.start = fsstart,
.read = fsread,
.walk1 = fswalk,
.clone = fswalkclone,
.stat = fsstat,
};
void usage(void) {
fprint(2, "usage: %s [-r root] [-S srvname] [-f devicename]\n", argv0);
}
void threadmain(int argc, char *argv[])
{
char *srvname = "hammer2";
ARGBEGIN{
case 'D':
chatty9p++;
break;
case 'S':
srvname = EARGF(usage());
break;
case 'f':
filename = strdup(EARGF(usage()));
break;
case 'r':
root.pfsname = EARGF(usage());
break;
default:
usage();
}ARGEND;
if (argc > 0)
usage();
if (filename == nil) {
filename = "/dev/sdE0/hammer2";
}
if (root.pfsname == nil) {
root.pfsname = "ROOT";
}
initcons(srvname);
mythreadpostmountsrv(&fs, srvname, nil, 0);
threadexits(nil);
}