shithub: riscv

Download patch

ref: b830824cba80242e803e75816cf591f8ac32ca40
parent: 9b194f23b2a544fab666e40f4f574c8fceb7601f
author: Alex Musolino <alex@musolino.id.au>
date: Thu Dec 13 06:59:34 EST 2018

upas/fs: remove now unnecessary "force" argument to cachefree

--- a/sys/src/cmd/upas/fs/cache.c
+++ b/sys/src/cmd/upas/fs/cache.c
@@ -32,13 +32,11 @@
 }
 
 void
-cachefree(Mailbox *mb, Message *m, int force)
+cachefree(Mailbox *mb, Message *m)
 {
 	long i;
 	Message *s, **ll;
 
-	if(!force && mb->fetch == nil)
-		return;
 	if(Topmsg(mb, m)){
 		for(ll = &mb->lru; *ll != nil; ll = &((*ll)->lru)){
 			if(*ll == m){
@@ -53,7 +51,7 @@
 		mb->cached -= m->csize;
 	}
 	for(s = m->part; s; s = s->next)
-		cachefree(mb, s, force);
+		cachefree(mb, s);
 	if(m->mallocd){
 		free(m->start);
 		m->mallocd = 0;
@@ -100,7 +98,7 @@
 				return;
 			addlru(mb, mb->lru);
 		}
-		cachefree(mb, mb->lru, 1);
+		cachefree(mb, mb->lru);
 	}
 }
 
--- a/sys/src/cmd/upas/fs/dat.h
+++ b/sys/src/cmd/upas/fs/dat.h
@@ -207,7 +207,7 @@
 
 /**/
 void		putcache(Mailbox*, Message*);		/* asymmetricial */
-void		cachefree(Mailbox*, Message*, int);
+void		cachefree(Mailbox*, Message*);
 
 char*		syncmbox(Mailbox*, int);
 void*		emalloc(ulong);
--- a/sys/src/cmd/upas/fs/mbox.c
+++ b/sys/src/cmd/upas/fs/mbox.c
@@ -1041,7 +1041,7 @@
 
 		if(Topmsg(mb, m))
 			mtreedelete(mb, m);
-		cachefree(mb, m, 1);
+		cachefree(mb, m);
 		idxfree(m);
 	}
 	free(m->unixfrom);