2 * exportfs.h - definitions for exporting file server
5 #define DEBUG if(!dbg){}else fprint
7 #define fidhash(s) fhash[s%FHASHSIZE]
9 typedef struct Fsrpc Fsrpc;
10 typedef struct Fid Fid;
11 typedef struct File File;
12 typedef struct Proc Proc;
13 typedef struct Qidtab Qidtab;
17 int busy; /* Work buffer has pending rpc to service */
18 uintptr pid; /* Pid of slave process executing the rpc */
19 int canint; /* Interrupt gate */
20 int flushtag; /* Tag on which to reply to flush */
21 Fcall work; /* Plan 9 incoming Fcall */
22 uchar *buf; /* Data buffer */
27 int fid; /* system fd for i/o */
28 File *f; /* File attached to this fid */
30 int nr; /* fid number */
31 int mid; /* Mount id */
32 Fid *next; /* hash link */
34 /* for preaddir -- ARRGH! */
35 Dir *dir; /* buffer for reading directories */
36 int ndir; /* number of entries in dir */
37 int cdir; /* number of consumed entries in dir */
38 int gdir; /* glue index */
39 vlong offset; /* offset in virtual directory */
79 Nqidtab = (1<<Nqidbits),
97 Extern Proc *Proclist;
98 Extern char psmap[Npsmpt];
99 Extern Qidtab *qidtab[Nqidtab];
100 Extern ulong messagesize;
101 Extern char Enomem[];
103 Extern char* patternfile;
105 /* File system protocol service procedures */
106 void Xattach(Fsrpc*);
109 void Xcreate(Fsrpc*);
112 void Xremove(Fsrpc*);
114 void Xversion(Fsrpc*);
119 void reply(Fcall*, Fcall*, char*);
123 Fsrpc *getsbuf(void);
125 void fatal(char*, ...);
126 char* makepath(File*, char*);
127 File *file(File*, char*);
128 void freefile(File*);
129 void slaveopen(Fsrpc*);
130 void slaveread(Fsrpc*);
131 void slavewrite(Fsrpc*);
132 void blockingslave(void);
134 void noteproc(int, char*);
135 void flushaction(void*, char*);
136 void pushfcall(char*);
137 Qidtab* uniqueqid(Dir*);
138 void freeqid(Qidtab*);
139 char* estrdup(char*);
140 void* emallocz(uint);
141 int readmessage(int, char*, int);
142 void exclusions(void);
143 int excludefile(char*);
144 int preaddir(Fid*, uchar*, int, vlong);