no swplo
[unix-history] / usr / src / sys / kern / init_main.c
index 570b58a..78338a3 100644 (file)
@@ -1,4 +1,4 @@
-/*     init_main.c     3.5     %G%     */
+/*     init_main.c     3.6     %G%     */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -179,6 +179,7 @@ binit()
        register struct buf *dp;
        register int i;
        struct bdevsw *bdp;
        register struct buf *dp;
        register int i;
        struct bdevsw *bdp;
+       struct swdevt *swp;
 
        bfreelist.b_forw = bfreelist.b_back =
            bfreelist.av_forw = bfreelist.av_back = &bfreelist;
 
        bfreelist.b_forw = bfreelist.b_back =
            bfreelist.av_forw = bfreelist.av_back = &bfreelist;
@@ -201,6 +202,19 @@ binit()
                }
                nblkdev++;
        }
                }
                nblkdev++;
        }
+       /*
+        * Count swap devices, and adjust total swap space available.
+        * Some of this space will not be available until a vswapon()
+        * system is issued, usually when the system goes multi-user.
+        */
+       nswdev = 0;
+       for (swp = swdevt; swp->sw_dev; swp++)
+               nswdev++;
+       if (nswdev == 0)
+               panic("binit");
+       nswap *= nswdev;
+       maxpgio *= nswdev;
+       swfree(0);
 }
 
 /*
 }
 
 /*