mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: remove unsupported conditionals
This patch removes the unsupported sgi and CRAY. Signed-off-by: Rich Johnston <rjohnston@sgi.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
+7
-1715
File diff suppressed because it is too large
Load Diff
@@ -56,13 +56,7 @@
|
||||
#define UNRESVSP 123 /* xfsctl(XFS_IOC_UNRESVSP) */
|
||||
#define FSYNC2 125 /* fsync(2) */
|
||||
#define FDATASYNC 126 /* fdatasync(2) */
|
||||
|
||||
#ifdef CRAY
|
||||
/* used: <<doio>> 1.? <<DOIO>> 1.5 <-DOIO-> 1.7*/
|
||||
#define DOIO_MAGIC '<[DOIO]>'
|
||||
#else
|
||||
#define DOIO_MAGIC 07116601
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define various user flags (r_uflag field) that io requests can have
|
||||
|
||||
-162
@@ -168,11 +168,7 @@ int mult_size=1; /* when random iosz, iosz must be mult of mult_size */
|
||||
/* the *_lseek variables are only used when radon lseek option (-R) is used */
|
||||
int min_lseek=0; /* also set in option parsing */
|
||||
int max_lseek=-1; /* -1 means size of file */
|
||||
#ifdef CRAY
|
||||
int Pattern=PATTERN_OFFSET; /* This pattern is 64 bit word based */
|
||||
#else
|
||||
int Pattern=PATTERN_ASCII;
|
||||
#endif
|
||||
int Seed=-1; /* random number seed, < 0 == uninitialized */
|
||||
int Nseeds=0; /* Number of seed specified by the user */
|
||||
int *Seeds; /* malloc'ed arrary of ints holding user spec seeds */
|
||||
@@ -229,32 +225,6 @@ struct fileinfo_t {
|
||||
* to use.
|
||||
*/
|
||||
int Open_flags[] = {
|
||||
#ifdef CRAY
|
||||
O_RDWR|O_CREAT,
|
||||
O_RDWR|O_CREAT|O_RAW,
|
||||
O_RDWR|O_CREAT|O_BIG,
|
||||
O_RDWR|O_CREAT|O_APPEND,
|
||||
O_RDWR|O_CREAT|O_NDELAY,
|
||||
O_RDWR|O_CREAT|O_PLACE,
|
||||
O_RDWR|O_CREAT|O_SYNC,
|
||||
O_RDWR|O_CREAT|O_RAW|O_SYNC,
|
||||
O_RDWR|O_CREAT|O_NDELAY|O_SYNC,
|
||||
O_RDWR|O_CREAT|O_NDELAY|O_SYNC|O_BIG,
|
||||
O_RDWR|O_CREAT|O_RAW,
|
||||
O_RDWR|O_CREAT|O_RAW|O_APPEND,
|
||||
O_RDWR|O_CREAT|O_RAW|O_BIG,
|
||||
O_RDWR|O_CREAT|O_RAW|O_APPEND|O_BIG,
|
||||
/***
|
||||
* O_WELLFORMED makes -o random require well formed i/o
|
||||
***/
|
||||
#if ALLOW_O_WELLFORMED
|
||||
#if O_PARALLEL
|
||||
O_RDWR|O_CREAT|O_PARALLEL|O_WELLFORMED|O_RAW,
|
||||
O_RDWR|O_CREAT|O_PARALLEL|O_WELLFORMED|O_RAW|O_TRUNC,
|
||||
#endif /* O_PARALLEL */
|
||||
#endif
|
||||
|
||||
#else /* CRAY */
|
||||
O_RDWR|O_CREAT,
|
||||
O_RDWR|O_CREAT|O_APPEND,
|
||||
O_RDWR|O_CREAT|O_NDELAY,
|
||||
@@ -262,7 +232,6 @@ int Open_flags[] = {
|
||||
O_RDWR|O_CREAT|O_SYNC|O_NDELAY,
|
||||
O_RDWR|O_CREAT|O_APPEND|O_NDELAY,
|
||||
|
||||
#endif /* CRAY */
|
||||
};
|
||||
|
||||
#define REXEC_INIT 0 /* don't do re-exec of childern */
|
||||
@@ -270,11 +239,7 @@ int Open_flags[] = {
|
||||
#define REXEC_DONE 2 /* We've already been re-exec'ed */
|
||||
|
||||
#ifndef BSIZE
|
||||
#ifdef CRAY
|
||||
#define BSIZE 1024
|
||||
#else
|
||||
#define BSIZE 512
|
||||
#endif /* CRAY */
|
||||
#endif /* BSIZE */
|
||||
|
||||
#define USECS_PER_SEC 1000000 /* microseconds per second */
|
||||
@@ -428,9 +393,6 @@ extern int Forker_npids; /* num of forked pid, defined in forker.c */
|
||||
|
||||
case 'd':
|
||||
auto_dir=optarg;
|
||||
#ifdef CRAY
|
||||
unsetenv("TMPDIR"); /* force the use of auto_dir */
|
||||
#endif
|
||||
if ( stat(auto_dir, &statbuf) == -1 ) {
|
||||
if ( mkdir(auto_dir, 0777) == -1 ) {
|
||||
if ( errno != EEXIST ) {
|
||||
@@ -612,18 +574,9 @@ extern int Forker_npids; /* num of forked pid, defined in forker.c */
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
#ifdef CRAY
|
||||
if (strcmp(optarg, "PANIC") != 0 ) {
|
||||
fprintf(stderr, "%s%s: --P arg must be PANIC\n", Progname, TagName);
|
||||
exit(1);
|
||||
}
|
||||
Upanic_on_error++;
|
||||
printf("%s: Will call upanic after writes\n");
|
||||
#else
|
||||
printf("%s%s: --P is illegal option on non-cray system\n",
|
||||
Progname, TagName);
|
||||
exit(1);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'q': /* file content or pattern */
|
||||
@@ -904,11 +857,6 @@ no whole file checking will be performed!\n", Progname, TagName, (int)getpid());
|
||||
background(Progname); /* give user their prompt back */
|
||||
}
|
||||
|
||||
#if CRAY
|
||||
if ( Sync_with_others )
|
||||
setpgrp();
|
||||
#endif
|
||||
|
||||
if ( Debug > 3 ) {
|
||||
#if NEWIO
|
||||
lio_set_debug(Debug-3);
|
||||
@@ -1227,18 +1175,9 @@ no whole file checking will be performed!\n", Progname, TagName, (int)getpid());
|
||||
/*
|
||||
* If delaying between iterations, get amount time to
|
||||
* delaysecs in clocks or usecs.
|
||||
* If on the CRAY, delaytime is in clocks since
|
||||
* _rtc() will be used, which does not have the overhead
|
||||
* of gettimeofday(2).
|
||||
*/
|
||||
if ( delaysecs ) {
|
||||
#if CRAY
|
||||
int hz;
|
||||
hz=sysconf(_SC_CLK_TCK);
|
||||
delaytime=(int)((float)hz * delaysecs);
|
||||
#else
|
||||
delaytime=(int)((float)USECS_PER_SEC * delaysecs);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1398,13 +1337,6 @@ no whole file checking will be performed!\n", Progname, TagName, (int)getpid());
|
||||
if ( delaytime ) {
|
||||
|
||||
int ct, end;
|
||||
#ifdef CRAY
|
||||
ct=_rtc();
|
||||
end=ct+delaytime;
|
||||
while ( ct < end ) {
|
||||
ct = _rtc();
|
||||
}
|
||||
#else
|
||||
struct timeval curtime;
|
||||
gettimeofday(&curtime, NULL);
|
||||
ct=curtime.tv_sec*USECS_PER_SEC + curtime.tv_usec;
|
||||
@@ -1414,7 +1346,6 @@ no whole file checking will be performed!\n", Progname, TagName, (int)getpid());
|
||||
gettimeofday(&curtime, NULL);
|
||||
ct=curtime.tv_sec*USECS_PER_SEC + curtime.tv_usec;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifndef NO_XFS
|
||||
@@ -1472,10 +1403,6 @@ set_sig()
|
||||
case SIGKILL:
|
||||
case SIGSTOP:
|
||||
case SIGCONT:
|
||||
#ifdef CRAY
|
||||
case SIGINFO:
|
||||
case SIGRECOVERY:
|
||||
#endif /* CRAY */
|
||||
#ifdef SIGCKPT
|
||||
case SIGCKPT:
|
||||
#endif /* SIGCKPT */
|
||||
@@ -1486,12 +1413,7 @@ set_sig()
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef sgi
|
||||
sigset( sig, sig_handler );
|
||||
#else
|
||||
/* linux and cray */
|
||||
signal(sig, sig_handler);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
} /* endfor */
|
||||
@@ -1512,9 +1434,7 @@ int sig;
|
||||
if ( sig == SIGUSR2 ) {
|
||||
fprintf(stdout, "%s%s: %d %s/%d: received SIGUSR2 (%d) - stopping.\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, sig);
|
||||
#ifndef sgi
|
||||
signal(sig, sig_handler); /* allow us to get this signal more than once */
|
||||
#endif
|
||||
|
||||
} else if( sig == SIGINT ){
|
||||
/* The user has told us to cleanup, don't pretend it's an error. */
|
||||
@@ -1552,13 +1472,6 @@ notify_others()
|
||||
|
||||
if ( Sync_with_others && send_signals == 0 ) {
|
||||
|
||||
#if CRAY
|
||||
send_signals=1; /* only send signals once */
|
||||
if ( Debug > 1 )
|
||||
printf("%s%s: %d DEBUG2 %s/%d: Sending SIGUSR2 to pgrp\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__);
|
||||
killm(C_PGRP, getpgrp(), SIGUSR2);
|
||||
#else
|
||||
send_signals=1; /* only send signals once */
|
||||
|
||||
for (ind=0; ind< Forker_npids; ind++) {
|
||||
@@ -1568,7 +1481,6 @@ notify_others()
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, Forker_pids[ind]);
|
||||
kill(Forker_pids[ind], SIGUSR2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1583,12 +1495,6 @@ handle_error()
|
||||
{
|
||||
Errors++;
|
||||
|
||||
#ifdef CRAY
|
||||
if ( Errors & Upanic_on_error ) {
|
||||
upanic(PA_PANIC);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( Maxerrs && Errors >= Maxerrs ) {
|
||||
printf("%s%s: %d %s/%d: %d Hit max errors value of %d\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, Iter_cnt, Maxerrs);
|
||||
@@ -2030,25 +1936,6 @@ unsigned char *buf;
|
||||
Progname, TagName, __FILE__, __LINE__, errno, strerror(errno) );
|
||||
return -1;
|
||||
}
|
||||
#if NEWIO
|
||||
#ifdef sgi
|
||||
/* If this is POSIX I/O and it is via aio_{read,write}
|
||||
* or lio_listio then after completion of the I/O the
|
||||
* value of the file offset for the file is
|
||||
* unspecified--which means we cannot trust what
|
||||
* tell() told us. Fudge it here.
|
||||
*/
|
||||
if( (io_type & LIO_IO_ASYNC_TYPES) || (io_type & LIO_RANDOM) ){
|
||||
if( tmp != Woffset + grow_incr ){
|
||||
if( Debug > 5 ){
|
||||
printf("%s: %d DEBUG6 %s/%d: posix fudge, forcing tmp (%d) to match Woffset+grow_incr (%d)\n",
|
||||
Progname, Pid, __FILE__, __LINE__, tmp, Woffset+grow_incr);
|
||||
}
|
||||
tmp = Woffset + grow_incr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
lkfile(fd, LOCK_UN, LKLVL0);
|
||||
@@ -2140,9 +2027,6 @@ int just_trunc; /* lseek has already been done for you */
|
||||
int cur_offset;
|
||||
int new_offset;
|
||||
int ret;
|
||||
#ifdef CRAY
|
||||
int offset;
|
||||
#endif
|
||||
|
||||
shrink_cnt++;
|
||||
|
||||
@@ -2184,19 +2068,6 @@ int just_trunc; /* lseek has already been done for you */
|
||||
else {
|
||||
new_offset=random_range(min_lseek, max_lseek, 1, NULL);
|
||||
}
|
||||
|
||||
#ifdef CRAY
|
||||
if ((offset=lseek(fd, new_offset, SEEK_SET)) == -1 ) {
|
||||
fprintf(stderr, "%s%s: %d %s/%d: lseek(%d, %d, SEEK_SET) l3 failed: %s\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, fd, new_offset, strerror(errno));
|
||||
lkfile(fd, LOCK_UN, LKLVL0);
|
||||
return -1;
|
||||
}
|
||||
else if ( Debug > 3 )
|
||||
printf("%s: %d DEBUG4 %s/%d: lseeked to random offset %d\n",
|
||||
Progname, Pid, __FILE__, __LINE__, offset);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
else { /* remove trunc_incr from file */
|
||||
@@ -2205,41 +2076,19 @@ int just_trunc; /* lseek has already been done for you */
|
||||
|
||||
if ( new_offset < 0 )
|
||||
new_offset=0;
|
||||
|
||||
#ifdef CRAY
|
||||
if ( lseek(fd, new_offset, SEEK_SET) == -1 ) {
|
||||
fprintf(stderr, "%s%s: %d %s/%d: lseek(fd, %d, SEEK_SET) l4 failed: %s\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, new_offset, strerror(errno));
|
||||
lkfile(fd, LOCK_UN, LKLVL0);
|
||||
return -1;
|
||||
}
|
||||
else if ( Debug > 3 )
|
||||
printf("%s: %d DEBUG4 %s/%d: lseeked to offset %d, %d bytes from end\n",
|
||||
Progname, Pid, __FILE__, __LINE__, new_offset, trunc_incr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef CRAY
|
||||
ret=trunc(fd);
|
||||
#else
|
||||
ret=ftruncate(fd, new_offset );
|
||||
if( (ret == 0) && (Debug > 3) ){
|
||||
printf("%s: %d DEBUG4 %s/%d: ftruncated to offset %d, %d bytes from end\n",
|
||||
Progname, Pid, __FILE__, __LINE__, new_offset, trunc_incr);
|
||||
}
|
||||
#endif
|
||||
|
||||
lkfile(fd, LOCK_UN, LKLVL0);
|
||||
|
||||
if ( ret == -1 ) {
|
||||
#ifdef CRAY
|
||||
fprintf(stderr, "%s%s: %d %s/%d: trunc failed: %s\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, strerror(errno));
|
||||
#else
|
||||
fprintf(stderr, "%s%s: %d %s/%d: ftruncate failed: %s\n",
|
||||
Progname, TagName, Pid, __FILE__, __LINE__, strerror(errno));
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2756,17 +2605,6 @@ int fd;
|
||||
int size;
|
||||
{
|
||||
|
||||
#ifdef CRAY
|
||||
long avl;
|
||||
|
||||
if ( ialloc(fd, size, IA_CONT, &avl) == -1 ) {
|
||||
fprintf(stderr, "%s%s %s/%d: Unable to pre-alloc space: ialloc failed: %d %s\n",
|
||||
Progname, TagName,
|
||||
__FILE__, __LINE__, errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_XFS
|
||||
#ifdef XFS_IOC_RESVSP
|
||||
struct xfs_flock64 f;
|
||||
|
||||
-307
@@ -146,21 +146,6 @@ struct strmap Aio_Strat_Map[] = {
|
||||
#else
|
||||
{ "none", 0 },
|
||||
#endif /* !linux */
|
||||
#ifdef CRAY
|
||||
#if _UMK || RELEASE_LEVEL >= 8000
|
||||
{ "recall", A_RECALL },
|
||||
#endif
|
||||
|
||||
#ifdef RECALL_SIZEOF
|
||||
{ "recalla", A_RECALLA },
|
||||
#endif
|
||||
{ "recalls", A_RECALLS },
|
||||
#endif /* CRAY */
|
||||
|
||||
#ifdef sgi
|
||||
{ "suspend", A_SUSPEND },
|
||||
{ "callback", A_CALLBACK },
|
||||
#endif
|
||||
{ NULL, -1 }
|
||||
};
|
||||
|
||||
@@ -195,80 +180,20 @@ struct strmap Omode_Map[] = {
|
||||
struct strmap Syscall_Map[] = {
|
||||
{ "read", READ, 0 },
|
||||
{ "write", WRITE, SY_WRITE },
|
||||
#ifdef CRAY
|
||||
{ "reada", READA, SY_ASYNC },
|
||||
{ "writea", WRITEA, SY_WRITE|SY_ASYNC },
|
||||
#ifndef _CRAYMPP
|
||||
{ "ssread", SSREAD, SY_SDS },
|
||||
{ "sswrite", SSWRITE, SY_WRITE|SY_SDS },
|
||||
#endif
|
||||
{ "listio", LISTIO, SY_ASYNC },
|
||||
|
||||
/* listio as 4 system calls */
|
||||
{ "lread", LREAD, 0 },
|
||||
{ "lreada", LREADA, SY_ASYNC },
|
||||
{ "lwrite", LWRITE, SY_WRITE },
|
||||
{ "lwritea", LWRITEA, SY_WRITE|SY_ASYNC },
|
||||
|
||||
/* listio with nstrides > 1 */
|
||||
{ "lsread", LSREAD, 0 },
|
||||
{ "lsreada", LSREADA, SY_ASYNC },
|
||||
{ "lswrite", LSWRITE, SY_WRITE },
|
||||
{ "lswritea", LSWRITEA, SY_WRITE|SY_ASYNC },
|
||||
|
||||
/* listio with nents > 1 */
|
||||
{ "leread", LEREAD, 0|SY_NENT },
|
||||
{ "lereada", LEREADA, SY_ASYNC|SY_NENT },
|
||||
{ "lewrite", LEWRITE, SY_WRITE|SY_NENT },
|
||||
{ "lewritea", LEWRITEA, SY_WRITE|SY_ASYNC|SY_NENT },
|
||||
|
||||
/* listio with nents > 1 & nstrides > 1 */
|
||||
|
||||
/* all listio system calls under one name */
|
||||
{ "listio+", LREAD, 0 },
|
||||
{ "listio+", LREADA, SY_ASYNC },
|
||||
{ "listio+", LWRITE, SY_WRITE },
|
||||
{ "listio+", LWRITEA, SY_WRITE|SY_ASYNC },
|
||||
{ "listio+", LSREAD, 0 },
|
||||
{ "listio+", LSREADA, SY_ASYNC },
|
||||
{ "listio+", LSWRITE, SY_WRITE },
|
||||
{ "listio+", LSWRITEA, SY_WRITE|SY_ASYNC },
|
||||
{ "listio+", LEREAD, 0|SY_NENT },
|
||||
{ "listio+", LEREADA, SY_ASYNC|SY_NENT },
|
||||
{ "listio+", LEWRITE, SY_WRITE|SY_NENT },
|
||||
{ "listio+", LEWRITEA, SY_WRITE|SY_ASYNC|SY_NENT },
|
||||
#endif
|
||||
|
||||
{ "pread", PREAD },
|
||||
{ "pwrite", PWRITE, SY_WRITE },
|
||||
#ifdef sgi
|
||||
{ "aread", AREAD, SY_ASYNC },
|
||||
{ "awrite", AWRITE, SY_WRITE|SY_ASYNC },
|
||||
#if 0
|
||||
/* not written yet */
|
||||
{ "llread", LLREAD, 0 },
|
||||
{ "llaread", LLAREAD, SY_ASYNC },
|
||||
{ "llwrite", LLWRITE, 0 },
|
||||
{ "llawrite", LLAWRITE, SY_ASYNC },
|
||||
{ "ffsync", DFFSYNC, SY_WRITE },
|
||||
#endif
|
||||
#endif /* SGI */
|
||||
#ifndef NO_XFS
|
||||
{ "resvsp", RESVSP, SY_WRITE },
|
||||
{ "unresvsp", UNRESVSP, SY_WRITE },
|
||||
{ "reserve", RESVSP, SY_WRITE },
|
||||
{ "unreserve", UNRESVSP, SY_WRITE },
|
||||
#endif
|
||||
|
||||
#ifndef CRAY
|
||||
{ "readv", READV },
|
||||
{ "writev", WRITEV, SY_WRITE },
|
||||
{ "mmread", MMAPR },
|
||||
{ "mmwrite", MMAPW, SY_WRITE },
|
||||
{ "fsync2", FSYNC2, SY_WRITE },
|
||||
{ "fdatasync", FDATASYNC, SY_WRITE },
|
||||
#endif
|
||||
|
||||
{ NULL, -1 }
|
||||
};
|
||||
|
||||
@@ -280,36 +205,7 @@ struct strmap Syscall_Map[] = {
|
||||
struct strmap Flag_Map[] = {
|
||||
{ "buffered", 0, 0 },
|
||||
{ "sync", O_SYNC, 0 },
|
||||
#ifdef CRAY
|
||||
{ "raw", O_RAW, FLG_RAW },
|
||||
{ "raw+wf", O_RAW | O_WELLFORMED, FLG_RAW },
|
||||
{ "raw+wf+ldraw", O_RAW | O_WELLFORMED | O_LDRAW, FLG_RAW },
|
||||
{ "raw+wf+ldraw+sync", O_RAW | O_WELLFORMED | O_LDRAW | O_SYNC, FLG_RAW },
|
||||
#ifdef O_SSD
|
||||
{ "ssd", O_SSD, FLG_RAW },
|
||||
#endif
|
||||
#ifdef O_LDRAW
|
||||
{ "ldraw", O_LDRAW, 0 },
|
||||
#endif
|
||||
#ifdef O_PARALLEL
|
||||
{ "parallel", O_PARALLEL | O_RAW | O_WELLFORMED,
|
||||
FLG_RAW },
|
||||
{ "parallel+sync", O_PARALLEL | O_RAW | O_WELLFORMED | O_SYNC,
|
||||
FLG_RAW },
|
||||
{ "parallel+ldraw", O_PARALLEL | O_RAW | O_WELLFORMED | O_LDRAW,
|
||||
FLG_RAW },
|
||||
{ "parallel+ldraw+sync",
|
||||
O_PARALLEL | O_RAW | O_WELLFORMED | O_LDRAW | O_SYNC,
|
||||
FLG_RAW },
|
||||
#endif
|
||||
#endif /* CRAY */
|
||||
|
||||
{ "direct", O_DIRECT, FLG_RAW },
|
||||
#ifdef sgi
|
||||
{ "dsync", O_DSYNC }, /* affects writes */
|
||||
{ "rsync", O_RSYNC }, /* affects reads */
|
||||
{ "rsync+dsync", O_RSYNC|O_DSYNC },
|
||||
#endif
|
||||
{ NULL, -1 }
|
||||
};
|
||||
|
||||
@@ -353,13 +249,7 @@ char **argv;
|
||||
struct io_req req;
|
||||
|
||||
umask(0);
|
||||
|
||||
#ifdef CRAY
|
||||
Sds_Avail = sysconf(_SC_CRAY_SDS);
|
||||
#else
|
||||
Sds_Avail = 0;
|
||||
#endif
|
||||
|
||||
TagName[0] = '\0';
|
||||
parse_cmdline(argc, argv, OPTS);
|
||||
|
||||
@@ -557,9 +447,6 @@ struct io_req *req;
|
||||
char pattern, *errp;
|
||||
struct strmap *flags, *sc, *aio_strat;
|
||||
struct file_info *fptr;
|
||||
#ifdef CRAY
|
||||
int opcode, cmd;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Choose system call, flags, and file
|
||||
@@ -568,32 +455,11 @@ struct io_req *req;
|
||||
sc = Syscall_List[random_range(0, Nsyscalls-1, 1, NULL)];
|
||||
req->r_type = sc->m_value;
|
||||
|
||||
#ifdef CRAY
|
||||
if (sc->m_value == LISTIO ) {
|
||||
opcode = random_range(0, 1, 1, NULL) ? LO_READ : LO_WRITE;
|
||||
cmd = random_range(0, 1, 1, NULL) ? LC_START : LC_WAIT;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( sc->m_flags & SY_WRITE )
|
||||
pattern = Byte_Patterns[random_range(0, sizeof(Byte_Patterns) - 1, 1, NULL)];
|
||||
else
|
||||
pattern = 0;
|
||||
|
||||
#if CRAY
|
||||
/*
|
||||
* If sds io, simply choose a length (possibly pattern) and return
|
||||
*/
|
||||
|
||||
if (sc->m_flags & SY_SDS ) {
|
||||
req->r_data.ssread.r_nbytes = random_range(Mintrans, Maxtrans, BSIZE, NULL);
|
||||
if (sc->m_flags & SY_WRITE)
|
||||
req->r_data.sswrite.r_pattern = pattern;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* otherwise, we're doing file io. Choose starting offset, length,
|
||||
* open flags, and possibly a pattern (for write/writea).
|
||||
@@ -856,25 +722,6 @@ struct io_req *req;
|
||||
break;
|
||||
|
||||
case LISTIO:
|
||||
#ifdef CRAY
|
||||
strcpy(req->r_data.listio.r_file, fptr->f_path);
|
||||
req->r_data.listio.r_offset = offset;
|
||||
req->r_data.listio.r_cmd = cmd;
|
||||
req->r_data.listio.r_aio_strat = (aio_strat==NULL) ? 0 : aio_strat->m_value;
|
||||
req->r_data.listio.r_filestride = 0;
|
||||
req->r_data.listio.r_memstride = 0;
|
||||
req->r_data.listio.r_opcode = opcode;
|
||||
req->r_data.listio.r_nstrides = 1;
|
||||
req->r_data.listio.r_nbytes = length;
|
||||
req->r_data.listio.r_uflags = (flags->m_flags & FLG_RAW) ? F_WORD_ALIGNED : 0;
|
||||
|
||||
if (opcode == LO_WRITE) {
|
||||
req->r_data.listio.r_pattern = pattern;
|
||||
req->r_data.listio.r_oflags = O_WRONLY | flags->m_value;
|
||||
} else {
|
||||
req->r_data.listio.r_oflags = O_RDONLY | flags->m_value;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -897,9 +744,6 @@ get_file_info(rec)
|
||||
struct file_info *rec;
|
||||
{
|
||||
struct stat sbuf;
|
||||
#ifdef CRAY
|
||||
struct lk_device_info dinfo;
|
||||
#endif
|
||||
#ifndef NO_XFS
|
||||
int fd;
|
||||
struct dioattr finfo;
|
||||
@@ -916,13 +760,6 @@ struct file_info *rec;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if _CRAY2
|
||||
if ((! S_ISREG(sbuf.st_mode)) || strncmp(rec->f_path, "/dev/", 5) == 0) {
|
||||
fprintf(stderr, "iogen%s: device level io not supported on cray2\n", TagName);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
rec->f_type = sbuf.st_mode & S_IFMT;
|
||||
|
||||
/*
|
||||
@@ -947,17 +784,6 @@ struct file_info *rec;
|
||||
}
|
||||
|
||||
rec->f_riou = BSIZE;
|
||||
#ifdef CRAY
|
||||
if (lk_rawdev(rec->f_path, dinfo.path, sizeof(dinfo.path), 0) == -1)
|
||||
return -1;
|
||||
|
||||
if (lk_devinfo(&dinfo, 0) == -1) {
|
||||
/* can't get raw I/O unit -- use stat to fudge it */
|
||||
rec->f_riou = sbuf.st_blksize;
|
||||
} else {
|
||||
rec->f_riou = ctob(dinfo.iou);
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_XFS
|
||||
if( (fd = open(rec->f_path, O_RDWR|O_DIRECT, 0)) != -1 ) {
|
||||
#ifdef XFS_IOC_DIOINFO
|
||||
@@ -980,34 +806,10 @@ bozo!
|
||||
rec->f_riou = BBSIZE;
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
#ifdef CRAY
|
||||
/*
|
||||
* Otherwise, file is a device. Use lk_devinfo() to get its logical
|
||||
* sector size. This is the iou and riou
|
||||
*/
|
||||
|
||||
strcpy(dinfo.path, rec->f_path);
|
||||
|
||||
if (lk_devinfo(&dinfo, 0) == -1) {
|
||||
fprintf(stderr, "iogen%s: %s: %s\n", TagName, Lk_err_func, Lk_err_mesg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rec->f_iou = ctob(dinfo.iou);
|
||||
rec->f_riou = ctob(dinfo.iou);
|
||||
rec->f_length = ctob(dinfo.length);
|
||||
#else
|
||||
#ifdef sgi
|
||||
rec->f_riou = BBSIZE;
|
||||
rec->f_length = BBSIZE;
|
||||
#else
|
||||
rec->f_riou = BSIZE;
|
||||
rec->f_length = BSIZE;
|
||||
#endif /* sgi */
|
||||
#endif /* CRAY */
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1393,32 +1195,12 @@ char *opts;
|
||||
struct file_info *fptr;
|
||||
int nopenargs;
|
||||
char *openargs[5]; /* Flags, cbits, cblks */
|
||||
#ifdef CRAY
|
||||
char *errmsg;
|
||||
char *ranges;
|
||||
struct strmap *type;
|
||||
#endif
|
||||
|
||||
while ((o = getopt(argc, argv, opts)) != EOF) {
|
||||
switch ((char)o) {
|
||||
|
||||
case 'a':
|
||||
#ifndef CRAY
|
||||
fprintf(stderr, "iogen%s: Unrecognized option -a on this platform\n", TagName);
|
||||
exit(2);
|
||||
#else
|
||||
cp = strtok(optarg, ",");
|
||||
while (cp != NULL) {
|
||||
if ((type = str_lookup(Aio_Strat_Map, cp)) == NULL) {
|
||||
fprintf(stderr, "iogen%s: Unrecognized aio completion strategy: %s\n", TagName, cp);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
Aio_Strat_List[Naio_Strat_Types++] = type;
|
||||
cp = strtok(NULL, ",");
|
||||
}
|
||||
a_opt++;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
@@ -1480,23 +1262,8 @@ char *opts;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
#ifndef CRAY
|
||||
fprintf(stderr, "iogen%s: Unrecognized option -L on this platform\n", TagName);
|
||||
exit(2);
|
||||
#else
|
||||
if( parse_ranges(optarg, 1, 255, 1, NULL, &ranges,
|
||||
&errmsg ) == -1 ) {
|
||||
fprintf(stderr, "iogen%s: error parsing listio range '%s': %s\n",
|
||||
TagName, optarg, errmsg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Minstrides = range_min(ranges, 0);
|
||||
Maxstrides = range_max(ranges, 0);
|
||||
|
||||
free(ranges);
|
||||
L_opt++;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
@@ -1519,19 +1286,6 @@ char *opts;
|
||||
case 'O':
|
||||
|
||||
nopenargs = string_to_tokens(optarg, openargs, 4, ":/");
|
||||
|
||||
#ifdef CRAY
|
||||
if(nopenargs)
|
||||
sscanf(openargs[1],"%i", &Ocbits);
|
||||
if(nopenargs > 1)
|
||||
sscanf(openargs[2],"%i", &Ocblks);
|
||||
|
||||
Oflags = parse_open_flags(openargs[0], &errmsg);
|
||||
if(Oflags == -1) {
|
||||
fprintf(stderr, "iogen%s: -O %s error: %s\n", TagName, optarg, errmsg);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
#ifndef NO_XFS
|
||||
if(!strcmp(openargs[0], "realtime")) {
|
||||
/*
|
||||
@@ -1685,28 +1439,12 @@ char *opts;
|
||||
Nsyscalls = 0;
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "read");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "write");
|
||||
#ifdef CRAY
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "reada");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "writea");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "lread");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "lreada");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "lwrite");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "lwritea");
|
||||
#endif
|
||||
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "pread");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "pwrite");
|
||||
#ifdef sgi
|
||||
/*Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "aread");*/
|
||||
/*Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "awrite");*/
|
||||
#endif
|
||||
|
||||
#ifndef CRAY
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "readv");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "writev");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "mmread");
|
||||
Syscall_List[Nsyscalls++] = str_lookup(Syscall_Map, "mmwrite");
|
||||
#endif
|
||||
|
||||
Fileio = 1;
|
||||
}
|
||||
@@ -1724,18 +1462,6 @@ char *opts;
|
||||
Nflags = 0;
|
||||
Flag_List[Nflags++] = str_lookup(Flag_Map, "buffered");
|
||||
Flag_List[Nflags++] = str_lookup(Flag_Map, "sync");
|
||||
#ifdef CRAY
|
||||
Flag_List[Nflags++] = str_lookup(Flag_Map, "raw+wf");
|
||||
Flag_List[Nflags++] = str_lookup(Flag_Map, "ldraw");
|
||||
#endif
|
||||
|
||||
#ifdef sgi
|
||||
/* Warning: cannot mix direct i/o with others! */
|
||||
Flag_List[Nflags++] = str_lookup(Flag_Map, "dsync");
|
||||
Flag_List[Nflags++] = str_lookup(Flag_Map, "rsync");
|
||||
/* Flag_List[Nflags++] = str_lookup(Flag_Map, "rsync+sync");*/
|
||||
/* Flag_List[Nflags++] = str_lookup(Flag_Map, "rsync+dsync");*/
|
||||
#endif
|
||||
}
|
||||
|
||||
if (Fileio) {
|
||||
@@ -1897,26 +1623,12 @@ FILE *stream;
|
||||
fprintf(stream, "\n");
|
||||
#ifndef linux
|
||||
fprintf(stream, "\t-a aio_type,... Async io completion types to choose. Supported types\n");
|
||||
#ifdef CRAY
|
||||
#if _UMK || RELEASE_LEVEL >= 8000
|
||||
fprintf(stream, "\t are: poll, signal, recall, recalla, and recalls.\n");
|
||||
#else
|
||||
fprintf(stream, "\t are: poll, signal, recalla, and recalls.\n");
|
||||
#endif
|
||||
#else
|
||||
fprintf(stream, "\t are: poll, signal, suspend, and callback.\n");
|
||||
#endif
|
||||
fprintf(stream, "\t Default is all of the above.\n");
|
||||
#else /* !linux */
|
||||
fprintf(stream, "\t-a (Not used on Linux).\n");
|
||||
#endif /* !linux */
|
||||
fprintf(stream, "\t-f flag,... Flags to use for file IO. Supported flags are\n");
|
||||
#ifdef CRAY
|
||||
fprintf(stream, "\t raw, ssd, buffered, ldraw, sync,\n");
|
||||
fprintf(stream, "\t raw+wf, raw+wf+ldraw, raw+wf+ldraw+sync,\n");
|
||||
fprintf(stream, "\t and parallel (unicos/mk on MPP only).\n");
|
||||
fprintf(stream, "\t Default is 'raw,ldraw,sync,buffered'.\n");
|
||||
#else
|
||||
#ifndef NO_XFS
|
||||
fprintf(stream, "\t buffered, direct, sync.\n");
|
||||
fprintf(stream, "\t Default is 'buffered,sync'.\n");
|
||||
@@ -1924,17 +1636,12 @@ FILE *stream;
|
||||
fprintf(stream, "\t buffered, sync.\n");
|
||||
fprintf(stream, "\t Default is 'buffered,sync'.\n");
|
||||
#endif /* sgi */
|
||||
#endif /* CRAY */
|
||||
fprintf(stream, "\t-h This help.\n");
|
||||
fprintf(stream, "\t-i iterations[s] # of requests to generate. 0 means causes iogen\n");
|
||||
fprintf(stream, "\t to run until it's killed. If iterations is suffixed\n");
|
||||
fprintf(stream, "\t with 's', then iterations is the number of seconds\n");
|
||||
fprintf(stream, "\t that iogen should run for. Default is '0'.\n");
|
||||
#ifndef CRAY
|
||||
fprintf(stream, "\t-L min:max listio nstrides / nrequests range\n");
|
||||
#else
|
||||
fprintf(stream, "\t-L (Not used on this platform).\n");
|
||||
#endif /* !CRAY */
|
||||
fprintf(stream, "\t-m offset-mode The mode by which iogen chooses the offset for\n");
|
||||
fprintf(stream, "\t consectutive transfers within a given file.\n");
|
||||
fprintf(stream, "\t Allowed values are 'random', 'sequential',\n");
|
||||
@@ -1943,9 +1650,6 @@ FILE *stream;
|
||||
fprintf(stream, "\t-N tagname Tag name, for Monster.\n");
|
||||
fprintf(stream, "\t-o Form overlapping consecutive requests.\n");
|
||||
fprintf(stream, "\t-O Open flags for creating files\n");
|
||||
#ifdef CRAY
|
||||
fprintf(stream, "\t {O_PLACE,O_BIG,etc}[:CBITS[:CBLKS]]\n");
|
||||
#endif
|
||||
#ifndef NO_XFS
|
||||
fprintf(stream, "\t realtime:extsize - put file on real-time volume\n");
|
||||
fprintf(stream, "\t allocate - allocate space with F_ALLOCSP\n");
|
||||
@@ -1959,17 +1663,6 @@ FILE *stream;
|
||||
fprintf(stream, "\t-q Quiet mode. Normally iogen spits out info\n");
|
||||
fprintf(stream, "\t about test files, options, etc. before starting.\n");
|
||||
fprintf(stream, "\t-s syscall,... Syscalls to do. Supported syscalls are\n");
|
||||
#ifdef sgi
|
||||
fprintf(stream, "\t read, write, pread, pwrite, readv, writev\n");
|
||||
fprintf(stream, "\t aread, awrite, resvsp, unresvsp, ffsync,\n");
|
||||
fprintf(stream, "\t mmread, mmwrite, fsync2, fdatasync,\n");
|
||||
fprintf(stream, "\t Default is 'read,write,pread,pwrite,readv,writev,mmread,mmwrite'.\n");
|
||||
#endif
|
||||
#ifdef CRAY
|
||||
fprintf(stream, "\t read, write, reada, writea, listio,\n");
|
||||
fprintf(stream, "\t ssread (PVP only), and sswrite (PVP only).\n");
|
||||
fprintf(stream, "\t Default is 'read,write,reada,writea,listio'.\n");
|
||||
#endif
|
||||
#ifdef linux
|
||||
fprintf(stream, "\t read, write, pread, pwrite, readv, writev,\n");
|
||||
fprintf(stream, "\t mmread, mmwrite, fsync2, fdatasync,\n");
|
||||
|
||||
Reference in New Issue
Block a user