summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-01-26 11:08:40 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-01-26 11:08:40 +0000
commit793debffbb0046c0a6a428b9732013b47618b284 (patch)
treeb5da863fc8d13925b1584e03ab11a1c91907e3e6 /sys/ufs/ffs
parent8008a0b76cc510a89151340b4a79b7ce4c88f53f (diff)
remove ancient device-specific trick from ffs1_blkpref()
okay toby@ millert@
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 313ff679cbd..a17082fd06c 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_alloc.c,v 1.69 2007/01/07 15:39:22 sturm Exp $ */
+/* $OpenBSD: ffs_alloc.c,v 1.70 2007/01/26 11:08:39 pedro Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */
/*
@@ -1029,21 +1029,12 @@ end:
* indirect block, the information on the previous allocation is unavailable;
* here a best guess is made based upon the logical block number being
* allocated.
- *
- * If a section is already partially allocated, the policy is to
- * contiguously allocate fs_maxcontig blocks. The end of one of these
- * contiguous blocks and the beginning of the next is physically separated
- * so that the disk head will be in transit between them for at least
- * fs_rotdelay milliseconds. This is to allow time for the processor to
- * schedule another I/O transfer.
*/
ufs1_daddr_t
ffs1_blkpref(struct inode *ip, daddr_t lbn, int indx, ufs1_daddr_t *bap)
{
struct fs *fs;
- int cg;
- int avgbfree, startcg;
- ufs1_daddr_t nextblk;
+ int cg, avgbfree, startcg;
fs = ip->i_fs;
if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
@@ -1074,26 +1065,8 @@ ffs1_blkpref(struct inode *ip, daddr_t lbn, int indx, ufs1_daddr_t *bap)
}
return (0);
}
- /*
- * One or more previous blocks have been laid out. If less
- * than fs_maxcontig previous blocks are contiguous, the
- * next block is requested contiguously, otherwise it is
- * requested rotationally delayed by fs_rotdelay milliseconds.
- */
- nextblk = bap[indx - 1] + fs->fs_frag;
- if (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);
- return (nextblk);
+
+ return (bap[indx - 1] + fs->fs_frag);
}
/*