]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/man/2/9p
auth/keyfs: support -r flag to mount read-only
[plan9front.git] / sys / man / 2 / 9p
old mode 100755 (executable)
new mode 100644 (file)
index 5ec6255..5fb78ba
@@ -8,12 +8,16 @@ estrdup9p,
 listensrv,
 postfd,
 postmountsrv,
+postsharesrv,
 readbuf,
 readstr,
 respond,
 responderror,
+srvacquire,
+srvrelease,
 threadlistensrv,
 threadpostmountsrv,
+threadpostsharesrv,
 srv \- 9P file service
 .SH SYNOPSIS
 .ft L
@@ -48,6 +52,7 @@ typedef struct Srv {
 
        void            (*destroyfid)(Fid *fid);
        void            (*destroyreq)(Req *r);
+       void            (*start)(Srv *s);
        void            (*end)(Srv *s);
        void*   aux;
 
@@ -63,7 +68,9 @@ typedef struct Srv {
 .ta \w'\fLvoid* 'u
 int    srv(Srv *s)
 void   postmountsrv(Srv *s, char *name, char *mtpt, int flag)
+void   postsharesrv(Srv *s, char *name, char *mtpt, char *desc)
 void   threadpostmountsrv(Srv *s, char *name, char *mtpt, int flag)
+void   threadpostsharesrv(Srv *s, char *name, char *mtpt, char *desc)
 void   listensrv(Srv *s, char *addr)
 void   threadlistensrv(Srv *s, char *addr)
 int    postfd(char *srvname, int fd)
@@ -80,6 +87,15 @@ void walkandclone(Req *r, char *(*walk1)(Fid *old, char *name, void *v),
 .nf
 .ft L
 .ta \w'\fLvoid* 'u
+void   srvrelease(Srv *s)
+void   srvacquire(Srv *s)
+.fi
+.PP
+.fi
+.PP
+.nf
+.ft L
+.ta \w'\fLvoid* 'u
 void*  emalloc9p(ulong n)
 void*  erealloc9p(void *v, ulong n)
 char*  estrdup9p(char *s)
@@ -224,6 +240,18 @@ this process, the entire process is terminated by calling
 (see
 .IR perror (2)).
 .PP
+.I Postsharesrv
+is similar to
+.I Postmountsrv
+but instead of mounting the service on a directory, it is
+put in a share (see
+.IR shr (3))
+where
+.IB mtpt
+is the name of the share and
+.IB desc
+is the name of the service channel.
+.PP
 .I Listensrv
 and
 .I threadlistensrv
@@ -332,7 +360,17 @@ and
 is single-threaded.
 If it is expected that some requests might
 block, arranging for alternate processes
-to handle them is suggested.
+to handle them is suggested (see
+.IR 9pqueue (2)).
+.PP
+.I Srvrelease
+temporarily releases the calling process from the server
+loop and if neccesary spawns a new process to handle 9p 
+requests. When released, the process can do blocking work
+that would otherwise halt processing of 9p requests.
+.I Srvacquire
+rejoins the calling process with the server loop after
+a srvrelease.
 .PP
 The constraints on the service functions are as follows.
 These constraints are checked while the server executes.
@@ -685,6 +723,7 @@ has been sent.
 .PP
 .IR Destroyfid ,
 .IR destroyreq ,
+.IR start ,
 and
 .I end
 are auxiliary functions, not called in direct response to 9P requests.
@@ -715,6 +754,10 @@ is called to allow the program to dispose of the
 .IB r -> aux
 pointer.
 .TP
+.I Start
+This gets called (from the forked service process) 
+prior entering the 9P service loop.
+.TP
 .I End
 Once the 9P service loop has finished
 (end of file been reached on the service pipe
@@ -755,12 +798,6 @@ option to increment
 and
 .B /sys/src/lib9p/ramfs.c
 are good examples of simple single-threaded file servers.
-.IR Webfs (4)
-and
-.I sshnet
-(see
-.IR ssh (1))
-are good examples of multithreaded file servers.
 .PP
 In general, the
 .B File
@@ -780,7 +817,9 @@ or is maintained elsewhere.
 .SH SEE ALSO
 .IR 9pfid (2),
 .IR 9pfile (2),
+.IR 9pqueue (2),
 .IR srv (3),
+.IR shr (3),
 .IR intro (5)
 .SH BUGS
 The switch to 9P2000 was taken as an opportunity to tidy