ref: 7615f65bc0d2b2a212283dbb35ae67c857fba2c4
parent: 05ab79bb9078a65b4ac7ab0645a6857a18ccd372
author: BurnZeZ <devnull@localhost>
date: Sun Mar 29 13:39:30 EDT 2020
lib9p: fix re-use of root Qid when using createfile(); remove unused dirqidgen
--- a/sys/include/9p.h
+++ b/sys/include/9p.h
@@ -152,7 +152,6 @@
/* below is implementation-specific; don't use */
Lock genlock;
ulong qidgen;
- ulong dirqidgen;
};
Tree* alloctree(char*, char*, ulong, void(*destroy)(File*));
--- a/sys/src/lib9p/file.c
+++ b/sys/src/lib9p/file.c
@@ -337,8 +337,9 @@
incref(f);
t->root = f;
- t->qidgen = 0;
- t->dirqidgen = 1;
+
+ /* t->qidgen starts at 1 because root Qid.path is 0 */
+ t->qidgen = 1;
if(destroy == nil)
destroy = nop;
t->destroy = destroy;
--
⑨