summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>1999-12-01 19:33:12 +0000
committermckusick <mckusick@FreeBSD.org>1999-12-01 19:33:12 +0000
commit579c93e79305fd5f203f4fb5546c42fa53c347c0 (patch)
treef128e2ee241fdde3343c5d32e48d220b57808dfa
parent0636e4261d54b2b0f427976e6858d7674d6dba3e (diff)
downloadFreeBSD-src-579c93e79305fd5f203f4fb5546c42fa53c347c0.zip
FreeBSD-src-579c93e79305fd5f203f4fb5546c42fa53c347c0.tar.gz
Preferentially allocate the first indirect block in the same
cylinder group as the inode. This makes a 15% difference in read speed for files in the 96K to 500K size range.
-rw-r--r--sys/ufs/ffs/ffs_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 7444380..f676937 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -691,7 +691,7 @@ ffs_blkpref(ip, lbn, indx, bap)
fs = ip->i_fs;
if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
- if (lbn < NDADDR) {
+ if (lbn < NDADDR + NINDIR(fs)) {
cg = ino_to_cg(fs, ip->i_number);
return (fs->fs_fpg * cg + fs->fs_frag);
}
OpenPOWER on IntegriCloud