1 typedef struct Chan Chan;
2 typedef struct Command Command;
3 typedef struct Conf Conf;
4 typedef struct Cons Cons;
5 typedef struct Devcall Devcall;
7 #define MAXBUFSIZE (16*1024) /* max. buffer size */
13 int chan; /* fd request came in on */
14 QLock rlock, wlock; /* lock for reading/writing messages on chan */
18 File* flist; /* base of file structures */
19 Lock flock; /* manipulate flist */
20 RWLock reflock; /* lock for Tflush */
21 int msize; /* version */
22 int authed; /* someone other than ``none'' has authed */
33 * console cons.flag flags
37 Fchat = (1<<0), /* print out filesys rpc traffic */
38 Fuid = (1<<2), /* print out uids */
39 /* debugging flags for drivers */
44 int flags; /* overall flags for all channels */
45 int uid; /* botch -- used to get uid on cons_create */
46 int gid; /* botch -- used to get gid on cons_create */
47 int allow; /* no-protection flag */
48 long offset; /* used to read files, c.f. fchar */
49 char* arg; /* pointer to remaining line */
51 Chan *chan; /* console channel */
52 Chan *srvchan; /* local server channel */
54 Filter work; /* thruput in messages */
55 Filter rate; /* thruput in bytes */
56 Filter bhit; /* getbufs that hit */
57 Filter bread; /* getbufs that miss and read */
58 Filter binit; /* getbufs that miss and dont read */
59 Filter tags[MAXTAG]; /* reads of each type of block */
64 ulong niobuf; /* number of iobufs to allocate */
65 ulong nuid; /* distinct uids */
66 ulong uidspace; /* space for uid names -- derrived from nuid */
67 ulong gidspace; /* space for gid names -- derrived from nuid */
68 ulong nserve; /* server processes */
69 ulong nfile; /* number of fid -- system wide */
70 ulong nwpath; /* number of active paths, derrived from nfile */
71 ulong bootsize; /* number of bytes reserved for booting */
86 long (*super)(Device);
89 int (*read)(Device, long, void*);
90 int (*write)(Device, long, void*);
112 * should be in portdat.h
114 #define QPDIR 0x80000000L
120 * perm argument in p9 create
122 #define PDIR (1L<<31) /* is a directory */
123 #define PAPND (1L<<30) /* is append only */
124 #define PLOCK (1L<<29) /* is locked on open */
132 #define SECOND(n) (n)
133 #define MINUTE(n) (n*SECOND(60))
134 #define HOUR(n) (n*MINUTE(60))
135 #define DAY(n) (n*HOUR(24))
136 #define TLOCK MINUTE(5)
138 #define CHAT(cp) (chat)
139 #define QID9P1(a,b) (Qid9p1){a,b}
142 extern char* uidspace;
143 extern short* gidspace;
144 extern char* errstring[MAXERR];
146 extern RWLock mainlock;
147 extern long boottime;
148 extern Tlock *tlocks;
149 extern Device devnone;
150 extern Filsys filesys[];
151 extern char service[];
152 extern char* tagnames[];
155 extern Command command[];
157 extern Devcall devcall[];
158 extern char *progname;
159 extern char *procname;
164 extern int writeallow;
165 extern int wstatallow;
166 extern int allownone;
168 extern int writegroup;
170 extern Lock wpathlock;