Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2013 17:46:32 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254996 - head/sys/ufs/ffs
Message-ID:  <201308281746.r7SHkW0G075617@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Wed Aug 28 17:46:32 2013
New Revision: 254996
URL: http://svnweb.freebsd.org/changeset/base/254996

Log:
  In looking at block layouts as part of fixing filesystem block
  allocations under low free-space conditions (-r254995), determine
  that old block-preference search order used before -r249782 worked
  a bit better. This change reverts to that block-preference search order.
  
  MFC after:	2 weeks

Modified:
  head/sys/ufs/ffs/ffs_alloc.c

Modified: head/sys/ufs/ffs/ffs_alloc.c
==============================================================================
--- head/sys/ufs/ffs/ffs_alloc.c	Wed Aug 28 17:38:05 2013	(r254995)
+++ head/sys/ufs/ffs/ffs_alloc.c	Wed Aug 28 17:46:32 2013	(r254996)
@@ -1186,7 +1186,7 @@ ffs_dirpref(pip)
 			if (fs->fs_contigdirs[cg] < maxcontigdirs)
 				return ((ino_t)(fs->fs_ipg * cg));
 		}
-	for (cg = prefcg - 1; cg >= 0; cg--)
+	for (cg = 0; cg < prefcg; cg++)
 		if (fs->fs_cs(fs, cg).cs_ndir < maxndir &&
 		    fs->fs_cs(fs, cg).cs_nifree >= minifree &&
 	    	    fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
@@ -1199,7 +1199,7 @@ ffs_dirpref(pip)
 	for (cg = prefcg; cg < fs->fs_ncg; cg++)
 		if (fs->fs_cs(fs, cg).cs_nifree >= avgifree)
 			return ((ino_t)(fs->fs_ipg * cg));
-	for (cg = prefcg - 1; cg >= 0; cg--)
+	for (cg = 0; cg < prefcg; cg++)
 		if (fs->fs_cs(fs, cg).cs_nifree >= avgifree)
 			break;
 	return ((ino_t)(fs->fs_ipg * cg));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308281746.r7SHkW0G075617>