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.
This commit is contained in:
Kirk McKusick 1999-12-01 19:33:12 +00:00
parent 35d9646783
commit 9f54c05286
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53996

View file

@ -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);
}