code: mafs

Download patch

ref: 9be49bd8120c155951d92d97e15e77ba2bca28c7
parent: 36c7cf5b9f8cb397c35657ecf0d7278f8eb2967c
author: 9ferno <gophone2015@gmail.com>
date: Sun Oct 23 11:27:41 EDT 2022

cleanup obsolete files

--- a/tests/script.post
+++ /dev/null
@@ -1,26 +1,0 @@
-#!/bin/rc
-
-t=$1
-disk=$2
-nblocks=$3
-
-# check the contents
-for(b in `{seq 0 1 `{echo $nblocks ' 1 - p' | dc}}){
-	file=$t/blocks/^$b
-	test -f $file &&
-		@{ # to avoid warning: process exceeds 200 file descriptors
-			> /tmp/^$t^.out >[2]/tmp/^$t^.err \
-			diff <{grep -v '^mtime' $file} \
-				<{disk/block $disk $b | grep -v '^mtime'} ||
-			{
-				echo $file
-				cat /tmp/^$t^.out
-				cat /tmp/^$t^.err
-			}
-		}
-}
-rm /tmp/^$t^*
-
-# reconcile the used and free blocks
-echo reconcile $disk $nblocks
-disk/reconcile -u <{disk/used $disk} -F <{disk/free $disk} $nblocks
--- a/tests/test.0/script.setup
+++ /dev/null
@@ -1,3 +1,0 @@
-#!/bin/rc
-
-dd -if /dev/zero -of $1 -bs 512 -count $2
--- a/tests/test.1/script
+++ /dev/null
@@ -1,8 +1,0 @@
-#!/bin/rc
-
-# du -a /n/mafs_test.1/
-mkdir /n/mafs_test.1/dir1
-touch /n/mafs_test.1/dir1/file1
-echo test >> /n/mafs_test.1/dir1/file1
-
-cat /n/mafs_test.1/adm/ctl
--- a/tests/test.1/script.setup
+++ /dev/null
@@ -1,3 +1,0 @@
-#!/bin/rc
-
-dd -if /dev/zero -of $1 -bs 512 -count $2
--- a/tests/test.2/script
+++ /dev/null
@@ -1,21 +1,0 @@
-#!/bin/rc
-
-# du -a /n/mafs_test.2/
-
-for(t in 0 1 01 2 3 4 5 7){
-	touch /n/mafs_test.2/file1
-	echo ./6.offsets -s test.2/^$t^.start -o `{cat test.2/^$t^.offset} -a test.2/^$t^.add /n/mafs_test.2/file1
-	./6.offsets -s test.2/^$t^.start -o `{cat test.2/^$t^.offset} -a test.2/^$t^.add /n/mafs_test.2/file1
-	diff /n/mafs_test.2/file1 test.2/^$t^.end
-#	{
-#		cat /n/mafs_test.2/file1
-#		cat test.2/^$t^.end
-#	}
-	rm /n/mafs_test.2/file1
-}
-# 	touch /n/mafs_test.2/file1
-# ./6.offsets -s test.2/6.start -o 1124 -a test.2/6.add /n/mafs_test.2/file1 > test.2/6.end
-# 	ls -l /n/mafs_test.2/file1
-#	xd -c -b /n/mafs_test.2/file1
-# 	cp /n/mafs_test.2/file1 test.2/6.end
-#	rm /n/mafs_test.2/file1
--- a/tests/test.2/script.setup
+++ /dev/null
@@ -1,3 +1,0 @@
-#!/bin/rc
-
-dd -if /dev/zero -of $1 -bs 512 -count $2
--- a/tests/test.3/script
+++ /dev/null
@@ -1,29 +1,0 @@
-#!/bin/rc
-
-# ls -l /srv/ /n/
-fn dofile {
-	file=$"*
-	echo $file
-	time fcp -x test.3/^$file /n/mafs_test.3/
-	ls -ltr test.3/^$file /n/mafs_test.3/^$file
-	diff test.3/^$file /n/mafs_test.3/^$file # > /mnt/term/tmp/test.out
-	# tail /mnt/term/tmp/test.out
-	rm /n/mafs_test.3/^$file
-}
-
-# to build these files
-# dd -if big.file -of 94_blocks.file -bs 502 -count 94
-
-dofile 32_blocks.file
-dofile 33_blocks.file
-dofile 94_blocks.file
-dofile 95_blocks.file
-dofile 128_blocks.file
-dofile 1024_blocks.file
-dofile 2048_blocks.file
-dofile 4096_blocks.file
-dofile 8192_blocks.file
-dofile 16384_blocks.file
-# dofile big.file # cannot do this, not enough space for this.
-
-cat /n/mafs_test.3/adm/ctl
--- a/tests/test.3/script.setup
+++ /dev/null
@@ -1,4 +1,0 @@
-#!/bin/rc
-
-echo dd -if /dev/zero -of $1 -bs 512 -count $nblocks
-dd -if /dev/zero -of $1 -bs 512 -count $nblocks
--- a/tests/test.4/script
+++ /dev/null
@@ -1,6 +1,0 @@
-#!/bin/rc
-
-# ls -l /srv/ /n/
-mkdir /n/mafs_test.4/dir.0
-dircp test.4/dir.0 /n/mafs_test.4/dir.0
-# du -a /n/mafs_test.4/dir.0
--- a/tests/test.4/script.setup
+++ /dev/null
@@ -1,4 +1,0 @@
-#!/bin/rc
-
-echo dd -if /dev/zero -of $1 -bs 512 -count $nblocks
-dd -if /dev/zero -of $1 -bs 512 -count $nblocks
--- a/tests/test.5/script
+++ /dev/null
@@ -1,7 +1,0 @@
-#!/bin/rc
-
-# ls -l /srv/ /n/
-time fcp -x test.5/23.messages.gz /n/mafs_test.5/
-time fcp -x test.5/01.messages.gz /n/mafs_test.5/
-du -a /n/mafs_test.5
-ls -l test.5/23.messages.gz test.5/01.messages.gz /n/mafs_test.5/
--- a/tests/test.5/script.setup
+++ /dev/null
@@ -1,4 +1,0 @@
-#!/bin/rc
-
-echo dd -if /dev/zero -of $1 -bs 512 -count $nblocks
-dd -if /dev/zero -of $1 -bs 512 -count $nblocks
--- a/tests/test.6/script
+++ /dev/null
@@ -1,9 +1,0 @@
-#!/bin/rc
-
-# du -a /n/mafs_test.6/
-mkdir /n/mafs_test.6/dir1
-touch /n/mafs_test.6/dir1/file1
-echo test >> /n/mafs_test.6/dir1/file1
-
-cat /n/mafs_test.6/adm/ctl
-sleep 1
--- a/tests/test.6/script.setup
+++ /dev/null
@@ -1,3 +1,0 @@
-#!/bin/rc
-
-dd -if /dev/zero -of $1 -bs 512 -count $2
--- a/tests/test.7/script
+++ /dev/null
@@ -1,13 +1,0 @@
-#!/bin/rc
-
-# ls -l /srv/ /n/
-
-for(i in `{seq 1 1 10}){
-	time fcp -x test.7/16384_blocks.file /n/mafs_test.7/16384_blocks.file.^$i &
-}
-
-wait
-sleep 1
-ls -ltr test.7/16384_blocks.file /n/mafs_test.7/16384_blocks.file.*
-
-cat /n/mafs_test.7/adm/ctl
--- a/tests/test.7/script.post
+++ /dev/null
@@ -1,26 +1,0 @@
-#!/bin/rc
-
-t=$1
-disk=$2
-nblocks=$3
-
-# check the contents
-for(b in 0){
-	file=$t/blocks/^$b
-	test -f $file &&
-		@{ # to avoid warning: process exceeds 200 file descriptors
-			> /tmp/^$t^.out >[2]/tmp/^$t^.err \
-			diff <{grep -v '^mtime' $file} \
-				<{disk/block $disk $b | grep -v '^mtime'} ||
-			{
-				echo $file
-				cat /tmp/^$t^.out
-				cat /tmp/^$t^.err
-			}
-		}
-}
-rm /tmp/^$t^*
-
-# reconcile the used and free blocks
-echo reconcile $disk $nblocks
-disk/reconcile -u <{disk/used $disk} -F <{disk/free $disk} $nblocks
--- a/tests/test.7/script.setup
+++ /dev/null
@@ -1,4 +1,0 @@
-#!/bin/rc
-
-echo dd -if /dev/zero -of $1 -bs 512 -count $nblocks
-dd -if /dev/zero -of $1 -bs 512 -count $nblocks
--- a/tests/test.8/script.setup
+++ /dev/null
@@ -1,3 +1,0 @@
-#!/bin/rc
-
-dd -if /dev/zero -of $1 -bs 512 -count $2
--- a/tests/test.9/script
+++ /dev/null
@@ -1,24 +1,0 @@
-#!/bin/rc
-
-# du -a /n/mafs_test.9/
-
-mkdir /n/mafs_test.9/dir1
-touch /n/mafs_test.9/dir1/file1
-echo test >> /n/mafs_test.9/dir1/file1
-
-mkdir /n/mafs_test.9/dir2
-touch /n/mafs_test.9/dir2/file1
-echo test >> /n/mafs_test.9/dir2/file1
-touch /n/mafs_test.9/dir2/file2
-echo test >> /n/mafs_test.9/dir2/file2
-
-# 4096 blocks = 2MB
-mkdir /n/mafs_test.9/dir3
-time fcp -x test.9/2MB.file /n/mafs_test.9/dir3/
-
-# 25 MB file
-mkdir /n/mafs_test.9/dir4
-time fcp -x test.9/25MB.file /n/mafs_test.9/dir4/
-
-du -a /n/mafs_test.9/
-cat /n/mafs_test.9/adm/ctl
--- a/tests/test.9/script.setup
+++ /dev/null
@@ -1,3 +1,0 @@
-#!/bin/rc
-
-dd -if /dev/zero -of $1 -bs 512 -count $2
--- a/tests/test.a/script
+++ /dev/null
@@ -1,9 +1,0 @@
-#!/bin/rc
-
-time fcp -x test.a/big.file /n/mafs_test.a/
-ls -ltr test.a/big.file /n/mafs_test.a/big.file
-diff test.a/big.file /n/mafs_test.a/big.file # > /mnt/term/tmp/test.out
-# tail /mnt/term/tmp/test.out
-rm /n/mafs_test.a/big.file
-
-cat /n/mafs_test.a/adm/ctl
--- a/tests/test.a/script.post
+++ /dev/null
@@ -1,26 +1,0 @@
-#!/bin/rc
-
-t=$1
-disk=$2
-nblocks=$3
-
-# check the contents
-#for(b in `{seq 0 1 `{echo $nblocks ' 1 - p' | dc}}){
-#	file=$t/blocks/^$b
-#	test -f $file &&
-#		@{ # to avoid warning: process exceeds 200 file descriptors
-#			> /tmp/^$t^.out >[2]/tmp/^$t^.err \
-#			diff <{grep -v '^mtime' $file} \
-#				<{disk/block $disk $b | grep -v '^mtime'} ||
-#			{
-#				echo $file
-#				cat /tmp/^$t^.out
-#				cat /tmp/^$t^.err
-#			}
-#		}
-#}
-#rm /tmp/^$t^*
-
-# reconcile the used and free blocks
-# echo reconcile $disk $nblocks
-# disk/reconcile -u <{disk/used $disk} -F <{disk/free $disk} $nblocks
--- a/tests/test.a/script.setup
+++ /dev/null
@@ -1,4 +1,0 @@
-#!/bin/rc
-
-echo dd -if /dev/zero -of $1 -bs 512 -count $nblocks
-dd -if /dev/zero -of $1 -bs 512 -count $nblocks