summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_alloc.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-01-14 19:23:35 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-01-14 19:23:35 +0000
commit7c4d12fa9f16278c0ca81156ecae9ba15b875043 (patch)
tree7401d89c58b0f5f516e640a1936f1842e3f0b80e /sys/ufs/ffs/ffs_alloc.c
parent95d7fd350067a23d8132c89e3d6e8b0c1d18acc0 (diff)
Try to allocate the first indirect block in the same cg as the inode.
This improves read speed for files of moderate size (100-500k). From FreeBSD (mckusick@FreeBSD.ORG).
Diffstat (limited to 'sys/ufs/ffs/ffs_alloc.c')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index d7895724a07..7562ea203b9 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.17 1999/12/06 06:50:11 art Exp $ */
+/* $OpenBSD: ffs_alloc.c,v 1.18 2000/01/14 19:23:34 art Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */
/*
@@ -686,7 +686,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);
}