ref: 4603358d8af4005798b1ef4d7c50e61c3d501302
parent: f242ed181ff7118392737a3493e840aed9de4be1
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jan 3 17:47:32 EST 2025
sync
--- a/freplay.c
+++ b/freplay.c
@@ -171,8 +171,9 @@
sysfatal("open %s: %r", argv[0]);
if((d = dirfstat(fd)) == nil)
sysfatal("failed to stat file: %r");
- if((membuf = sbrk(d->length)) == nil)
+ if((membuf = sbrk(d->length)) == (void*)-1)
sysfatal("failed to allocate buffer: %r");
+ d->length -= (d->length % IOUNIT);
memset(membuf, 0, d->length);
for(off = 0; off < d->length; off += n)
if((n = read(fd, membuf+off, IOUNIT)) <= 0)
--- a/fsbench.c
+++ b/fsbench.c
@@ -3,13 +3,13 @@
#include <libsec.h>
#include <thread.h>
-int mainstacksize = 2*1024*1024;
+int mainstacksize = 64*1024*1024;
typedef struct Bench Bench;
enum {
KiB = 1024ULL,
MiB = 1024ULL*KiB,
GiB = 1024ULL*MiB,
- Bufsz = IOUNIT,
+ Bufsz = 128*IOUNIT,
};
enum {
--- a/mkfile
+++ b/mkfile
@@ -3,8 +3,9 @@
TESTS=\
basic\
build\
+ files\
-all:V: 6.freplay 6.fsbench
+all:V: 6.freplay 6.fsbench 6.files
test:VQ:
@{cd .. && mk 6.out}
--- a/run.rc
+++ b/run.rc
@@ -1,6 +1,6 @@
#!/bin/rc
-rfork ne
+rfork e
dev=$testdev
if(~ $#testdev 0)
@@ -26,11 +26,11 @@
}
fn ge_ream {
- $O.out -m 512 -r $user -f $1
+ gefs -m 512 -r $user -f $1
}
fn ge_start {
- $O.out -m 512 -A -f $1 -n gefs.test
+ gefs -m 512 -A -f $1 -n gefs.test
while(! test -e /srv/gefs.test)
sleep 0.1
mount -c /srv/gefs.test /n/gefs
@@ -37,7 +37,7 @@
}
fn ge_kill {
- kill $O.out | rc
+ kill gefs | rc
while(test -e /srv/gefs.test)
sleep 0.1
}
@@ -48,7 +48,7 @@
ge_ream $dev
log preparing replay...
rm -f replay.log
- test/6.freplay -l replay.log $dev
+ $O.freplay -l replay.log $dev
ge_start /mnt/replay/data
$*
echo save trace /tmp/trace >> /srv/gefs.test.cmd
@@ -63,9 +63,9 @@
# check blockwise consistency
log starting replay...
- test/6.freplay -c 1 -r replay.log $dev
+ $O.freplay -c 1 -r replay.log $dev
for(i in `{seq 2 $count}){
- $O.out -c -f /mnt/replay/data >[2]/tmp/log || die 'broken'
+ gefs -c -f /mnt/replay/data >[2]/tmp/log || die 'broken'
log stepping $i...
echo step > /mnt/replay/ctl
}
@@ -80,12 +80,12 @@
log reaming...
ge_ream $dev
log preparing build-and-verify...
- test/6.freplay -l replay.log $dev
+ $O.freplay -l replay.log $dev
ge_start $dev
$*
echo save trace /tmp/trace >> /srv/gefs.test.cmd
ge_kill
- $O.out -c -f $dev
+ gefs -c -f $dev
}}
fn buildsys{@{
@@ -97,6 +97,7 @@
bind -c $objtype/lib /$objtype/lib
bind -c plan9front/sys/include /sys/include
bind -c tmp /tmp
+ bind -c plan9front/sys/src /sys/src
cd plan9front/sys/src
mk clean >> /tmp/gefsbuild.log
mk all >> /tmp/gefsbuild.log
@@ -175,10 +176,9 @@
dd -if /dev/zero -of $dev -bs 1kk -count 2k
rm -f /srv/gefs.test /srv/gefs.test.cmd /srv/replay
mk all
-@{cd test && mk all}
dotest ge_replay frobsnap
-dotest ge_replay buildgefs_slowrep 50
+dotest ge_replay buildgefs_slowrep 150
dotest ge_ok buildsys
dotest ge_ok fillfs