Detect contiguous allocation at the beginning of files and
authorMargo Seltzer <margo@ucbvax.Berkeley.EDU>
Tue, 3 Nov 1992 07:58:43 +0000 (23:58 -0800)
committerMargo Seltzer <margo@ucbvax.Berkeley.EDU>
Tue, 3 Nov 1992 07:58:43 +0000 (23:58 -0800)
indirect blocks so that you can allocate "maxcontig" blocks before paying
a rot-delay.

SCCS-vsn: sys/ufs/ffs/ffs_alloc.c 7.39

usr/src/sys/ufs/ffs/ffs_alloc.c

index 866151a..3f7576e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_alloc.c 7.38 (Berkeley) %G%
+ *     @(#)ffs_alloc.c 7.39 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -446,9 +446,8 @@ ffs_blkpref(ip, lbn, indx, bap)
         * requested rotationally delayed by fs_rotdelay milliseconds.
         */
        nextblk = bap[indx - 1] + fs->fs_frag;
         * requested rotationally delayed by fs_rotdelay milliseconds.
         */
        nextblk = bap[indx - 1] + fs->fs_frag;
-       if (indx > fs->fs_maxcontig &&
-           bap[indx - fs->fs_maxcontig] + blkstofrags(fs, fs->fs_maxcontig)
-           != nextblk)
+       if (indx < fs->fs_maxcontig || bap[indx - fs->fs_maxcontig] +
+           blkstofrags(fs, fs->fs_maxcontig) != nextblk)
                return (nextblk);
        if (fs->fs_rotdelay != 0)
                /*
                return (nextblk);
        if (fs->fs_rotdelay != 0)
                /*