2 * statfs.h - definitions for statistic gathering file server
5 #define DEBUGFILE "iostats.out"
7 #define DEBUG if(!dbg){}else fprint
10 #define fidhash(s) fhash[s%FHASHSIZE]
13 Maxfdata = 8192, /* max size of data in 9P message */
14 Maxrpc = 20000,/* number of RPCs we'll log */
17 typedef struct Fsrpc Fsrpc;
18 typedef struct Fid Fid;
19 typedef struct File File;
20 typedef struct Proc Proc;
21 typedef struct Stats Stats;
22 typedef struct Rpc Rpc;
23 typedef struct Frec Frec;
58 int busy; /* Work buffer has pending rpc to service */
59 uintptr pid; /* Pid of slave process executing the rpc */
60 int canint; /* Interrupt gate */
61 int flushtag; /* Tag on which to reply to flush */
62 Fcall work; /* Plan 9 incoming Fcall */
63 uchar buf[IOHDRSZ+Maxfdata]; /* Data buffer */
68 int fid; /* system fd for i/o */
69 File *f; /* File attached to this fid */
71 int nr; /* fid number */
72 Fid *next; /* hash link */
77 vlong offset; /* for directories */
110 Extern Proc *Proclist;
117 /* File system protocol service procedures */
118 void Xcreate(Fsrpc*), Xclunk(Fsrpc*);
119 void Xversion(Fsrpc*), Xauth(Fsrpc*), Xflush(Fsrpc*);
120 void Xattach(Fsrpc*), Xwalk(Fsrpc*), Xauth(Fsrpc*);
121 void Xremove(Fsrpc*), Xstat(Fsrpc*), Xwstat(Fsrpc*);
124 void reply(Fcall*, Fcall*, char*);
128 Fsrpc *getsbuf(void);
131 void makepath(char*, File*, char*);
132 File *file(File*, char*);
133 void slaveopen(Fsrpc*);
134 void slaveread(Fsrpc*);
135 void slavewrite(Fsrpc*);
136 void blockingslave(void);
138 void noteproc(int, char*);
139 void flushaction(void*, char*);
140 void catcher(void*, char*);
142 void fidreport(Fid*);