diff options
author | phk <phk@FreeBSD.org> | 1998-04-06 11:39:04 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-04-06 11:39:04 +0000 |
commit | 5394eb1aa3cdf7090fccb30f2c0582a00a048f6d (patch) | |
tree | 50dee2036a425d39257e464cc16613e0bbcb52ee /sys | |
parent | b4d5f008389cab25c002b2f49f8999c84c253e3b (diff) | |
download | FreeBSD-src-5394eb1aa3cdf7090fccb30f2c0582a00a048f6d.zip FreeBSD-src-5394eb1aa3cdf7090fccb30f2c0582a00a048f6d.tar.gz |
Use random() rather then than homegrown stuff.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_fat.c | 14 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_fat.c | 14 |
2 files changed, 6 insertions, 22 deletions
diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index d92ee3e..94322ae 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_fat.c,v 1.18 1998/02/20 13:11:49 bde Exp $ */ +/* $Id: msdosfs_fat.c,v 1.19 1998/03/28 07:22:03 ache Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.28 1997/11/17 15:36:49 ws Exp $ */ /*- @@ -787,22 +787,14 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) if (start) { if ((len = chainlength(pmp, start, count)) >= count) return (chainalloc(pmp, start, count, fillwith, retcluster, got)); - } else { - /* - * This is a new file, initialize start - */ - struct timeval tv; - - microtime(&tv); - start = (tv.tv_usec >> 10) | tv.tv_usec; + } else len = 0; - } /* * Start at a (pseudo) random place to maximize cluster runs * under multiple writers. */ - newst = (start * 1103515245 + 12345) % (pmp->pm_maxcluster + 1); + newst = random() % (pmp->pm_maxcluster + 1); foundl = 0; for (cn = newst; cn <= pmp->pm_maxcluster;) { diff --git a/sys/msdosfs/msdosfs_fat.c b/sys/msdosfs/msdosfs_fat.c index d92ee3e..94322ae 100644 --- a/sys/msdosfs/msdosfs_fat.c +++ b/sys/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_fat.c,v 1.18 1998/02/20 13:11:49 bde Exp $ */ +/* $Id: msdosfs_fat.c,v 1.19 1998/03/28 07:22:03 ache Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.28 1997/11/17 15:36:49 ws Exp $ */ /*- @@ -787,22 +787,14 @@ clusteralloc(pmp, start, count, fillwith, retcluster, got) if (start) { if ((len = chainlength(pmp, start, count)) >= count) return (chainalloc(pmp, start, count, fillwith, retcluster, got)); - } else { - /* - * This is a new file, initialize start - */ - struct timeval tv; - - microtime(&tv); - start = (tv.tv_usec >> 10) | tv.tv_usec; + } else len = 0; - } /* * Start at a (pseudo) random place to maximize cluster runs * under multiple writers. */ - newst = (start * 1103515245 + 12345) % (pmp->pm_maxcluster + 1); + newst = random() % (pmp->pm_maxcluster + 1); foundl = 0; for (cn = newst; cn <= pmp->pm_maxcluster;) { |