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:
-179
@@ -75,87 +75,8 @@ char *buffer;
|
||||
int bsize;
|
||||
int offset;
|
||||
{
|
||||
#if CRAY
|
||||
|
||||
int cnt;
|
||||
int tmp;
|
||||
char *chr;
|
||||
long *wptr;
|
||||
long word;
|
||||
int woff; /* file offset for the word */
|
||||
int boff; /* buffer offset or index */
|
||||
int num_full_words;
|
||||
|
||||
num_full_words = bsize/NBPW;
|
||||
boff = 0;
|
||||
|
||||
if ( cnt=(offset % NBPW) ) { /* partial word */
|
||||
|
||||
woff = offset - cnt;
|
||||
#if DEBUG
|
||||
printf("partial at beginning, cnt = %d, woff = %d\n", cnt, woff);
|
||||
#endif
|
||||
|
||||
word = ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) | LOWER16BITS(pid));
|
||||
|
||||
chr = (char *)&word;
|
||||
|
||||
for (tmp=0; tmp<cnt; tmp++) { /* skip unused bytes */
|
||||
chr++;
|
||||
}
|
||||
|
||||
for (; boff<(NBPW-cnt) && boff<bsize; boff++, chr++) {
|
||||
buffer[boff] = *chr;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* full words
|
||||
*/
|
||||
|
||||
num_full_words = (bsize-boff)/NBPW;
|
||||
|
||||
woff = offset+boff;
|
||||
|
||||
for (cnt=0; cnt<num_full_words; woff += NBPW, cnt++ ) {
|
||||
|
||||
word = ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) | LOWER16BITS(pid));
|
||||
|
||||
chr = (char *)&word;
|
||||
for(tmp=0; tmp<NBPW; tmp++, chr++) {
|
||||
buffer[boff++] = *chr;
|
||||
}
|
||||
/****** Only if wptr is a word ellined
|
||||
wptr = (long *)&buffer[boff];
|
||||
*wptr = word;
|
||||
boff += NBPW;
|
||||
*****/
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* partial word at end of buffer
|
||||
*/
|
||||
|
||||
if ( cnt=((bsize-boff) % NBPW) ) {
|
||||
#if DEBUG
|
||||
printf("partial at end\n");
|
||||
#endif
|
||||
word = ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) | LOWER16BITS(pid));
|
||||
|
||||
chr = (char *)&word;
|
||||
|
||||
for (tmp=0; tmp<cnt && boff<bsize; tmp++, chr++) {
|
||||
buffer[boff++] = *chr;
|
||||
}
|
||||
}
|
||||
|
||||
return bsize;
|
||||
|
||||
#else
|
||||
return -1; /* not support on non-64 bits word machines */
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -171,112 +92,12 @@ int bsize;
|
||||
int offset;
|
||||
char **errmsg;
|
||||
{
|
||||
#if CRAY
|
||||
|
||||
int cnt;
|
||||
int tmp;
|
||||
char *chr;
|
||||
long *wptr;
|
||||
long word;
|
||||
int woff; /* file offset for the word */
|
||||
int boff; /* buffer offset or index */
|
||||
int num_full_words;
|
||||
|
||||
|
||||
if ( errmsg != NULL ) {
|
||||
*errmsg = Errmsg;
|
||||
}
|
||||
|
||||
|
||||
num_full_words = bsize/NBPW;
|
||||
boff = 0;
|
||||
|
||||
if ( cnt=(offset % NBPW) ) { /* partial word */
|
||||
woff = offset - cnt;
|
||||
word = ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) | LOWER16BITS(pid));
|
||||
|
||||
chr = (char *)&word;
|
||||
|
||||
for (tmp=0; tmp<cnt; tmp++) { /* skip unused bytes */
|
||||
chr++;
|
||||
}
|
||||
|
||||
for (; boff<(NBPW-cnt) && boff<bsize; boff++, chr++) {
|
||||
if (buffer[boff] != *chr) {
|
||||
sprintf(Errmsg, "Data mismatch at offset %d, exp:%#o, act:%#o",
|
||||
offset+boff, *chr, buffer[boff]);
|
||||
return offset+boff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* full words
|
||||
*/
|
||||
|
||||
num_full_words = (bsize-boff)/NBPW;
|
||||
|
||||
woff = offset+boff;
|
||||
|
||||
for (cnt=0; cnt<num_full_words; woff += NBPW, cnt++ ) {
|
||||
word = ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) | LOWER16BITS(pid));
|
||||
|
||||
chr = (char *)&word;
|
||||
for(tmp=0; tmp<NBPW; tmp++, boff++, chr++) {
|
||||
if ( buffer[boff] != *chr ) {
|
||||
sprintf(Errmsg, "Data mismatch at offset %d, exp:%#o, act:%#o",
|
||||
woff, *chr, buffer[boff]);
|
||||
return woff;
|
||||
}
|
||||
}
|
||||
|
||||
/****** only if a word elined
|
||||
wptr = (long *)&buffer[boff];
|
||||
if ( *wptr != word ) {
|
||||
sprintf(Errmsg, "Data mismatch at offset %d, exp:%#o, act:%#o",
|
||||
woff, word, *wptr);
|
||||
return woff;
|
||||
}
|
||||
boff += NBPW;
|
||||
******/
|
||||
}
|
||||
|
||||
/*
|
||||
* partial word at end of buffer
|
||||
*/
|
||||
|
||||
if ( cnt=((bsize-boff) % NBPW) ) {
|
||||
#if DEBUG
|
||||
printf("partial at end\n");
|
||||
#endif
|
||||
word = ((LOWER16BITS(pid) << 48) | (LOWER32BITS(woff) << 16) | LOWER16BITS(pid));
|
||||
|
||||
chr = (char *)&word;
|
||||
|
||||
|
||||
for (tmp=0; tmp<cnt && boff<bsize; boff++, tmp++, chr++) {
|
||||
if ( buffer[boff] != *chr ) {
|
||||
sprintf(Errmsg, "Data mismatch at offset %d, exp:%#o, act:%#o",
|
||||
offset+boff, *chr, buffer[boff]);
|
||||
return offset+boff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(Errmsg, "all %d bytes match desired pattern", bsize);
|
||||
return -1; /* buffer is ok */
|
||||
|
||||
#else
|
||||
|
||||
if ( errmsg != NULL ) {
|
||||
*errmsg = Errmsg;
|
||||
}
|
||||
sprintf(Errmsg, "Not supported on this OS.");
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} /* end of datapidchk */
|
||||
|
||||
#if UNIT_TEST
|
||||
|
||||
+2
-32
@@ -338,27 +338,7 @@ char **errp;
|
||||
}
|
||||
|
||||
nmults = ((max - min) / mult) + 1;
|
||||
#if CRAY
|
||||
/*
|
||||
* If max is less than 2gb, then the value can fit in 32 bits
|
||||
* and the standard lrand48() routine can be used.
|
||||
*/
|
||||
if ( max <= (long)2147483647 ) {
|
||||
return (long) (min + (((long)lrand48() % nmults) * mult));
|
||||
} else {
|
||||
/*
|
||||
* max is greater than 2gb - meeds more than 32 bits.
|
||||
* Since lrand48 only will get a number up to 32bits.
|
||||
*/
|
||||
long randnum;
|
||||
randnum=divider(min, max, 0, -1);
|
||||
return (long) (min + ((randnum % nmults) * mult));
|
||||
}
|
||||
|
||||
#else
|
||||
return (min + ((lrand48() % nmults) * mult));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -430,7 +410,7 @@ char **errp;
|
||||
}
|
||||
|
||||
nmults = ((max - min) / mult) + 1;
|
||||
#if CRAY || (_MIPS_SZLONG == 64)
|
||||
#if (_MIPS_SZLONG == 64)
|
||||
/*
|
||||
* If max is less than 2gb, then the value can fit in 32 bits
|
||||
* and the standard lrand48() routine can be used.
|
||||
@@ -648,8 +628,6 @@ random_bit(long mask)
|
||||
/*
|
||||
* get the number of bits set in mask
|
||||
*/
|
||||
#ifndef CRAY
|
||||
|
||||
bit=1L;
|
||||
for ( nshift=0; nshift<sizeof(long)*8; nshift++) {
|
||||
if ( mask & bit )
|
||||
@@ -657,10 +635,6 @@ random_bit(long mask)
|
||||
bit=bit<<1;
|
||||
}
|
||||
|
||||
#else
|
||||
nbits=_popcnt(mask);
|
||||
#endif /* if CRAY */
|
||||
|
||||
/*
|
||||
* randomly choose a bit.
|
||||
*/
|
||||
@@ -740,14 +714,10 @@ char **argv;
|
||||
int ind;
|
||||
int cnt, iter=10;
|
||||
int imin=0, imult=1, itmin, itmax=0;
|
||||
#if CRAY
|
||||
int imax=6*GIG; /* higher than 32 bits */
|
||||
#else
|
||||
int imax=1048576;
|
||||
#endif
|
||||
|
||||
long lret, lmin=0, lmult=1, ltmin, ltmax=0;
|
||||
#if CRAY || (_MIPS_SZLONG == 64)
|
||||
#if (_MIPS_SZLONG == 64)
|
||||
long lmax=6*(long)GIG; /* higher than 32 bits */
|
||||
#else
|
||||
long lmax=1048576;
|
||||
|
||||
+1
-5
@@ -43,11 +43,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CRAY
|
||||
#define B_MULT BSIZE /* block size */
|
||||
#elif sgi
|
||||
#define B_MULT BBSIZE /* block size */
|
||||
#elif linux
|
||||
#if linux
|
||||
#define B_MULT DEV_BSIZE /* block size */
|
||||
#endif
|
||||
|
||||
|
||||
+1
-776
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user