From cc9832baf42e4ec96d60f1d24eae419a7bc96521 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 8 May 2007 13:49:03 +1000 Subject: [PATCH] --- yaml --- r: 55137 b: refs/heads/master c: e7a23a9b37c395a153a541d4c50e166eef6abe49 h: refs/heads/master i: 55135: af48bde87b23063277fec3426b48f177bbf68252 v: v3 --- [refs] | 2 +- trunk/fs/xfs/support/debug.c | 17 ----------------- trunk/fs/xfs/support/debug.h | 2 +- trunk/fs/xfs/xfs_alloc.c | 2 +- trunk/fs/xfs/xfs_error.c | 2 +- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index aff6850fe2b4..53f8e6342b24 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e9ed9d2240c71014a84043095af4465ffce61367 +refs/heads/master: e7a23a9b37c395a153a541d4c50e166eef6abe49 diff --git a/trunk/fs/xfs/support/debug.c b/trunk/fs/xfs/support/debug.c index 08bbd3cb87ae..f45a49ffd3a3 100644 --- a/trunk/fs/xfs/support/debug.c +++ b/trunk/fs/xfs/support/debug.c @@ -81,20 +81,3 @@ assfail(char *expr, char *file, int line) printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line); BUG(); } - -#if ((defined(DEBUG) || defined(INDUCE_IO_ERRROR)) && !defined(NO_WANT_RANDOM)) -unsigned long random(void) -{ - static unsigned long RandomValue = 1; - /* cycles pseudo-randomly through all values between 1 and 2^31 - 2 */ - register long rv = RandomValue; - register long lo; - register long hi; - - hi = rv / 127773; - lo = rv % 127773; - rv = 16807 * lo - 2836 * hi; - if (rv <= 0) rv += 2147483647; - return RandomValue = rv; -} -#endif /* DEBUG || INDUCE_IO_ERRROR || !NO_WANT_RANDOM */ diff --git a/trunk/fs/xfs/support/debug.h b/trunk/fs/xfs/support/debug.h index 2a70cc605ae3..a27a7c8c0526 100644 --- a/trunk/fs/xfs/support/debug.h +++ b/trunk/fs/xfs/support/debug.h @@ -50,7 +50,7 @@ extern void assfail(char *expr, char *f, int l); #else /* DEBUG */ # define ASSERT(expr) ASSERT_ALWAYS(expr) -extern unsigned long random(void); +# include #ifndef STATIC # define STATIC noinline diff --git a/trunk/fs/xfs/xfs_alloc.c b/trunk/fs/xfs/xfs_alloc.c index e80dda3437d1..8e9a40aa0cd3 100644 --- a/trunk/fs/xfs/xfs_alloc.c +++ b/trunk/fs/xfs/xfs_alloc.c @@ -764,7 +764,7 @@ xfs_alloc_ag_vextent_near( */ int dofirst; /* set to do first algorithm */ - dofirst = random() & 1; + dofirst = random32() & 1; #endif /* * Get a cursor for the by-size btree. diff --git a/trunk/fs/xfs/xfs_error.c b/trunk/fs/xfs/xfs_error.c index b1af54464f00..8c4331631337 100644 --- a/trunk/fs/xfs/xfs_error.c +++ b/trunk/fs/xfs/xfs_error.c @@ -80,7 +80,7 @@ xfs_error_test(int error_tag, int *fsidp, char *expression, int i; int64_t fsid; - if (random() % randfactor) + if (random32() % randfactor) return 0; memcpy(&fsid, fsidp, sizeof(xfs_fsid_t));