summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1995-02-27 17:43:57 +0000
committerse <se@FreeBSD.org>1995-02-27 17:43:57 +0000
commit912b81cc5edd966d4f29049d04e78b780e044575 (patch)
tree9d66c74cb16864424023b0f76cfab943e3560fac /sys/ufs
parent45a93efd7d55d1a637b4d4d0cc8f7a0a19225abf (diff)
downloadFreeBSD-src-912b81cc5edd966d4f29049d04e78b780e044575.zip
FreeBSD-src-912b81cc5edd966d4f29049d04e78b780e044575.tar.gz
Don't try to make use of useless rotational position optimisation,
if all free blocks are in the same bucket (i.e. NRPOS == 1). Else a free block is choosen, possibly from a different cylinder, even if the block succeeding bpref was free ... Submitted by: se
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 0efd3fc..dbffd8c 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
- * $Id: ffs_alloc.c,v 1.6 1995/01/09 16:05:17 davidg Exp $
+ * $Id: ffs_alloc.c,v 1.7 1995/02/14 06:14:28 phk Exp $
*/
#include <sys/param.h>
@@ -909,13 +909,7 @@ ffs_alloccgblk(fs, cgp, bpref)
bno = bpref;
goto gotit;
}
- /*
- * check for a block available on the same cylinder
- */
- cylno = cbtocylno(fs, bpref);
- if (cg_blktot(cgp)[cylno] == 0)
- goto norot;
- if (fs->fs_cpc == 0) {
+ if (fs->fs_nrpos <= 1 || fs->fs_cpc == 0) {
/*
* Block layout information is not available.
* Leaving bpref unchanged means we take the
@@ -927,6 +921,12 @@ ffs_alloccgblk(fs, cgp, bpref)
goto norot;
}
/*
+ * check for a block available on the same cylinder
+ */
+ cylno = cbtocylno(fs, bpref);
+ if (cg_blktot(cgp)[cylno] == 0)
+ goto norot;
+ /*
* check the summary information to see if a block is
* available in the requested cylinder starting at the
* requested rotational position and proceeding around.
OpenPOWER on IntegriCloud