From 836b3da39a32116e80f21bbb274795936e27e21c Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Fri, 4 Oct 2019 14:52:21 -0400 Subject: [PATCH] dir: remove unused test files Makefile rules for physio.c and test-salvage.c have been commented out since the original IBM code import, and were removed in commit 37b4195d603630498664fa0975ea5d5c82f9aa4f 'dtest-20021111' to fix dtest. However, that commit neglected to remove the source files and other references to them in Makefile.in Finish the job by removing the files and references to them. No functional change is incurred by this commit. Change-Id: I57527be99cd28a481a86b659d1eb3227af9f1c99 Reviewed-on: https://gerrit.openafs.org/14052 Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/dir/test/Makefile.in | 2 - src/dir/test/physio.c | 139 -------------------------------------------- src/dir/test/test-salvage.c | 56 ------------------ 3 files changed, 197 deletions(-) delete mode 100644 src/dir/test/physio.c delete mode 100644 src/dir/test/test-salvage.c diff --git a/src/dir/test/Makefile.in b/src/dir/test/Makefile.in index bf47fd1..def077f 100644 --- a/src/dir/test/Makefile.in +++ b/src/dir/test/Makefile.in @@ -12,8 +12,6 @@ include @TOP_OBJDIR@/src/config/Makefile.lwp LIBS = ${srcdir}/lib/libdir.a ${srcdir}/lib/util.a ${srcdir}/lib/liblwp.a -OBJS=test-salvage.o physio.o dtest.o - all: dtest install: dtest diff --git a/src/dir/test/physio.c b/src/dir/test/physio.c deleted file mode 100644 index 2a58f08..0000000 --- a/src/dir/test/physio.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -/* - * File physio.cx - * NOTE This is NOT the standard physio.cx for venus or, yet alone, vice. - * It is a test one for use in src/dir. - * - */ - -/* First we have the kernel hacks' include files. */ -#include -#include - - -#include -#ifdef AFS_VFSINCL_ENV -#include -#else /* AFS_VFSINCL_ENV */ -#include -#endif /* AFS_VFSINCL_ENV */ -#include -#define VIRTUE 1 -#include -#undef VIRTUE -#include -#include -#include -#include -#include -#include - -/* Here are the include file(s) for the light-weight process facility. */ -#include "lwp.h" -#include "lock.h" - -#define PAGESIZE 2048 - -ReallyRead(fid, block, data) - long *fid; /* View the fid as longs. */ - long block; - char *data; -{ /* Do a real read. */ - char fname[100]; - int s, code; - sprintf(fname, "F%d", *fid); - s = open(fname, O_RDONLY, 0644); - if (s < 0) - Die("can't open cache file"); - code = lseek(s, PAGESIZE * block, 0); - if (code < 0) - Die("r:lseek"); - code = read(s, data, PAGESIZE); - if (code < 0) { - Die("read"); - } - close(s); - return 0; -} - -ReallyWrite(fid, block, data) - long *fid; /* View the fid as longs. */ - long block; - char *data; -{ /* Do a real write. */ - char fname[100]; - int s, code; - sprintf(fname, "F%d", *fid); - s = open(fname, O_RDWR | O_CREAT, 0644); - if (s < 0) - Die("can't find cache file"); - code = lseek(s, PAGESIZE * block, 0); - if (code < 0) - Die("w:lseek"); - code = write(s, data, PAGESIZE); - if (code < 0) - Die("write"); - close(s); - return 0; -} - - -/* The following three routines provide the fid routines used by the buffer and directory packages. */ - -int -FidZap(afid) - long *afid; -{ /* Zero out a file */ - *afid = 0; -} - -int -FidZero(afid) - long *afid; -{ /* Zero out a file */ - *afid = 0; -} - -int -FidEq(afid, bfid) - long *afid, *bfid; -{ /* Compare two fids for equality. */ - if (*afid != *bfid) - return 0; - return 1; -} - -int -FidVolEq(afid, bfid) - long *afid, *bfid; -{ /* Is fid in a particular volume */ - return 1; -} - -int -FidCpy(dfid, sfid) - long *dfid, *sfid; -{ /* Assign one fid to another. */ - *dfid = *sfid; -} - -Die(arg) - char *arg; -{ /* Print an error message and then exit. */ - int i, j; - printf("Fatal error: %s\n", arg); - - i = 1; - j = 0; - i = i / j; - - exit(1); -} diff --git a/src/dir/test/test-salvage.c b/src/dir/test/test-salvage.c deleted file mode 100644 index 5fa6feb..0000000 --- a/src/dir/test/test-salvage.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -#include -#include - - -/* This is the salvage test program. */ - -main(argc, argv) - int argc; - char **argv; -{ - long ofid, nfid, code, myFid[3], parentFid[3]; - DInit(20); - if (argc == 2) { - ofid = atoi(argv[1]); - nfid = 0; - } else if (argc == 3) { - ofid = atoi(argv[1]); - nfid = atoi(argv[2]); - } else { - printf("usage is: test \n"); - exit(1); - } - code = DirOK(&ofid); - printf("DirOK returned %d.\n"); - if (nfid) { - printf("Salvaging from fid %d into fid %d.\n", ofid, nfid); - if (Lookup(&ofid, ".", myFid) || Lookup(&ofid, "..", parentFid)) { - printf("Lookup of \".\" and/or \"..\" failed: "); - printf("%d %d %d %d\n", myFid[1], myFid[2], parentFid[1], - parentFid[2]); - printf("Directory cannot be salvaged\n"); - } else { - code = - DirSalvage(&ofid, &nfid, myFid[1], myFid[2], parentFid[1], - parentFid[2]); - printf("DirSalvage returned %d.\n", code); - } - } - DFlush(); -} - -Log(a, b, c, d, e, f, g, h, i, j, k, l, m, n) -{ - printf(a, b, c, d, e, f, g, h, i, j, k, l, m, n); -} - -/* the end */ -- 1.9.4