xref: /plan9/sys/src/cmd/disk/kfs/dat.c (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1 #include	"all.h"
2 
3 Uid*	uid;
4 char*	uidspace;
5 short*	gidspace;
6 RWLock	mainlock;
7 long	boottime;
8 Tlock	*tlocks;
9 Conf	conf;
10 Cons	cons;
11 Chan	*chan;
12 char	service[2*NAMELEN];
13 char	*progname;
14 char	*procname;
15 int	RBUFSIZE;
16 int	BUFSIZE;
17 int	DIRPERBUF;
18 int	INDPERBUF;
19 int	INDPERBUF2;
20 int	FEPERBUF;
21 
22 Filsys	filesys[MAXFILSYS] =
23 {
24 	{"main",	{Devwren, 0, 0, 0},	0},
25 };
26 
27 Device 	devnone = {Devnone, 0, 0, 0};
28 
29 Devcall devcall[MAXDEV] = {
30 	[Devnone]	{0},
31 	[Devwren]	{wreninit, wrenream, wrencheck, wrensuper, wrenroot, wrensize, wrenread, wrenwrite},
32 };
33 
34 char*	tagnames[] =
35 {
36 	[Tbuck]		"Tbuck",
37 	[Tdir]		"Tdir",
38 	[Tfile]		"Tfile",
39 	[Tfree]		"Tfree",
40 	[Tind1]		"Tind1",
41 	[Tind2]		"Tind2",
42 	[Tnone]		"Tnone",
43 	[Tsuper]	"Tsuper",
44 	[Tvirgo]	"Tvirgo",
45 	[Tcache]	"Tcache",
46 };
47 
48 char	*errstring[MAXERR] =
49 {
50 	[Ebadspc]	"attach -- bad specifier",
51 	[Efid]		"unknown fid",
52 	[Echar]		"bad character in directory name",
53 	[Eopen]		"read/write -- on non open fid",
54 	[Ecount]	"read/write -- count too big",
55 	[Ealloc]	"phase error -- directory entry not allocated",
56 	[Eqid]		"phase error -- qid does not match",
57 	[Eauth]		"authentication failed",
58 	[Eauthmsg]	"kfs: authentication not required",
59 	[Eaccess]	"access permission denied",
60 	[Eentry]	"directory entry not found",
61 	[Emode]		"open/create -- unknown mode",
62 	[Edir1]		"walk -- in a non-directory",
63 	[Edir2]		"create -- in a non-directory",
64 	[Ephase]	"phase error -- cannot happen",
65 	[Eexist]	"create -- file exists",
66 	[Edot]		"create -- . and .. illegal names",
67 	[Eempty]	"remove -- directory not empty",
68 	[Ebadu]		"attach -- privileged user",
69 	[Enotu]		"wstat -- not owner",
70 	[Enotg]		"wstat -- not in group",
71 	[Enotl]		"wstat -- attempt to change length",
72 	[Enotd]		"wstat -- attempt to change directory",
73 	[Enotm]		"wstat -- unknown type/mode",
74 	[Ename]		"create/wstat -- bad character in file name",
75 	[Ewalk]		"walk -- too many (system wide)",
76 	[Eronly]	"file system read only",
77 	[Efull]		"file system full",
78 	[Eoffset]	"read/write -- offset negative",
79 	[Elocked]	"open/create -- file is locked",
80 	[Ebroken]	"close/read/write -- lock is broken",
81 	[Efidinuse]	"fid already in use",
82 	[Etoolong]	"name too long",
83 	[Ersc]	"it's russ's fault.  bug him.",
84 	[Econvert]	"protocol botch",
85 	[Eqidmode]	"wstat -- qid.type/dir.mode mismatch",
86 	[Esystem]	"kfs system error",
87 };
88