code: mafs

Download patch

ref: 2901cca1c4c7f126c1bdf6fa38b85854767b7e18
parent: 5076a214bf64da3c52f49e242003d91a17940308
author: 9ferno <gophone2015@gmail.com>
date: Wed Oct 19 11:23:57 EDT 2022

added test.d

diff: cannot open b/tests/test.d/blocks//null: file does not exist: 'b/tests/test.d/blocks//null' diff: cannot open b/tests/test.d//null: file does not exist: 'b/tests/test.d//null'
--- /dev/null
+++ b/tests/test.d/action.rc
@@ -1,0 +1,5 @@
+#!/bin/rc
+
+mkdir -p /n/mafs_test.c/a/b/c/d/e/f/g
+du -a /n/mafs_test.c/
+cat /n/mafs_test.c/adm/ctl
--- /dev/null
+++ b/tests/test.d/blocks/0
@@ -1,0 +1,4 @@
+Tmagic 1 1
+mafs device
+512
+1048564
--- /dev/null
+++ b/tests/test.d/blocks/1
@@ -1,0 +1,7 @@
+Tdata 1 2
+size 16384
+nblocks 32
+backup config 1 to 31 24
+backup super 2 to 30 23
+backup root 3 to 29 22
+service mafs_test.c
--- /dev/null
+++ b/tests/test.d/blocks/10
@@ -1,0 +1,42 @@
+Tdentry 1 8
+qid.version 0
+qid.path 8
+size 500
+pdblkno 9
+pqpath 7
+mtime 1653219675351539603
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 31 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name config.0
--- /dev/null
+++ b/tests/test.d/blocks/11
@@ -1,0 +1,42 @@
+Tdentry 1 9
+qid.version 0
+qid.path 9
+size 500
+pdblkno 9
+pqpath 7
+mtime 1653219675351740745
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 30 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name super.0
--- /dev/null
+++ b/tests/test.d/blocks/12
@@ -1,0 +1,42 @@
+Tdentry 1 10
+qid.version 0
+qid.path 10
+size 500
+pdblkno 9
+pqpath 7
+mtime 1653219675351939374
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 29 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name root.0
--- /dev/null
+++ b/tests/test.d/blocks/13
@@ -1,0 +1,42 @@
+Tdentry 1 11
+qid.version 0
+qid.path 11
+size 500
+pdblkno 9
+pqpath 7
+mtime 1653219675352137164
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 24 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name config.1
--- /dev/null
+++ b/tests/test.d/blocks/14
@@ -1,0 +1,42 @@
+Tdentry 1 12
+qid.version 0
+qid.path 12
+size 500
+pdblkno 9
+pqpath 7
+mtime 1653219675352337469
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 23 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name super.1
--- /dev/null
+++ b/tests/test.d/blocks/15
@@ -1,0 +1,42 @@
+Tdentry 1 13
+qid.version 0
+qid.path 13
+size 500
+pdblkno 9
+pqpath 7
+mtime 1653219675352541126
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 22 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name root.1
--- /dev/null
+++ b/tests/test.d/blocks/16
@@ -1,0 +1,42 @@
+Tdentry 1 14
+qid.version 0
+qid.path 14
+size 0
+pdblkno 4
+pqpath 5
+mtime 1653219675350736707
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 0 0
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name ctl
--- /dev/null
+++ b/tests/test.d/blocks/17
@@ -1,0 +1,42 @@
+Tdentry 1 15
+qid.version 0
+qid.path 15
+size 10
+pdblkno 4
+pqpath 5
+mtime 1665241420136494979
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 28 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name frees
--- /dev/null
+++ b/tests/test.d/blocks/18
@@ -1,0 +1,42 @@
+Tdentry 1 64
+qid.version 0
+qid.path 64
+size 0
+pdblkno 3
+pqpath 63
+mtime 1665241662656879014
+mode 20000000777
+uid 10006
+gid -1
+muid 10006
+direct spans
+	0 19 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name a
--- /dev/null
+++ b/tests/test.d/blocks/19
@@ -1,0 +1,42 @@
+Tdentry 1 65
+qid.version 0
+qid.path 65
+size 0
+pdblkno 18
+pqpath 64
+mtime 1665241662667052180
+mode 20000000777
+uid 10006
+gid -1
+muid 10006
+direct spans
+	0 20 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name b
--- /dev/null
+++ b/tests/test.d/blocks/2
@@ -1,0 +1,6 @@
+Tdata 1 3
+start 0
+tfree 0
+qidgen 71
+frees 0
+fsok 1
--- /dev/null
+++ b/tests/test.d/blocks/20
@@ -1,0 +1,42 @@
+Tdentry 1 66
+qid.version 0
+qid.path 66
+size 0
+pdblkno 19
+pqpath 65
+mtime 1665746544536952697
+mode 20000000777
+uid 10006
+gid -1
+muid 10006
+direct spans
+	0 21 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name c
--- /dev/null
+++ b/tests/test.d/blocks/21
@@ -1,0 +1,42 @@
+Tdentry 1 67
+qid.version 0
+qid.path 67
+size 0
+pdblkno 20
+pqpath 66
+mtime 1665746126741347088
+mode 20000000777
+uid 10006
+gid -1
+muid 10006
+direct spans
+	0 25 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name d
--- /dev/null
+++ b/tests/test.d/blocks/22
@@ -1,0 +1,1 @@
+Tdata 1 13
--- /dev/null
+++ b/tests/test.d/blocks/23
@@ -1,0 +1,6 @@
+Tdata 1 12
+start 0
+tfree 0
+qidgen 71
+frees 0
+fsok 1
--- /dev/null
+++ b/tests/test.d/blocks/24
@@ -1,0 +1,7 @@
+Tdata 1 11
+size 16384
+nblocks 32
+backup config 1 to 31 24
+backup super 2 to 30 23
+backup root 3 to 29 22
+service mafs_test.c
--- /dev/null
+++ b/tests/test.d/blocks/29
@@ -1,0 +1,1 @@
+Tdata 1 10
--- /dev/null
+++ b/tests/test.d/blocks/3
@@ -1,0 +1,42 @@
+Tdentry 1 63
+qid.version 0
+qid.path 63
+size 0
+pdblkno 0
+pqpath 0
+mtime 1653238116207474527
+mode 20000000777
+uid -1
+gid -1
+muid -1
+direct spans
+	0 4 1
+	1 18 1
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name /
--- /dev/null
+++ b/tests/test.d/blocks/30
@@ -1,0 +1,6 @@
+Tdata 1 9
+start 0
+tfree 0
+qidgen 71
+frees 0
+fsok 1
--- /dev/null
+++ b/tests/test.d/blocks/31
@@ -1,0 +1,7 @@
+Tdata 1 8
+size 16384
+nblocks 32
+backup config 1 to 31 24
+backup super 2 to 30 23
+backup root 3 to 29 22
+service mafs_test.c
--- /dev/null
+++ b/tests/test.d/blocks/4
@@ -1,0 +1,42 @@
+Tdentry 1 5
+qid.version 0
+qid.path 5
+size 0
+pdblkno 3
+pqpath 63
+mtime 1653220058258327306
+mode 20000000777
+uid -1
+gid -1
+muid -1
+direct spans
+	0 9 1
+	1 5 1
+	2 16 1
+	3 6 1
+	4 7 1
+	5 17 1
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name adm
--- /dev/null
+++ b/tests/test.d/blocks/5
@@ -1,0 +1,42 @@
+Tdentry 1 2
+qid.version 0
+qid.path 2
+size 0
+pdblkno 4
+pqpath 5
+mtime 1653220058259129363
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 1 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name config
--- /dev/null
+++ b/tests/test.d/blocks/6
@@ -1,0 +1,42 @@
+Tdentry 1 3
+qid.version 0
+qid.path 3
+size 0
+pdblkno 4
+pqpath 5
+mtime 1653220058266642885
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 2 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name super
--- /dev/null
+++ b/tests/test.d/blocks/7
@@ -1,0 +1,42 @@
+Tdentry 1 6
+qid.version 0
+qid.path 6
+size 126
+pdblkno 4
+pqpath 5
+mtime 1653220058266842352
+mode 444
+uid -1
+gid -1
+muid -1
+direct spans
+	0 8 1
+	1 0 0
+	2 0 0
+	3 0 0
+	4 0 0
+	5 0 0
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name users
--- /dev/null
+++ b/tests/test.d/blocks/8
@@ -1,0 +1,9 @@
+Tdata 1 6
+-1:adm:adm:
+0:none:adm:
+9999:noworld::
+10000:sys::
+10001:upas:upas:
+10002:bootes:bootes:
+10006:glenda:glenda:
+10007:manies::
--- /dev/null
+++ b/tests/test.d/blocks/9
@@ -1,0 +1,42 @@
+Tdentry 1 7
+qid.version 0
+qid.path 7
+size 126
+pdblkno 4
+pqpath 5
+mtime 1653220058258873744
+mode 20000000777
+uid -1
+gid -1
+muid -1
+direct spans
+	0 10 1
+	1 11 1
+	2 12 1
+	3 13 1
+	4 14 1
+	5 15 1
+	6 0 0
+	7 0 0
+	8 0 0
+	9 0 0
+	10 0 0
+	11 0 0
+	12 0 0
+	13 0 0
+	14 0 0
+	15 0 0
+	16 0 0
+	17 0 0
+	18 0 0
+	19 0 0
+	20 0 0
+	21 0 0
+	22 0 0
+	23 0 0
+indirect blocks
+	0 0
+	1 0
+	2 0
+	3 0
+name bkp
--- /dev/null
+++ b/tests/test.d/notes
@@ -1,0 +1,43 @@
+Creates a disk of 32 blocks. Unmarked blocks are filled from /dev/random.
+
+Duplicate of test.2 but seeded with random data.
+
+test mkdir -p a/b/c/d/e/f/g/h
+
+block	- description
+0		- magic
+1		- config
+2		- super block
+3		- / direntry
+4		- /adm/ dir entry
+5		- /adm/config dir entry
+6		- /adm/super dir entry
+7		- /adm/users dir entry
+8		- /adm/users contents
+9		- /adm/bkp/ dir entry
+10	- /adm/bkp/config.0 dir entry
+11	- /adm/bkp/super.0 dir entry
+12	- /adm/bkp/root.0 dir entry
+13	- /adm/bkp/config.1 dir entry
+14	- /adm/bkp/super.1 dir entry
+15	- /adm/bkp/root.1 dir entry
+16	- /adm/ctl dir entry -- virtual file, empty contents
+17	- /adm/frees dir entry
+
+18	- /dir1 directory entry
+19	- /dir1/file1 directory entry
+20	- /dir1/file1 contents
+21	- /adm/frees contents
+
+22	- / direntry
+23	- super block
+24	- config
+
+25
+26
+27
+28
+
+29	- / direntry
+30	- super block
+31	- config
--- /dev/null
+++ b/tests/test.d/params
@@ -1,0 +1,1 @@
+nblocks=32
--- /dev/null
+++ b/tests/test.d/setup.rc
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+dd -if /dev/random -of $1 -bs 512 -count $2