shithub: riscv

Download patch

ref: 6f1efd37a23d8ae0a1907cce14749079a3aabb3c
parent: 52f71a17da1a3e6091ae508e376bf627a0219378
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Wed Nov 7 17:04:29 EST 2012

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.

--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -476,8 +476,8 @@
 struct {
 	Chan *head;
 	Chan *tail;
-	int nqueued;
-	int nclosed;
+	ulong nqueued;
+	ulong nclosed;
 	Lock l;
 	QLock q;
 	Rendez r;
@@ -555,7 +555,8 @@
 
 	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;
 	}
--