2 * exportfs.h - definitions for exporting file server
5 #define DEBUG if(!dbg){}else fprint
6 #define fidhash(s) fhash[s%FHASHSIZE]
8 typedef struct Fsrpc Fsrpc;
9 typedef struct Fid Fid;
10 typedef struct File File;
11 typedef struct Proc Proc;
12 typedef struct Qidtab Qidtab;
16 Fsrpc *next; /* freelist */
17 int flushtag; /* Tag on which to reply to flush */
18 Fcall work; /* Plan 9 incoming Fcall */
19 uchar buf[]; /* Data buffer */
24 int fid; /* system fd for i/o */
25 File *f; /* File attached to this fid */
27 int nr; /* fid number */
28 int mid; /* Mount id */
29 Fid *next; /* hash link */
31 /* for preaddir -- ARRGH! */
32 Dir *dir; /* buffer for reading directories */
33 int ndir; /* number of entries in dir */
34 int cdir; /* number of consumed entries in dir */
35 int gdir; /* glue index */
36 vlong offset; /* offset in virtual directory */
75 Nqidtab = (1<<Nqidbits),
92 Extern Proc *Proclist;
93 Extern char psmap[Npsmpt];
94 Extern Qidtab *qidtab[Nqidtab];
95 Extern ulong messagesize;
98 Extern char* patternfile;
100 /* File system protocol service procedures */
101 void Xattach(Fsrpc*);
104 void Xcreate(Fsrpc*);
107 void Xremove(Fsrpc*);
109 void Xversion(Fsrpc*);
115 void reply(Fcall*, Fcall*, char*);
116 void mounterror(char*);
121 Fsrpc *getsbuf(void);
122 void putsbuf(Fsrpc*);
124 void fatal(char*, ...);
125 char* makepath(File*, char*);
126 File *file(File*, char*);
127 void freefile(File*);
128 void slaveopen(Fsrpc*);
129 void slaveread(Fsrpc*);
130 void slavewrite(Fsrpc*);
131 void blockingslave(Proc*);
133 void noteproc(int, char*);
134 void flushaction(void*, char*);
135 void pushfcall(char*);
136 Qidtab* uniqueqid(Dir*);
137 void freeqid(Qidtab*);
138 char* estrdup(char*);
139 void* emallocz(uint);
140 int readmessage(int, char*, int);
141 void exclusions(void);
142 int excludefile(char*);
143 int preaddir(Fid*, uchar*, int, vlong);