X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=sys%2Finclude%2F9p.h;h=27bec9b9a14aae0b97509d93c6d276b39c7883af;hb=4afbc988cadd89e9063a10d27996fa09025ed3f5;hp=fb2862438485698daa04f51e4bb503e2b0423d0c;hpb=7d0ce95567fdd93176cf45ebba50d9c27e40b45b;p=plan9front.git diff --git a/sys/include/9p.h b/sys/include/9p.h index fb2862438..27bec9b9a 100644 --- a/sys/include/9p.h +++ b/sys/include/9p.h @@ -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*);