always skip the first 8K of swap. Yes, 8K, not some manufactured number that ends...
authorderaadt <deraadt@openbsd.org>
Thu, 10 Apr 1997 13:48:50 +0000 (13:48 +0000)
committerderaadt <deraadt@openbsd.org>
Thu, 10 Apr 1997 13:48:50 +0000 (13:48 +0000)
sys/vm/vm_param.h
sys/vm/vm_swap.c

index 5c155ce..1348b90 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vm_param.h,v 1.7 1996/10/23 15:38:38 deraadt Exp $    */
+/*     $OpenBSD: vm_param.h,v 1.8 1997/04/10 13:48:50 deraadt Exp $    */
 /*     $NetBSD: vm_param.h,v 1.12 1995/03/26 20:39:16 jtc Exp $        */
 
 /* 
@@ -119,6 +119,8 @@ struct _ps_strings {
        void    *val;
 };
 
+#define SWAPSKIPBYTES  8192    /* never use at the start of a swap space */
+
 /* 
  *     Return values from the VM routines.
  */
index 64d3382..70cfcbe 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vm_swap.c,v 1.3 1997/02/17 07:38:20 mickey Exp $      */
+/*     $OpenBSD: vm_swap.c,v 1.4 1997/04/10 13:48:51 deraadt Exp $     */
 /*     $NetBSD: vm_swap.c,v 1.32 1996/02/05 01:54:09 christos Exp $    */
 
 /*
@@ -439,15 +439,15 @@ swfree(p, index)
                         * Don't use the first cluster of the device
                         * in case it starts with a label or boot block.
                         */
-                       rminit(swapmap, blk - ctod(CLSIZE),
-                           vsbase + ctod(CLSIZE), "swap", nswapmap);
+                       rminit(swapmap, blk - ctod(btoc(SWAPSKIPBYTES)),
+                           vsbase + ctod(btoc(SWAPSKIPBYTES)), "swap", nswapmap);
                } else if (dvbase == 0) {
                        /*
                         * Don't use the first cluster of the device
                         * in case it starts with a label or boot block.
                         */
-                       rmfree(swapmap, blk - ctod(CLSIZE),
-                           vsbase + ctod(CLSIZE));
+                       rmfree(swapmap, blk - ctod(btoc(SWAPSKIPBYTES)),
+                           vsbase + ctod(btoc(SWAPSKIPBYTES)));
                } else
                        rmfree(swapmap, blk, vsbase);
        }