shithub: gefs

Download patch

ref: 56ef20bc838039f49024bf5d09d5b610ac72bdde
parent: 5df01f8986e0256e7c5c0e657195892b3ca9daab
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Nov 5 16:34:30 EST 2023

check: remove debug print

--- a/check.c
+++ b/check.c
@@ -70,7 +70,6 @@
 				fprint(fd, "freed block in use: %llx\n", bp.addr);
 				fail++;
 			}
-print("get %B\n", bp);
 			if((c = getblk(bp, 0)) == nil){
 				fprint(fd, "corrupt block: %r\n");
 				fail++;
--- a/fs.c
+++ b/fs.c
@@ -82,7 +82,6 @@
 	closesnap(t);
 	unlock(&fs->mountlk);
 	/* we probably want explicit snapshots to get synced */
-	sync();
 	if(a->delete)
 		fprint(a->fd, "deleted: %s\n", a->old);
 	else if(a->mutable)
@@ -2240,6 +2239,7 @@
 				updatesnap(&mnt->root, mnt->root, mnt->name);
 			sync();
 			epochend(id);
+			epochclean();
 			qunlock(&fs->mutlk);
 
 			for(i = 0; i < fs->narena; i++){
@@ -2266,6 +2266,10 @@
 		case AOsnap:
 			qlock(&fs->mutlk);
 			epochstart(id);
+			for(mnt = fs->mounts; mnt != nil; mnt = mnt->next)
+				updatesnap(&mnt->root, mnt->root, mnt->name);
+			sync();
+
 			snapfs(am);
 			epochend(id);
 			qunlock(&fs->mutlk);
--- a/snap.c
+++ b/snap.c
@@ -282,6 +282,14 @@
 		 */
 		m.op = Odelete;
 		m.Kvp = s.kv;
+char *op;
+if(succ == -1)
+	op = "free";
+else if(dl.bgen > prev)
+	op = "clear";
+else
+	op = "merge";
+print("reclaim dlist (%lld,%lld): %s\n", dl.gen, dl.bgen, op);
 		if((e = btupsert(&fs->snap, &m, 1)) != nil)
 			break;
 		if(succ == -1)