From: adilger Date: Thu, 9 Mar 2000 01:04:23 +0000 (+0000) Subject: demos/test.c: removed duplicate files (also exist in test/test.c) X-Git-Tag: v1_7_100~6094 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=e7588d4f1f8e84e3a6ed951027412d6f6617671c;p=fs%2Flustre-release.git demos/test.c: removed duplicate files (also exist in test/test.c) --- diff --git a/lustre/demos/test.c b/lustre/demos/test.c deleted file mode 100644 index c79a640..0000000 --- a/lustre/demos/test.c +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#define OBD_IOC_CREATE _IOR('f', 3, long) -#define OBD_IOC_SETUP _IOW('f', 4, long) -#define OBD_IOC_SYNC _IOR('f', 16, long) -#define OBD_IOC_DESTROY _IOW('f', 6, long) -#define OBD_IOC_STATFS _IORW('f', 15, long) - -#define LOOP_DEVICE "/dev/loop0" -#define OBD_DEVICE "/dev/obd" - -int main (int argc, char * argv[]) -{ - int fd, rc, err = -1; - struct stat stat_buf; - struct statfs stfs; - - - if (argc < 2) { - printf("syntax: %s command [argument]\n", argv[0]); - printf("Where command is one of \"setup\", \"create\", \"destroy\", or \"sync\".\n"); - exit(1); - } - if (stat(LOOP_DEVICE, &stat_buf)) { - printf("Couldn't stat(" LOOP_DEVICE ").\n"); - exit(1); - } - printf("Device: %u\n", (unsigned int) stat_buf.st_rdev); - - fd = open (OBD_DEVICE, O_RDONLY); - if (fd == -1) { - printf("Couldn't open " OBD_DEVICE ".\n"); - exit(1); - } - - if (!strcmp(argv[1], "setup")) { - rc = ioctl(fd, OBD_IOC_SETUP, &stat_buf.st_rdev); - fprintf(stderr, "rc = %d, errno = %d\n", rc, errno); - } else if (!strcmp(argv[1], "create")) { - int iter, i; - - if (argc < 3) { - printf("create requires a nonzero argument.\n"); - exit(1); - } - - iter = atoi(argv[2]); - if (iter < 1) { - printf("create requires a nonzero argument.\n"); - exit(1); - } - printf("creating %d objects...\n", iter); - - for (i = 0; i < iter; i++) { - if ((rc = ioctl(fd, OBD_IOC_CREATE, &err))) { - fprintf(stderr, "Error; aborting.\n"); - break; - } - if ((rc = ioctl(fd, OBD_IOC_DESTROY, &err))) { - fprintf(stderr, "Error; aborting.\n"); - break; - } - } - fprintf(stderr, "rc = %d, errno = %d, err = %d\n", - rc, errno, err); - } else if (!strcmp(argv[1], "sync")) { - rc = ioctl(fd, OBD_IOC_SYNC, &err); - fprintf(stderr, "rc = %d, errno = %d, err = %d\n", - rc, errno, err); - } else if (!strcmp(argv[1], "destroy")) { - int ino; - - if (argc < 3) { - printf("destroy requires a nonzero inode number.\n"); - exit(1); - } - - ino = atoi(argv[2]); - if (ino < 1) { - printf("destroy requires a nonzero inode number.\n"); - exit(1); - } - - rc = ioctl(fd, OBD_IOC_DESTROY, &ino); - fprintf(stderr, "rc = %d, errno = %d\n", rc, errno); - } else { - printf("Invalid command, run with no arguments for help.\n"); - } - close(fd); - - return 0; -} diff --git a/lustre/demos/test2.c b/lustre/demos/test2.c deleted file mode 100644 index 4d486af..0000000 --- a/lustre/demos/test2.c +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -/* Beware when setting FSROOT that I've not made any attempts to avoid buffer - * overruns below--this is a test program, it's a static buffer. */ -#define FSROOT "/mnt" -#define OBD_ITERATIONS 10000 - -int main (int argc, char * argv[]) -{ - int fd, rc, err = -1; - struct stat stat_buf; - - if (argc < 2) { - printf("syntax: %s command\n", argv[0]); - printf("Where command is one of \"setup\" or \"create\".\n"); - exit(1); - } - - if (!strcmp(argv[1], "setup")) { - printf("This is silly.\n"); - } else if (!strcmp(argv[1], "create")) { - int i, iter; - - if (argc < 3) { - printf("create requires a nonzero argument.\n"); - exit(1); - } - - iter = atoi(argv[2]); - - if (iter < 1) { - printf("create requires a nonzero argument.\n"); - exit(1); - } - printf("creating %d files...\n", iter); - - for (i = 0; i < iter; i++) { - fd = creat(FSROOT "/foo123", S_IRWXU); - close(fd); - unlink(FSROOT "/foo123"); - } - } else { - printf("Invalid command, run with no arguments for help.\n"); - } - - return 0; -}