diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-08 19:35:26 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-08 19:35:26 +0100 |
commit | 3d20565a78358ed2589359aafeca8a4e7270b57e (patch) | |
tree | 1fa0b6d497cc65395c3ddcbb3ff37ccaf9ced672 /sys/src/cmd/webfs/fs.c | |
parent | 302fc26fdd86f5a4090b4c9bb4292f71bea1d68d (diff) |
webfs: faster shutdown using postnote()
when the 9p end is closed, post a note to our private note
group to shoot down http procs. this results in quicker
release of namespace resources.
Diffstat (limited to 'sys/src/cmd/webfs/fs.c')
-rw-r--r-- | sys/src/cmd/webfs/fs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/src/cmd/webfs/fs.c b/sys/src/cmd/webfs/fs.c index 7f2eb70fd..0d59b3d06 100644 --- a/sys/src/cmd/webfs/fs.c +++ b/sys/src/cmd/webfs/fs.c @@ -756,6 +756,13 @@ fsstart(Srv*) unmount(nil, mtpt); } +static void +fsend(Srv*) +{ + postnote(PNGROUP, getpid(), "shutdown"); + exits(nil); +} + Srv fs = { .start=fsstart, @@ -768,6 +775,7 @@ Srv fs = .write=fswrite, .flush=fsflush, .destroyfid=fsdestroyfid, + .end=fsend, }; void @@ -832,5 +840,5 @@ main(int argc, char *argv[]) } postmountsrv(&fs, service, mtpt, MREPL); - exits(0); + exits(nil); } |