git: 9front

Download patch

ref: 518dc15822630929e5190cd96ca6f98cd48e7675
parent: 4c4c8364df3ff6bf0984139e4484509ee6f6cb8a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Oct 19 08:07:33 EDT 2025

devip: make Fs *ipfs[] and Queue *qlog static

These variables do not need to be exported. Make them static.

--- a/sys/src/9/ip/devip.c
+++ b/sys/src/9/ip/devip.c
@@ -53,9 +53,8 @@
 
 static char network[] = "network";
 
-QLock	fslock;
-Fs	*ipfs[Nfs];	/* attached fs's */
-Queue	*qlog;
+static Fs	*ipfs[Nfs];	/* attached fs's */
+static Queue	*qlog;
 
 extern	void nullmediumlink(void);
 extern	void pktmediumlink(void);
@@ -290,6 +289,7 @@
 static Chan*
 ipattach(char* spec)
 {
+	static QLock lk;
 	Chan *c;
 	ulong dev;
 
@@ -297,7 +297,7 @@
 	if(dev >= Nfs)
 		error(Enodev);
 
-	qlock(&fslock);
+	qlock(&lk);
 	if(ipfs[dev] == nil){
 		extern void (*ipprotoinit[])(Fs*);
 		Fs *f;
@@ -310,9 +310,10 @@
 		for(i = 0; ipprotoinit[i]; i++)
 			ipprotoinit[i](f);
 		f->dev = dev;
+		coherence();
 		ipfs[dev] = f;
 	}
-	qunlock(&fslock);
+	qunlock(&lk);
 
 	c = devattach('I', spec);
 	mkqid(&c->qid, QID(0, 0, Qtopdir), 0, QTDIR);
--