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 Fsrpc *next; /* freelist */
18 int flushtag; /* Tag on which to reply to flush */
19 Fcall work; /* Plan 9 incoming Fcall */
20 uchar buf[]; /* Data buffer */
25 int fid; /* system fd for i/o */
26 File *f; /* File attached to this fid */
28 int nr; /* fid number */
29 int mid; /* Mount id */
30 Fid *next; /* hash link */
32 /* for preaddir -- ARRGH! */
33 Dir *dir; /* buffer for reading directories */
34 int ndir; /* number of entries in dir */
35 int cdir; /* number of consumed entries in dir */
36 int gdir; /* glue index */
37 vlong offset; /* offset in virtual directory */
76 Nqidtab = (1<<Nqidbits),
93 Extern Proc *Proclist;
94 Extern char psmap[Npsmpt];
95 Extern Qidtab *qidtab[Nqidtab];
96 Extern ulong messagesize;
99 Extern char* patternfile;
101 /* File system protocol service procedures */
102 void Xattach(Fsrpc*);
105 void Xcreate(Fsrpc*);
108 void Xremove(Fsrpc*);
110 void Xversion(Fsrpc*);
115 void reply(Fcall*, Fcall*, char*);
119 Fsrpc *getsbuf(void);
120 void putsbuf(Fsrpc*);
122 void fatal(char*, ...);
123 char* makepath(File*, char*);
124 File *file(File*, char*);
125 void freefile(File*);
126 void slaveopen(Fsrpc*);
127 void slaveread(Fsrpc*);
128 void slavewrite(Fsrpc*);
129 void blockingslave(Proc*);
131 void noteproc(int, char*);
132 void flushaction(void*, char*);
133 void pushfcall(char*);
134 Qidtab* uniqueqid(Dir*);
135 void freeqid(Qidtab*);
136 char* estrdup(char*);
137 void* emallocz(uint);
138 int readmessage(int, char*, int);
139 void exclusions(void);
140 int excludefile(char*);
141 int preaddir(Fid*, uchar*, int, vlong);