aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_alloc.c
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-09-08 17:16:32 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-09-08 17:16:32 +0000
commit9eda220c0b7e67e3a53a486da47c3599786b84a5 (patch)
tree14cacb01d41ae6afc9696140ebb3ed3f6eaca155 /sys/ufs/ffs/ffs_alloc.c
parent1c6d84074a7d5fa6f3504a3a642a610a2d98de34 (diff)
downloadsrc-9eda220c0b7e67e3a53a486da47c3599786b84a5.tar.gz
src-9eda220c0b7e67e3a53a486da47c3599786b84a5.zip
Slight optimization for the standard case of rotdelay=0.
Notes
Notes: svn path=/head/; revision=10632
Diffstat (limited to 'sys/ufs/ffs/ffs_alloc.c')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index dc68aaefcc2d..c8e4f506c8aa 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
- * $Id: ffs_alloc.c,v 1.15 1995/08/07 08:16:32 davidg Exp $
+ * $Id: ffs_alloc.c,v 1.16 1995/08/25 19:40:26 bde Exp $
*/
#include <sys/param.h>
@@ -655,18 +655,18 @@ ffs_blkpref(ip, lbn, indx, bap)
* requested rotationally delayed by fs_rotdelay milliseconds.
*/
nextblk = bap[indx - 1] + fs->fs_frag;
- if (indx < fs->fs_maxcontig || bap[indx - fs->fs_maxcontig] +
+ if (fs->fs_rotdelay == 0 || indx < fs->fs_maxcontig ||
+ bap[indx - fs->fs_maxcontig] +
blkstofrags(fs, fs->fs_maxcontig) != nextblk)
return (nextblk);
- if (fs->fs_rotdelay != 0)
- /*
- * Here we convert ms of delay to frags as:
- * (frags) = (ms) * (rev/sec) * (sect/rev) /
- * ((sect/frag) * (ms/sec))
- * then round up to the next block.
- */
- nextblk += roundup(fs->fs_rotdelay * fs->fs_rps * fs->fs_nsect /
- (NSPF(fs) * 1000), fs->fs_frag);
+ /*
+ * Here we convert ms of delay to frags as:
+ * (frags) = (ms) * (rev/sec) * (sect/rev) /
+ * ((sect/frag) * (ms/sec))
+ * then round up to the next block.
+ */
+ nextblk += roundup(fs->fs_rotdelay * fs->fs_rps * fs->fs_nsect /
+ (NSPF(fs) * 1000), fs->fs_frag);
return (nextblk);
}