shithub: riscv

Download patch

ref: 755108a1446fe9571717f9b28b731137755248e5
parent: e3d959128398dd7b770d58f1ea8e97b2405e51d8
author: cinap_lenrek <[email protected]>
date: Mon Aug 5 18:07:50 EDT 2013

cwfs: remove reflock

queues allow multiple readers, reflock seems unneccesary.

--- a/sys/src/cmd/cwfs/all.h
+++ b/sys/src/cmd/cwfs/all.h
@@ -56,7 +56,6 @@
 Queue*	serveq;
 Queue*	raheadq;
 Rabuf*	rabuffree;
-QLock	reflock;
 Lock	rabuflock;
 Tlock	tlocks[NTLOCK];
 Lock	tlocklock;
--- a/sys/src/cmd/cwfs/main.c
+++ b/sys/src/cmd/cwfs/main.c
@@ -314,8 +314,6 @@
 		printsizes();
 	}
 
-	qlock(&reflock);
-	qunlock(&reflock);
 	serveq = newqueue(1000, "9P service");	/* tunable */
 	raheadq = newqueue(1000, "readahead");	/* tunable */
 
@@ -451,7 +449,6 @@
 	Msgbuf *mb;
 
 	for (;;) {
-		qlock(&reflock);
 		/* read 9P request from a network input process */
 		mb = fs_recv(serveq, 0);
 		assert(mb->magic == Mbmagic);
@@ -460,7 +457,6 @@
 		if (cp == nil)
 			panic("serve: nil mb->chan");
 		rlock(&cp->reflock);
-		qunlock(&reflock);
 
 		rlock(&mainlock);