git: 9front

Download patch

ref: a57422079c30773c0a631d398564e82137b2ac1a
parent: b6e966d03ba5e331dae9fae1b05a9f97f9a1e272
author: glenda <glenda@9front.local>
date: Mon Aug 8 12:16:45 EDT 2022

walk: include qid version in deduplication

the qid version is part of the qid, take it into account
for deduplication.

--- a/sys/src/cmd/walk.c
+++ b/sys/src/cmd/walk.c
@@ -307,10 +307,11 @@
 	int i;
 	Cache *c;
 
-	c = &cache[dir->qid.path&(NCACHE-1)];
+	c = &cache[(dir->qid.path^dir->qid.vers)&(NCACHE-1)];
 	dp = c->cache;
 	for(i=0; i<c->n; i++, dp++)
 		if(dir->qid.path == dp->qid.path &&
+		   dir->qid.vers == dp->qid.vers &&
 		   dir->type == dp->type &&
 		   dir->dev == dp->dev)
 			return 1;
--