]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/include/9p.h
pool: declare pooldump in pool.h. the manual says it is public.
[plan9front.git] / sys / include / 9p.h
index fb2862438485698daa04f51e4bb503e2b0423d0c..27bec9b9a14aae0b97509d93c6d276b39c7883af 100644 (file)
@@ -27,10 +27,27 @@ typedef struct Filelist     Filelist;
 typedef struct Tree            Tree;
 typedef struct Readdir Readdir;
 typedef struct Srv Srv;
+typedef struct Reqqueue Reqqueue;
+typedef struct Queueelem Queueelem;
 
 #pragma incomplete Filelist
 #pragma incomplete Readdir
 
+struct Queueelem
+{
+       Queueelem *prev, *next;
+       void (*f)(Req *);
+};
+
+struct Reqqueue
+{
+       QLock;
+       Rendez;
+       Queueelem;
+       int pid, flush;
+       Req *cur;
+};
+
 struct Fid
 {
        ulong   fid;
@@ -60,6 +77,8 @@ struct Req
        Fid*            afid;
        Fid*            newfid;
        Srv*            srv;
+       
+       Queueelem qu;
 
 /* below is implementation-specific; don't use */
        QLock   lk;
@@ -176,6 +195,7 @@ struct Srv {
        Tree*   tree;
        void            (*destroyfid)(Fid*);
        void            (*destroyreq)(Req*);
+       void            (*start)(Srv*);
        void            (*end)(Srv*);
        void*   aux;
 
@@ -211,22 +231,26 @@ struct Srv {
        QLock   wlock;
        
        char*   addr;
+
+       QLock   slock;
+       Ref     sref;
+       Ref     rref;
 };
 
 void           srv(Srv*);
 void           postmountsrv(Srv*, char*, char*, int);
 void           _postmountsrv(Srv*, char*, char*, int);
-void           postsharesrv(Srv*, char*, char*, char*, char*);
-void           _postsharesrv(Srv*, char*, char*, char*, char*);
+void           postsharesrv(Srv*, char*, char*, char*);
+void           _postsharesrv(Srv*, char*, char*, char*);
 void           listensrv(Srv*, char*);
 void           _listensrv(Srv*, char*);
 int            postfd(char*, int);
-int            sharefd(char*, char*, char*, int);
+int            sharefd(char*, char*, int);
 int            chatty9p;
 void           respond(Req*, char*);
 void           responderror(Req*);
 void           threadpostmountsrv(Srv*, char*, char*, int);
-void           threadpostsharesrv(Srv*, char*, char*, char*, char*);
+void           threadpostsharesrv(Srv*, char*, char*, char*);
 void           threadlistensrv(Srv *s, char *addr);
 
 /*
@@ -255,3 +279,9 @@ int         authattach(Req*);
 
 extern void (*_forker)(void (*)(void*), void*, int);
 
+void           srvacquire(Srv *);
+void           srvrelease(Srv *);
+
+Reqqueue*      reqqueuecreate(void);
+void           reqqueuepush(Reqqueue*, Req*, void (*)(Req *));
+void           reqqueueflush(Reqqueue*, Req*);