shithub: gefs

Download patch

ref: 26906a09d79ff2821feb1aff0bb2519226867c40
parent: b8f5789e59df3a49050b37d03bb73babc58e037a
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Oct 14 14:57:12 EDT 2023

clearb: clean up params

--- a/fs.c
+++ b/fs.c
@@ -280,13 +280,13 @@
  * the range listed.
  */
 static char*
-clearb(int id, Mount *mnt, vlong qid, vlong off, vlong len)
+clearb(int id, Mount *mnt, vlong qid, vlong len)
 {
 	char *e, buf[Offksz];
+	vlong off;
 	Msg m;
 
-	off &= ~(Blksz - 1);
-	for(; off < len; off += Blksz){
+	for(off = 0; off < len; off += Blksz){
 		m.k = buf;
 		m.nk = sizeof(buf);
 		m.op = Oclearb;
@@ -1639,7 +1639,7 @@
 	if((e = upsert(f->mnt, mb, 1)) != nil)
 		goto Error;
 	if(f->dent->qid.type == QTFILE){
-		e = clearb(id, f->mnt, f->qpath, 0, f->dent->length);
+		e = clearb(id, f->mnt, f->qpath, f->dent->length);
 		if(e != nil)
 			goto Error;
 	}
@@ -1738,7 +1738,7 @@
 		mb.nk = f->dent->nk;
 		mb.v = buf;
 		mb.nv = p - buf;
-		clearb(id, f->mnt, f->qpath, 0, f->dent->length);
+		clearb(id, f->mnt, f->qpath, f->dent->length);
 		if((e = upsert(f->mnt, &mb, 1)) != nil){
 			wunlock(f->dent);
 			rerror(m, e);