shithub: gefs

Download patch

ref: 2025a538a718859f040bfb343761703e9cb184ec
parent: 3e2d8934b70a0622a2bca53e281dbe811a3fed03
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Apr 25 22:00:11 EDT 2023

epoch: remove useless lock

--- a/blk.c
+++ b/blk.c
@@ -967,13 +967,9 @@
 		if((e & Eactive) && e != (ge | Eactive))
 			return;
 	}
-	lock(&fs->freelk);
-	p = fs->limbo[(ge+1)%3];
-	fs->limbo[(ge+1)%3] = nil;
-	unlock(&fs->freelk);
+	p = asetp(&fs->limbo[(ge+1)%3], nil);
 	asetl(&fs->epoch, (ge+1) % 3);
 
-
 	while(p != nil){
 		n = p->next;
 		cachedel(p->bp.addr);
@@ -1114,8 +1110,6 @@
 	for(i = 0; i < fs->nsyncers; i++){
 		b = cachepluck();
 		b->type = Tmagic;
-		lock(&fs->freelk);
-		unlock(&fs->freelk);
 		qput(&fs->syncq[i], b);
 	}
 	while(fs->syncing != 0)
--- a/dat.h
+++ b/dat.h
@@ -456,7 +456,6 @@
 	Chan	*rdchan;
 
 	int	nworker;
-	Lock	freelk;
 	vlong	qgen;
 	long	epoch;
 	long	lepoch[32];