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.
This commit is contained in:
cinap_lenrek 2012-11-07 22:04:29 +01:00
parent 52f71a17da
commit 6f1efd37a2

View file

@ -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;
}