plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

fsimpl.h (728B)


      1 /* Copyright (C) 2003 Russ Cox, Massachusetts Institute of Technology */
      2 /* See COPYRIGHT */
      3 
      4 #include <thread.h>
      5 
      6 typedef struct Queue Queue;
      7 Queue *_fsqalloc(void);
      8 int _fsqsend(Queue*, void*);
      9 void *_fsqrecv(Queue*);
     10 void _fsqhangup(Queue*);
     11 void *_fsnbqrecv(Queue*);
     12 
     13 #include <mux.h>
     14 struct CFsys
     15 {
     16 	char version[20];
     17 	int msize;
     18 	QLock lk;
     19 	int fd;
     20 	int ref;
     21 	Mux mux;
     22 	CFid *root;
     23 	Queue *txq;
     24 	Queue *rxq;
     25 	CFid *freefid;
     26 	int nextfid;
     27 	Ioproc *iorecv;
     28 	Ioproc *iosend;
     29 };
     30 
     31 struct CFid
     32 {
     33 	int fid;
     34 	int mode;
     35 	CFid *next;
     36 	QLock lk;
     37 	CFsys *fs;
     38 	Qid qid;
     39 	vlong offset;
     40 };
     41 
     42 void _fsdecref(CFsys*);
     43 void _fsputfid(CFid*);
     44 CFid *_fsgetfid(CFsys*);
     45 
     46 int	_fsrpc(CFsys*, Fcall*, Fcall*, void**);
     47 CFid *_fswalk(CFid*, char*);