From: deraadt Date: Thu, 10 Apr 1997 13:48:50 +0000 (+0000) Subject: always skip the first 8K of swap. Yes, 8K, not some manufactured number that ends... X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2925ea10b3b148e7acf58dccf7624a2a5afc34e4;p=openbsd always skip the first 8K of swap. Yes, 8K, not some manufactured number that ends up being 4K --- diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index 5c155ce4c18..1348b9021d5 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -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. */ diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 64d3382ab18..70cfcbe3b90 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -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); }