Subject: mod to ffs_alloc.c for one-rotation-pos filesys
To: None <netbsd-help@netbsd.org>
From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>
List: netbsd-help
Date: 12/21/1994 21:14:57
A while back it was deemed wise to use "newfs -a 8 -d 0 -n 1" as the
defaults.  I remade my filesystems and posted about this to usenet.  A
response came back saying there was a flaw in using only one
rotational position: allocation would be randomized.

Is this true?  Does the following patch fix it?

--- ffs_alloc.c.DIST	Sun Dec 11 17:47:38 1994
+++ ffs_alloc.c.new	Sun Dec 11 17:48:40 1994
@@ -900,6 +900,13 @@
 		goto gotit;
 	}
 	/*
+	 * if there is only one rotational position, then scan sequentially
+	 * for the next block ... this is better than the code below, which
+	 * will choose a random block within what it believes to be a cylinder
+	 */
+	 if (fs->fs_nrpos <= 1)
+		goto norot;
+	/*
 	 * check for a block available on the same cylinder
 	 */
 	cylno = cbtocylno(fs, bpref);

K/
/S