Initial Spring 2016 commit.

This commit is contained in:
Geoffrey Challen
2015-12-23 00:50:04 +00:00
commit cafa9f5690
732 changed files with 92195 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Makefile for frack
TOP=../../..
.include "$(TOP)/mk/os161.config.mk"
PROG=frack
SRCS=main.c workloads.c ops.c do.c check.c pool.c data.c name.c
BINDIR=/testbin
.include "$(TOP)/mk/os161.prog.mk"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
int check_createfile(unsigned name);
int check_openfile(unsigned name);
void check_closefile(int handle, unsigned name);
void check_write(int handle, unsigned name, unsigned code, unsigned seq,
off_t pos, off_t len);
void check_truncate(int handle, unsigned name, off_t len);
void check_mkdir(unsigned name);
void check_rmdir(unsigned name);
void check_unlink(unsigned name);
void check_link(unsigned from, unsigned to);
void check_rename(unsigned from, unsigned to);
void check_renamexd(unsigned fromdir, unsigned from,
unsigned todir, unsigned to);
void check_chdir(unsigned name);
void check_chdirup(void);
void check_sync(void);
void check_setup(void);
void checkfs(void);

View File

@@ -0,0 +1,227 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "data.h"
/*
* XXX for now hardwire things we know about SFS
*/
#define BLOCKSIZE /*SFS_BLOCKSIZE*/ 512
static char databuf[DATA_MAXSIZE];
static char readbuf[DATA_MAXSIZE];
static
void
prepdata(unsigned code, unsigned seq, char *buf, off_t len)
{
char smallbuf[32];
char letter;
size_t slen;
snprintf(smallbuf, sizeof(smallbuf), "%u@%u\n", seq, code);
slen = strlen(smallbuf);
while (len >= slen) {
memcpy(buf, smallbuf, slen);
buf += slen;
len -= slen;
}
if (len > 1) {
letter = 'A' + (code + seq) % 26;
memset(buf, letter, len - 1);
buf += len - 1;
}
if (len > 0) {
*buf = '\n';
}
}
static
int
matches_at(size_t start, size_t len)
{
if (!memcmp(databuf + start, readbuf + start, len)) {
return 1;
}
return 0;
}
static
int
byte_at(size_t start, size_t len, unsigned char val)
{
size_t i;
for (i=0; i<len; i++) {
if ((unsigned char)readbuf[start + i] != val) {
return 0;
}
}
return 1;
}
static
int
zero_at(size_t start, size_t len)
{
return byte_at(start, len, 0);
}
static
int
poison_at(size_t start, size_t len)
{
return byte_at(start, len, POISON_VAL);
}
/*
* Check if the data found in the read buffer matches what should be
* there.
* NAMESTR is the name of the file, for error reporting.
* REGIONOFFSET is where the write region began.
* CODE and SEQ are the keys for generating the expected data.
* ZEROSTART is the first offset into the write region at which the
* data "can" be zeros instead.
* LEN is the length of the write.
* CHECKSTART is the offset into the write region where we begin checking.
* CHECKLEN is the length of the region we check.
*/
int
data_matches(const char *namestr, off_t regionoffset,
unsigned code, unsigned seq, off_t zerostart, off_t len,
off_t checkstart, off_t checklen)
{
int ret;
off_t where;
size_t howmuch;
off_t absend, slop;
assert(len <= DATA_MAXSIZE);
assert(checklen > 0);
assert(checklen <= len);
assert(checkstart >= 0 && checkstart < len);
assert(checkstart + checklen <= len);
assert(zerostart >= 0);
assert(zerostart <= len);
prepdata(code, seq, databuf, len);
ret = 1;
while (checklen > 0) {
/* check one block at a time */
where = checkstart;
howmuch = BLOCKSIZE;
/* no more than is left to do */
if (howmuch > checklen) {
howmuch = checklen;
}
/* if we stick over a block boundary, stop there */
absend = regionoffset + where + howmuch;
slop = absend % BLOCKSIZE;
if (slop != 0 && slop < howmuch) {
howmuch -= slop;
}
/* if we go past the zerostart point, stop there */
if (where < zerostart && where + howmuch > zerostart) {
howmuch = zerostart - where;
}
assert(howmuch > 0);
if (matches_at(where, howmuch)) {
/* nothing */
}
else if (zero_at(where, howmuch)) {
if (where >= zerostart) {
printf("WARNING: file %s range %lld-%lld is "
"zeroed\n",
namestr, regionoffset + where,
regionoffset + where + howmuch);
}
else {
ret = 0;
}
}
else if (poison_at(where, howmuch)) {
if (where >= zerostart) {
printf("ERROR: file %s range %lld-%lld is "
"poisoned\n",
namestr, regionoffset + where,
regionoffset + where + howmuch);
}
else {
ret = 0;
}
}
else {
ret = 0;
}
checkstart += howmuch;
checklen -= howmuch;
}
return ret;
}
void
data_check(const char *namestr, off_t regionoffset,
unsigned code, unsigned seq, off_t zerostart, off_t len,
off_t checkstart, off_t checklen)
{
assert(zerostart >= 0);
assert(zerostart <= len);
if (!data_matches(namestr, regionoffset,
code, seq, zerostart, len, checkstart, checklen)) {
printf("ERROR: file %s range %lld-%lld contains garbage\n",
namestr, regionoffset + checkstart,
regionoffset + checkstart + checklen);
}
}
void *
data_map(unsigned code, unsigned seq, off_t len)
{
assert(len <= DATA_MAXSIZE);
prepdata(code, seq, databuf, len);
return databuf;
}
void *
data_mapreadbuf(off_t len)
{
assert(len <= DATA_MAXSIZE);
return readbuf;
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
void *data_map(unsigned code, unsigned seq, off_t len);
void *data_mapreadbuf(off_t len);
int data_matches(const char *namestr, off_t regionoffset,
unsigned code, unsigned seq, off_t zerostart, off_t len,
off_t checkstart, off_t checklen);
void data_check(const char *namestr, off_t regionoffset,
unsigned code, unsigned seq, off_t zerostart, off_t len,
off_t checkstart, off_t checklen);
#define DATA_MAXSIZE 65536
#define POISON_VAL 0xa9

251
userland/testbin/frack/do.c Normal file
View File

@@ -0,0 +1,251 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <err.h>
#include "data.h"
#include "name.h"
#include "do.h"
int
do_opendir(unsigned name)
{
const char *namestr;
int fd;
namestr = name_get(name);
fd = open(namestr, O_RDONLY);
if (fd < 0) {
err(1, "%s: opendir", namestr);
}
return fd;
}
void
do_closedir(int fd, unsigned name)
{
if (close(fd)) {
warn("%s: closedir", name_get(name));
}
}
int
do_createfile(unsigned name)
{
const char *namestr;
int fd;
namestr = name_get(name);
fd = open(namestr, O_WRONLY|O_CREAT|O_EXCL, 0664);
if (fd < 0) {
err(1, "%s: create", namestr);
}
printf("create %s\n", namestr);
return fd;
}
int
do_openfile(unsigned name, int dotrunc)
{
const char *namestr;
int fd;
namestr = name_get(name);
fd = open(namestr, O_WRONLY | (dotrunc ? O_TRUNC : 0), 0664);
if (fd < 0) {
err(1, "%s: open", namestr);
}
return fd;
}
void
do_closefile(int fd, unsigned name)
{
if (close(fd)) {
warn("%s: close", name_get(name));
}
}
void
do_write(int fd, unsigned name, unsigned code, unsigned seq,
off_t pos, off_t len)
{
off_t done = 0;
ssize_t ret;
char *buf;
const char *namestr;
namestr = name_get(name);
buf = data_map(code, seq, len);
if (lseek(fd, pos, SEEK_SET) == -1) {
err(1, "%s: lseek to %lld", name_get(name), pos);
}
while (done < len) {
ret = write(fd, buf + done, len - done);
if (ret == -1) {
err(1, "%s: write %lld at %lld", name_get(name),
len, pos);
}
done += ret;
}
printf("write %s: %lld at %lld\n", namestr, len, pos);
}
void
do_truncate(int fd, unsigned name, off_t len)
{
const char *namestr;
namestr = name_get(name);
if (ftruncate(fd, len) == -1) {
err(1, "%s: truncate to %lld", namestr, len);
}
printf("truncate %s: to %lld\n", namestr, len);
}
void
do_mkdir(unsigned name)
{
const char *namestr;
namestr = name_get(name);
if (mkdir(namestr, 0775) == -1) {
err(1, "%s: mkdir", namestr);
}
printf("mkdir %s\n", namestr);
}
void
do_rmdir(unsigned name)
{
const char *namestr;
namestr = name_get(name);
if (rmdir(namestr) == -1) {
err(1, "%s: rmdir", namestr);
}
printf("rmdir %s\n", namestr);
}
void
do_unlink(unsigned name)
{
const char *namestr;
namestr = name_get(name);
if (remove(namestr) == -1) {
err(1, "%s: remove", namestr);
}
printf("remove %s\n", namestr);
}
void
do_link(unsigned from, unsigned to)
{
const char *fromstr, *tostr;
fromstr = name_get(from);
tostr = name_get(to);
if (link(fromstr, tostr) == -1) {
err(1, "link %s to %s", fromstr, tostr);
}
printf("link %s %s\n", fromstr, tostr);
}
void
do_rename(unsigned from, unsigned to)
{
const char *fromstr, *tostr;
fromstr = name_get(from);
tostr = name_get(to);
if (rename(fromstr, tostr) == -1) {
err(1, "rename %s to %s", fromstr, tostr);
}
printf("rename %s %s\n", fromstr, tostr);
}
void
do_renamexd(unsigned fromdir, unsigned from, unsigned todir, unsigned to)
{
char frombuf[64];
char tobuf[64];
strcpy(frombuf, name_get(fromdir));
strcat(frombuf, "/");
strcat(frombuf, name_get(from));
strcpy(tobuf, name_get(todir));
strcat(tobuf, "/");
strcat(tobuf, name_get(to));
if (rename(frombuf, tobuf) == -1) {
err(1, "rename %s to %s", frombuf, tobuf);
}
printf("rename %s %s\n", frombuf, tobuf);
}
void
do_chdir(unsigned name)
{
const char *namestr;
namestr = name_get(name);
if (chdir(namestr) == -1) {
err(1, "chdir: %s", namestr);
}
printf("chdir %s\n", namestr);
}
void
do_chdirup(void)
{
if (chdir("..") == -1) {
err(1, "chdir: ..");
}
printf("chdir ..\n");
}
void
do_sync(void)
{
if (sync()) {
warn("sync");
}
printf("sync\n");
printf("----------------------------------------\n");
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
int do_opendir(unsigned name);
void do_closedir(int handle, unsigned name);
int do_createfile(unsigned name);
int do_openfile(unsigned name, int dotrunc);
void do_closefile(int handle, unsigned name);
void do_write(int handle, unsigned name, unsigned code, unsigned seq,
off_t pos, off_t len);
void do_truncate(int handle, unsigned name, off_t len);
void do_mkdir(unsigned name);
void do_rmdir(unsigned name);
void do_unlink(unsigned name);
void do_link(unsigned from, unsigned to);
void do_rename(unsigned from, unsigned to);
void do_renamexd(unsigned fromdir, unsigned from, unsigned todir, unsigned to);
void do_chdir(unsigned name);
void do_chdirup(void);
void do_sync(void);

View File

@@ -0,0 +1,196 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "workloads.h"
#include "main.h"
struct workload {
const char *name;
const char *argname;
union {
void (*witharg)(const char *);
void (*noarg)(void);
} run;
};
#define WL(n) { .name = #n, .argname = NULL, .run.noarg = wl_##n }
#define WLA(n,a) { .name = #n, .argname = #a, .run.witharg = wl_##n }
static const struct workload workloads[] = {
WLA(createwrite, size),
WLA(rewrite, size),
WLA(randupdate, size),
WLA(truncwrite, size),
WLA(makehole, size),
WLA(fillhole, size),
WLA(truncfill, size),
WLA(append, size),
WLA(trunczero, size),
WLA(trunconeblock, size),
WLA(truncsmallersize, size),
WLA(trunclargersize, size),
WLA(appendandtrunczero, size),
WLA(appendandtruncpartly, size),
WL(mkfile),
WL(mkdir),
WL(mkmanyfile),
WL(mkmanydir),
WL(mktree),
WLA(mkrandtree, seed),
WL(rmfile),
WL(rmdir),
WL(rmfiledelayed),
WL(rmfiledelayedappend),
WL(rmdirdelayed),
WL(rmmanyfile),
WL(rmmanyfiledelayed),
WL(rmmanyfiledelayedandappend),
WL(rmmanydir),
WL(rmmanydirdelayed),
WL(rmtree),
WLA(rmrandtree, seed),
WL(linkfile),
WL(linkmanyfile),
WL(unlinkfile),
WL(unlinkmanyfile),
WL(linkunlinkfile),
WL(renamefile),
WL(renamedir),
WL(renamesubtree),
WL(renamexdfile),
WL(renamexddir),
WL(renamexdsubtree),
WL(renamemanyfile),
WL(renamemanydir),
WL(renamemanysubtree),
WL(copyandrename),
WL(untar),
WL(compile),
WL(cvsupdate),
WLA(writefileseq, seed),
WLA(writetruncseq, seed),
WLA(mkrmseq, seed),
WLA(linkunlinkseq, seed),
WLA(renameseq, seed),
WLA(diropseq, seed),
WLA(genseq, seed),
};
static const unsigned numworkloads = sizeof(workloads) / sizeof(workloads[0]);
#undef WL
#undef WLA
static
const struct workload *
findworkload(const char *name)
{
unsigned i;
for (i=0; i<numworkloads; i++) {
if (!strcmp(workloads[i].name, name)) {
return &workloads[i];
}
}
return NULL;
}
static
void
printworkloads(void)
{
unsigned i;
printf("Supported workloads:\n");
for (i=0; i<numworkloads; i++) {
printf(" %s", workloads[i].name);
if (workloads[i].argname) {
printf(" %s", workloads[i].argname);
}
printf("\n");
}
}
int
main(int argc, char *argv[])
{
const char *workloadname;
const struct workload *workload;
int checkmode = 0;
if (argc == 2 && !strcmp(argv[1], "list")) {
printworkloads();
exit(0);
}
if (argc < 3) {
warnx("Usage: %s do|check workload [arg]", argv[0]);
warnx("Use \"list\" for a list of workloads");
exit(1);
}
if (!strcmp(argv[1], "do")) {
checkmode = 0;
}
else if (!strcmp(argv[1], "check")) {
checkmode = 1;
}
else {
errx(1, "Action must be \"do\" or \"check\"");
}
workloadname = argv[2];
workload = findworkload(workloadname);
if (workload == NULL) {
errx(1, "Unknown workload %s\n", workloadname);
printworkloads();
exit(1);
}
setcheckmode(checkmode);
if (workload->argname) {
if (argc != 4) {
errx(1, "%s requires argument %s\n",
workloadname, workload->argname);
}
workload->run.witharg(argv[3]);
}
else {
if (argc != 3) {
errx(1, "Stray argument for workload %s",workloadname);
}
workload->run.noarg();
}
complete();
return 0;
}

View File

@@ -0,0 +1,32 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
void setcheckmode(int checkmode);
void complete(void);

View File

@@ -0,0 +1,93 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <string.h>
#include <assert.h>
#include <err.h>
#include "name.h"
#define MAXNAMES 32
static const char *const names[MAXNAMES] = {
"allspice",
"anise",
"basil",
"cardamom",
"cayenne",
"cilantro",
"cinnamon",
"cloves",
"coriander",
"cumin",
"dill",
"fennel",
"fenugreek",
"galangal",
"ginger",
"horseradish",
"lemongrass",
"licorice",
"mace",
"marjoram",
"mustard",
"nutmeg",
"oregano",
"parsley",
"paprika",
"pepper",
"saffron",
"sage",
"rosemary",
"thyme",
"turmeric",
"wasabi",
};
const char *
name_get(unsigned name)
{
assert(name < MAXNAMES);
return names[name];
}
unsigned
name_find(const char *namestr)
{
unsigned i;
for (i=0; i<MAXNAMES; i++) {
if (!strcmp(namestr, names[i])) {
return i;
}
}
errx(1, "Encountered unknown/unexpected name %s", namestr);
return 0;
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
const char *name_get(unsigned name);
unsigned name_find(const char *namestr);

View File

@@ -0,0 +1,315 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <stdint.h>
#include <unistd.h>
#include <assert.h>
#include <err.h>
#include "pool.h"
#include "data.h"
#include "do.h"
#include "check.h"
#include "ops.h"
#include "main.h"
struct file {
unsigned name;
unsigned testcode;
unsigned seq;
int handle;
};
struct dir {
unsigned name;
int handle;
};
static int checkmode;
void
setcheckmode(int mode)
{
checkmode = mode;
if (checkmode) {
check_setup();
}
}
////////////////////////////////////////////////////////////
// open directories
#define MAXDIRS 32
DECLPOOL(dir, MAXDIRS);
struct dir *
op_opendir(unsigned name)
{
struct dir *ret;
ret = POOLALLOC(dir);
ret->name = name;
if (checkmode) {
ret->handle = -1;
}
else {
ret->handle = do_opendir(name);
}
return ret;
}
void
op_closedir(struct dir *d)
{
if (checkmode) {
/* nothing */
(void)d;
}
else {
do_closedir(d->handle, d->name);
}
POOLFREE(dir, d);
}
////////////////////////////////////////////////////////////
// files
#define MAXFILES 32
DECLPOOL(file, MAXFILES);
struct file *
op_open(unsigned testcode, unsigned name, unsigned openflags)
{
struct file *ret;
int dotrunc;
if (openflags == O_TRUNC) {
openflags = 0;
dotrunc = 1;
}
else {
dotrunc = 0;
}
assert(openflags == 0 || openflags == (O_CREAT|O_EXCL));
ret = POOLALLOC(file);
ret->name = name;
ret->testcode = testcode;
ret->seq = 0;
if (checkmode) {
if (openflags) {
ret->handle = check_createfile(name);
}
else {
ret->handle = check_openfile(name);
}
}
else {
if (openflags) {
assert(dotrunc == 0);
ret->handle = do_createfile(name);
}
else {
/*
* XXX: as of 2013 OS/161 doesn't provide a
* truncate call - neither truncate() nor
* ftruncate()! You can only O_TRUNC. Oops...
*/
ret->handle = do_openfile(name, dotrunc);
dotrunc = 0;
}
}
if (dotrunc) {
op_truncate(ret, 0);
}
return ret;
}
void
op_close(struct file *f)
{
if (checkmode) {
check_closefile(f->handle, f->name);
}
else {
do_closefile(f->handle, f->name);
}
POOLFREE(file, f);
}
void
op_write(struct file *f, off_t pos, off_t len)
{
off_t amount;
while (len > 0) {
amount = len;
if (amount > DATA_MAXSIZE) {
amount = DATA_MAXSIZE;
}
if (checkmode) {
check_write(f->handle, f->name, f->testcode, f->seq,
pos, amount);
}
else {
do_write(f->handle, f->name, f->testcode, f->seq,
pos, amount);
}
f->seq++;
pos += amount;
len -= amount;
}
}
void
op_truncate(struct file *f, off_t len)
{
if (checkmode) {
check_truncate(f->handle, f->name, len);
}
else {
do_truncate(f->handle, f->name, len);
}
}
////////////////////////////////////////////////////////////
// dirops
void
op_mkdir(unsigned name)
{
if (checkmode) {
check_mkdir(name);
}
else {
do_mkdir(name);
}
}
void
op_rmdir(unsigned name)
{
if (checkmode) {
check_rmdir(name);
}
else {
do_rmdir(name);
}
}
void
op_unlink(unsigned name)
{
if (checkmode) {
check_unlink(name);
}
else {
do_unlink(name);
}
}
void
op_link(unsigned from, unsigned to)
{
if (checkmode) {
check_link(from, to);
}
else {
do_link(from, to);
}
}
void
op_rename(unsigned from, unsigned to)
{
if (checkmode) {
check_rename(from, to);
}
else {
do_rename(from, to);
}
}
void
op_renamexd(unsigned fromdir, unsigned from, unsigned todir, unsigned to)
{
if (checkmode) {
check_renamexd(fromdir, from, todir, to);
}
else {
do_renamexd(fromdir, from, todir, to);
}
}
void
op_chdir(unsigned name)
{
if (checkmode) {
check_chdir(name);
}
else {
do_chdir(name);
}
}
void
op_chdirup(void)
{
if (checkmode) {
check_chdirup();
}
else {
do_chdirup();
}
}
////////////////////////////////////////////////////////////
// other
void
op_sync(void)
{
if (checkmode) {
check_sync();
}
else {
do_sync();
}
}
void
complete(void)
{
if (checkmode) {
checkfs();
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
struct file;
struct dir;
struct dir *op_opendir(unsigned);
void op_closedir(struct dir *);
struct file *op_open(unsigned, unsigned, unsigned);
void op_close(struct file *);
void op_write(struct file *, off_t, off_t);
void op_truncate(struct file *, off_t);
void op_sync(void);
void op_mkdir(unsigned);
void op_rmdir(unsigned);
void op_unlink(unsigned);
void op_link(unsigned, unsigned);
void op_rename(unsigned, unsigned);
void op_renamexd(unsigned, unsigned, unsigned, unsigned);
void op_chdir(unsigned);
void op_chdirup(void);

View File

@@ -0,0 +1,70 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <stdint.h>
#include <assert.h>
#include <err.h>
#include "pool.h"
unsigned
poolalloc(struct poolctl *pool)
{
uint32_t mask;
unsigned j, i;
assert(pool->max % 32 == 0);
for (j=0; j<pool->max/32; j++) {
for (mask=1, i=0; i<32; mask<<=1, i++) {
if ((pool->inuse[j] & mask) == 0) {
pool->inuse[j] |= mask;
return j*32 + i;
}
}
}
errx(1, "Too many %s -- increase %s in %s",
pool->itemtype, pool->maxname, pool->file);
return 0;
}
void
poolfree(struct poolctl *pool, unsigned num)
{
uint32_t mask;
unsigned pos;
assert(num < pool->max);
pos = num / 32;
mask = 1 << (num % 32);
assert(pool->inuse[pos] & mask);
pool->inuse[pos] &= ~(uint32_t)mask;
}

View File

@@ -0,0 +1,57 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
struct poolctl {
uint32_t *inuse;
unsigned max;
const char *itemtype;
const char *maxname;
const char *file;
};
#define DIVROUNDUP(a, b) (((a) + (b) - 1) / (b))
#define ROUNDUP(a, b) (DIVROUNDUP(a, b) * (b))
#define DECLPOOL(T, MAX) \
static struct T pool_space_##T[ROUNDUP(MAX, 32)]; \
static uint32_t pool_inuse_##T[DIVROUNDUP(MAX, 32)]; \
static struct poolctl pool_##T = { \
.inuse = pool_inuse_##T, \
.max = ROUNDUP(MAX, 32), \
.itemtype = "struct " #T, \
.maxname = #MAX, \
.file = __FILE__ \
}
#define POOLALLOC(T) (&pool_space_##T[poolalloc(&pool_##T)])
#define POOLFREE(T, x) (poolfree(&pool_##T, (x) - pool_space_##T))
unsigned poolalloc(struct poolctl *pool);
void poolfree(struct poolctl *pool, unsigned ix);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,153 @@
/*
* Copyright (c) 2013
* The President and Fellows of Harvard College.
* Written by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* The VFS-interface operations that can write to the fs are:
*
* sync
* fsync
* write
* reclaim
* truncate
* creat
* symlink (not supported by default and which we are going to ignore)
* mkdir
* link
* remove
* rmdir
* rename
*
* The sync operations are not interesting by themselves. Also,
* because the VFS-level unmount operation works by first syncing and
* then doing an unmount (which by default at least asserts nothing
* further needs to be written out) there is nothing to be gained by
* combining sync with write operations and seeing if the behavior is
* different: if sync doesn't produce a clean fs, unmount won't
* either, and vice versa.
*
* This means there are basically the following families of cases to
* consider:
* - writing to files in various ways and patterns
* - truncating files
* - directory ops that create things
* - directory ops that remove things (various combinations with reclaim)
* - link and rename
*/
/*
* writing
*/
void wl_createwrite(const char *size);
void wl_rewrite(const char *size);
void wl_randupdate(const char *size);
void wl_truncwrite(const char *size);
void wl_makehole(const char *size);
void wl_fillhole(const char *size);
void wl_truncfill(const char *size);
void wl_append(const char *size);
/*
* truncating
*/
void wl_trunczero(const char *size);
void wl_trunconeblock(const char *size);
void wl_truncsmallersize(const char *size);
void wl_trunclargersize(const char *size);
void wl_appendandtrunczero(const char *size);
void wl_appendandtruncpartly(const char *size);
/*
* creating
*/
void wl_mkfile(void);
void wl_mkdir(void);
void wl_mkmanyfile(void);
void wl_mkmanydir(void);
void wl_mktree(void);
void wl_mkrandtree(const char *seed);
/*
* deleting
*/
void wl_rmfile(void);
void wl_rmdir(void);
void wl_rmfiledelayed(void);
void wl_rmfiledelayedappend(void);
void wl_rmdirdelayed(void);
void wl_rmmanyfile(void);
void wl_rmmanyfiledelayed(void);
void wl_rmmanyfiledelayedandappend(void);
void wl_rmmanydir(void);
void wl_rmmanydirdelayed(void);
void wl_rmtree(void);
void wl_rmrandtree(const char *seed);
/*
* link
*/
void wl_linkfile(void);
void wl_linkmanyfile(void);
void wl_unlinkfile(void);
void wl_unlinkmanyfile(void);
void wl_linkunlinkfile(void);
/*
* rename
*/
void wl_renamefile(void);
void wl_renamedir(void);
void wl_renamesubtree(void);
void wl_renamexdfile(void);
void wl_renamexddir(void);
void wl_renamexdsubtree(void);
void wl_renamemanyfile(void);
void wl_renamemanydir(void);
void wl_renamemanysubtree(void);
/*
* Combo ops
*/
void wl_copyandrename(void);
void wl_untar(void);
void wl_compile(void);
void wl_cvsupdate(void);
/*
* Randomized op sequences
*/
void wl_writefileseq(const char *seed);
void wl_writetruncseq(const char *seed);
void wl_mkrmseq(const char *seed);
void wl_linkunlinkseq(const char *seed);
void wl_renameseq(const char *seed);
void wl_diropseq(const char *seed);
void wl_genseq(const char *seed);