Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/cmd/unix/drawterm/exportfs/exportfs.h – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/*
2
 * exportfs.h - definitions for exporting file server
3
 */
4
 
5
#define DEBUG		if(!dbg){}else fprint
6
#define DFD		2
7
#define fidhash(s)	fhash[s%FHASHSIZE]
8
 
9
#define Proc	Exproc
10
 
11
 
12
typedef struct Fsrpc Fsrpc;
13
typedef struct Fid Fid;
14
typedef struct File File;
15
typedef struct Proc Proc;
16
typedef struct Qidtab Qidtab;
17
 
18
struct Fsrpc
19
{
20
	int	busy;		/* Work buffer has pending rpc to service */
21
	int	pid;		/* Pid of slave process executing the rpc */
22
	int	canint;		/* Interrupt gate */
23
	int	flushtag;	/* Tag on which to reply to flush */
24
	Fcall work;		/* Plan 9 incoming Fcall */
25
	uchar	*buf;	/* Data buffer */
26
};
27
 
28
struct Fid
29
{
30
	int	fid;		/* system fd for i/o */
31
	File	*f;		/* File attached to this fid */
32
	int	mode;
33
	int	nr;		/* fid number */
34
	int	mid;		/* Mount id */
35
	Fid	*next;		/* hash link */
36
};
37
 
38
struct File
39
{
40
	char	*name;
41
	int	ref;
42
	Qid	qid;
43
	Qidtab	*qidt;
44
	int	inval;
45
	File	*parent;
46
	File	*child;
47
	File	*childlist;
48
};
49
 
50
struct Proc
51
{
52
	int	pid;
53
	int	busy;
54
	Proc	*next;
55
};
56
 
57
struct Qidtab
58
{
59
	int	ref;
60
	int	type;
61
	int	dev;
62
	vlong	path;
63
	vlong	uniqpath;
64
	Qidtab	*next;
65
};
66
 
67
enum
68
{
69
	MAXPROC		= 50,
70
	FHASHSIZE	= 64,
71
	Nr_workbufs 	= 50,
72
	Fidchunk	= 1000,
73
	Npsmpt		= 32,
74
	Nqidbits		= 5,
75
	Nqidtab		= (1<<Nqidbits),
76
};
77
 
78
#define Enomem Exenomem
79
#define Ebadfix Exebadfid
80
#define Enotdir Exenotdir
81
#define Edupfid Exedupfid
82
#define Eopen Exeopen
83
#define Exmnt Exexmnt
84
#define Emip Exemip
85
#define Enopsmt Exenopsmt
86
 
87
extern char Ebadfid[];
88
extern char Enotdir[];
89
extern char Edupfid[];
90
extern char Eopen[];
91
extern char Exmnt[];
92
extern char Enomem[];
93
extern char Emip[];
94
extern char Enopsmt[];
95
 
96
Extern Fsrpc	*Workq;
97
Extern int  	dbg;
98
Extern File	*root;
99
Extern File	*psmpt;
100
Extern Fid	**fhash;
101
Extern Fid	*fidfree;
102
Extern Proc	*Proclist;
103
Extern char	psmap[Npsmpt];
104
Extern Qidtab	*qidtab[Nqidtab];
105
Extern ulong	messagesize;
106
Extern int		srvfd;
107
 
108
/* File system protocol service procedures */
109
void Xattach(Fsrpc*);
110
void Xauth(Fsrpc*);
111
void Xclunk(Fsrpc*); 
112
void Xcreate(Fsrpc*);
113
void Xflush(Fsrpc*); 
114
void Xnop(Fsrpc*);
115
void Xremove(Fsrpc*);
116
void Xstat(Fsrpc*);
117
void Xversion(Fsrpc*);
118
void Xwalk(Fsrpc*);
119
void Xwstat(Fsrpc*);
120
void slave(Fsrpc*);
121
 
122
void	reply(Fcall*, Fcall*, char*);
123
Fid 	*getfid(int);
124
int	freefid(int);
125
Fid	*newfid(int);
126
Fsrpc	*getsbuf(void);
127
void	initroot(void);
128
void	fatal(char*, ...);
129
char*	makepath(File*, char*);
130
File	*file(File*, char*);
131
void	freefile(File*);
132
void	slaveopen(Fsrpc*);
133
void	slaveread(Fsrpc*);
134
void	slavewrite(Fsrpc*);
135
void	blockingslave(void*);
136
void	reopen(Fid *f);
137
void	noteproc(int, char*);
138
void	flushaction(void*, char*);
139
void	pushfcall(char*);
140
Qidtab* uniqueqid(Dir*);
141
void	freeqid(Qidtab*);
142
char*	estrdup(char*);
143
void*	emallocz(uint);
144
int		readmessage(int, char*, int);
145
 
146
#define notify(x)
147
#define noted(x)
148
#define exits(x)