ref: 5e9b16216e513f24883389ce48d25a72d3c48f0b
parent: f4efa27b0a01aa1a2ae6a8b8a070d03182354b4b
author: 9ferno <[email protected]>
date: Fri Nov 25 02:31:12 EST 2022
working tests
--- a/9p.c
+++ b/9p.c
@@ -59,6 +59,7 @@
fsdestroyfid(Fid *fid)
{
Tlock *t;
+ Iobuf *dbuf;
if((fid->qid.type & QTAUTH) != 0){
authdestroy(fid);
@@ -94,10 +95,10 @@
/* allocate on flush as many as possible */
dbuf = getmeta(((Aux*)fid->aux)->dblkno, Bwritable, Bused);
if(dbuf != nil){
- if(p->xiobuf != nil &&
- p->xiobuf[0] == Tdentry &&
- p->append != nil)
- flush(p);
+ if(dbuf->xiobuf != nil &&
+ dbuf->xiobuf[0] == Tdentry &&
+ dbuf->append != nil)
+ flush(dbuf);
else
putbuf(dbuf, 0);
}
--- a/tests/test.2/blocks/23
+++ b/tests/test.2/blocks/23
@@ -1,12 +1,51 @@
-Tdentry 71 35
+Tdentry 71 43
name file1
uid 10006
gid -1
muid 10006
-size 0
+size 1135
pdblkno 20
pqpath 20
-mtime 1669333591284727201
+mtime 1669384914528689089
path 71
version 0
mode 666
+direct blocks
+ 0 24
+ 1 0
+ 2 0
+ 3 0
+ 4 0
+ 5 0
+ 6 0
+ 7 0
+ 8 0
+ 9 0
+ 10 0
+ 11 0
+ 12 0
+ 13 0
+ 14 0
+ 15 0
+ 16 0
+ 17 0
+ 18 0
+ 19 0
+ 20 0
+ 21 0
+ 22 0
+ 23 0
+ 24 0
+ 25 0
+ 26 0
+ 27 0
+ 28 0
+ 29 0
+ 30 0
+ 31 0
+indirect blocks
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ 4 0
--- a/tests/test.2/blocks/24
+++ b/tests/test.2/blocks/24
@@ -1,1 +1,46 @@
-Tblank
+Tdata 71 22 3
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+0123456789
+01234567
\ No newline at end of file
--- a/tests/test.2/blocks/25
+++ /dev/null
@@ -1,1 +1,0 @@
-Tblank
--- a/tests/test.2/blocks/26
+++ /dev/null
@@ -1,1 +1,0 @@
-Tblank
--- a/tests/test.9/blocks/21
+++ b/tests/test.9/blocks/21
@@ -6,7 +6,7 @@
size 0
pdblkno 0
pqpath 0
-mtime 1669339401174675504
+mtime 1669386818836723628
path 20
version 0
mode 20000000777
@@ -15,7 +15,7 @@
1 22
2 26
3 32
- 4 2084
+ 4 4166
5 0
6 0
7 0
--- a/tests/test.9/blocks/34
+++ b/tests/test.9/blocks/34
@@ -1,9 +1,9 @@
-Tdentry 70 4
+Tdentry 70 6
name 2MB.file
uid 10006
gid -1
muid 10006
-size 1048548
+size 2056192
pdblkno 32
pqpath 69
mtime 1665294406000000000
@@ -12,7 +12,7 @@
mode 664
direct blocks
0 36
- 1 0
+ 1 2084
2 0
3 0
4 0
--- a/tests/test.9/blocks/35
+++ b/tests/test.9/blocks/35
@@ -3,7 +3,7 @@
uid 10006
gid -1
muid 10006
-size 2056192
+size 1048548
pdblkno 32
pqpath 69
mtime 1665294406000000000
@@ -12,7 +12,7 @@
mode 664
direct blocks
0 36
- 1 41000
+ 1 0
2 0
3 0
4 0