diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-11-07 22:04:29 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-11-07 22:04:29 +0100 |
commit | 6f1efd37a23d8ae0a1907cce14749079a3aabb3c (patch) | |
tree | 1bc141125cac8c96ee304dcb06737ba04f4f6a9b /sys/src/9/port/chan.c | |
parent | 52f71a17da1a3e6091ae508e376bf627a0219378 (diff) |
limit clunk queue length for cclose()
dont let the clunk queue grow too large if we are allowed to
block (cclose) as the fileserver might run out of fids.
Diffstat (limited to 'sys/src/9/port/chan.c')
-rw-r--r-- | sys/src/9/port/chan.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/src/9/port/chan.c b/sys/src/9/port/chan.c index dd59d370a..262b0703d 100644 --- a/sys/src/9/port/chan.c +++ b/sys/src/9/port/chan.c @@ -476,8 +476,8 @@ chanfree(Chan *c) struct { Chan *head; Chan *tail; - int nqueued; - int nclosed; + ulong nqueued; + ulong nclosed; Lock l; QLock q; Rendez r; @@ -555,7 +555,8 @@ cclose(Chan *c) if(devtab[c->type]->dc == L'M') if((c->flag&(CRCLOSE|CCACHE)) == CCACHE) - if((c->qid.type&(QTEXCL|QTMOUNT|QTAUTH)) == 0){ + if((c->qid.type&(QTEXCL|QTMOUNT|QTAUTH)) == 0) + if((clunkq.nqueued - clunkq.nclosed) < 64){ closechanq(c); return; } |