From 7c4d12fa9f16278c0ca81156ecae9ba15b875043 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Fri, 14 Jan 2000 19:23:35 +0000 Subject: 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). --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/ufs/ffs/ffs_alloc.c') 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); } -- cgit v1.2.3