From e5888a1ffdae813d7575f5fb02275c6bb07e5199 Mon Sep 17 00:00:00 2001 From: Taru Karttunen Date: Wed, 30 Mar 2011 15:46:40 +0300 Subject: Import sources from 2011-03-30 iso image --- sys/src/cmd/exportfs/exportfs.h | 144 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100755 sys/src/cmd/exportfs/exportfs.h (limited to 'sys/src/cmd/exportfs/exportfs.h') diff --git a/sys/src/cmd/exportfs/exportfs.h b/sys/src/cmd/exportfs/exportfs.h new file mode 100755 index 000000000..0f7ba3e71 --- /dev/null +++ b/sys/src/cmd/exportfs/exportfs.h @@ -0,0 +1,144 @@ +/* + * exportfs.h - definitions for exporting file server + */ + +#define DEBUG if(!dbg){}else fprint +#define DFD 9 +#define fidhash(s) fhash[s%FHASHSIZE] + +typedef struct Fsrpc Fsrpc; +typedef struct Fid Fid; +typedef struct File File; +typedef struct Proc Proc; +typedef struct Qidtab Qidtab; + +struct Fsrpc +{ + int busy; /* Work buffer has pending rpc to service */ + uintptr pid; /* Pid of slave process executing the rpc */ + int canint; /* Interrupt gate */ + int flushtag; /* Tag on which to reply to flush */ + Fcall work; /* Plan 9 incoming Fcall */ + uchar *buf; /* Data buffer */ +}; + +struct Fid +{ + int fid; /* system fd for i/o */ + File *f; /* File attached to this fid */ + int mode; + int nr; /* fid number */ + int mid; /* Mount id */ + Fid *next; /* hash link */ + + /* for preaddir -- ARRGH! */ + Dir *dir; /* buffer for reading directories */ + int ndir; /* number of entries in dir */ + int cdir; /* number of consumed entries in dir */ + int gdir; /* glue index */ + vlong offset; /* offset in virtual directory */ +}; + +struct File +{ + char *name; + int ref; + Qid qid; + Qidtab *qidt; + int inval; + File *parent; + File *child; + File *childlist; +}; + +struct Proc +{ + uintptr pid; + int busy; + Proc *next; +}; + +struct Qidtab +{ + int ref; + int type; + int dev; + vlong path; + vlong uniqpath; + Qidtab *next; +}; + +enum +{ + MAXPROC = 50, + FHASHSIZE = 64, + Nr_workbufs = 50, + Fidchunk = 1000, + Npsmpt = 32, + Nqidbits = 5, + Nqidtab = (1<