alloc tables at boot time version
[unix-history] / usr / src / sys / kern / vfs_cluster.c
index 633b9f0..37ad963 100644 (file)
@@ -1,4 +1,4 @@
-/*     vfs_cluster.c   4.11    %G%     */
+/*     vfs_cluster.c   4.14    %G%     */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -60,7 +60,7 @@ struct {
        long    nreada;
        long    ncache;
        long    nwrite;
        long    nreada;
        long    ncache;
        long    nwrite;
-       long    bufcount[NBUF];
+       long    bufcount[64];
 } io_info;
 #endif
 
 } io_info;
 #endif
 
@@ -74,12 +74,12 @@ struct {
  * page push, when the I/O completes, it is inserted 
  * in a list of cleaned pages to be processed by the pageout daemon.
  */
  * page push, when the I/O completes, it is inserted 
  * in a list of cleaned pages to be processed by the pageout daemon.
  */
-struct buf swbuf[NSWBUF];
-short  swsize[NSWBUF];         /* CAN WE JUST USE B_BCOUNT? */
-int    swpf[NSWBUF];
+struct buf *swbuf;
+short  *swsize;                /* CAN WE JUST USE B_BCOUNT? */
+int    *swpf;
 
 
 
 
-#ifdef FASTVAX
+#ifndef        UNFAST
 #define        notavail(bp) \
 { \
        int s = spl6(); \
 #define        notavail(bp) \
 { \
        int s = spl6(); \
@@ -261,8 +261,11 @@ register struct buf *bp;
                bfreelist[0].b_flags &= ~B_WANTED;
                wakeup((caddr_t)bfreelist);
        }
                bfreelist[0].b_flags &= ~B_WANTED;
                wakeup((caddr_t)bfreelist);
        }
-       if ((bp->b_flags&B_ERROR) && bp->b_dev != NODEV)
-               bp->b_dev = NODEV;  /* no assoc. on error */
+       if (bp->b_flags&B_ERROR)
+               if (bp->b_flags & B_LOCKED)
+                       bp->b_flags &= ~B_ERROR;        /* try again later */
+               else
+                       bp->b_dev = NODEV;              /* no assoc */
        s = spl6();
        if (bp->b_flags & (B_ERROR|B_INVAL)) {
                /* block has no info ... put at front of most free list */
        s = spl6();
        if (bp->b_flags & (B_ERROR|B_INVAL)) {
                /* block has no info ... put at front of most free list */
@@ -358,7 +361,7 @@ daddr_t blkno;
                        i++;
                        dp = dp->av_forw;
                }
                        i++;
                        dp = dp->av_forw;
                }
-               if (i<NBUF)
+               if (i<64)
                        io_info.bufcount[i]++;
 #endif
                notavail(bp);
                        io_info.bufcount[i]++;
 #endif
                notavail(bp);
@@ -455,7 +458,7 @@ register struct buf *bp;
        geterror(bp);
 }
 
        geterror(bp);
 }
 
-#ifndef FASTVAX
+#ifdef UNFAST
 /*
  * Unlink a buffer from the available list and mark it busy.
  * (internal interface)
 /*
  * Unlink a buffer from the available list and mark it busy.
  * (internal interface)