diff options
| author | Joe Perches <joe@perches.com> | 2007-05-07 23:49:03 -0400 |
|---|---|---|
| committer | Tim Shimmin <tes@sgi.com> | 2007-05-07 23:49:03 -0400 |
| commit | e7a23a9b37c395a153a541d4c50e166eef6abe49 (patch) | |
| tree | 11afa34a0a6d10c482f6b07f1d6d6788bd71ba11 /fs/xfs/support/debug.c | |
| parent | e9ed9d2240c71014a84043095af4465ffce61367 (diff) | |
[XFS] reducing the number of random number functions.
Patch provided by Joe Perches
SGI-PV: 961696
SGI-Modid: xfs-linux-melb:xfs-kern:28209a
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/support/debug.c')
| -rw-r--r-- | fs/xfs/support/debug.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c index 08bbd3cb87ae..f45a49ffd3a3 100644 --- a/fs/xfs/support/debug.c +++ b/fs/xfs/support/debug.c | |||
| @@ -81,20 +81,3 @@ assfail(char *expr, char *file, int line) | |||
| 81 | printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line); | 81 | printk("Assertion failed: %s, file: %s, line: %d\n", expr, file, line); |
| 82 | BUG(); | 82 | BUG(); |
| 83 | } | 83 | } |
| 84 | |||
| 85 | #if ((defined(DEBUG) || defined(INDUCE_IO_ERRROR)) && !defined(NO_WANT_RANDOM)) | ||
| 86 | unsigned long random(void) | ||
| 87 | { | ||
| 88 | static unsigned long RandomValue = 1; | ||
| 89 | /* cycles pseudo-randomly through all values between 1 and 2^31 - 2 */ | ||
| 90 | register long rv = RandomValue; | ||
| 91 | register long lo; | ||
| 92 | register long hi; | ||
| 93 | |||
| 94 | hi = rv / 127773; | ||
| 95 | lo = rv % 127773; | ||
| 96 | rv = 16807 * lo - 2836 * hi; | ||
| 97 | if (rv <= 0) rv += 2147483647; | ||
| 98 | return RandomValue = rv; | ||
| 99 | } | ||
| 100 | #endif /* DEBUG || INDUCE_IO_ERRROR || !NO_WANT_RANDOM */ | ||
