+++ /dev/null
-/*
- * 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 <afsconfig.h>
-#include <afs/param.h>
-
-
-#include <sys/param.h>
-#ifdef AFS_VFSINCL_ENV
-#include <ufs/fsdir.h>
-#else /* AFS_VFSINCL_ENV */
-#include <sys/dir.h>
-#endif /* AFS_VFSINCL_ENV */
-#include <sys/user.h>
-#define VIRTUE 1
-#include <afs/remote.h>
-#undef VIRTUE
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <itc.h>
-#include <stdio.h>
-#include <rx/xdr.h>
-
-/* 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);
-}
+++ /dev/null
-/*
- * 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 <afsconfig.h>
-#include <afs/param.h>
-
-
-/* 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 <ofid> <optional new fid>\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 */