summaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-10 13:48:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-10 13:48:52 +0000
commitbb95b4662677c2dd18cdfa95d1aae2d11fda3918 (patch)
tree3d266f3a8dfa7fa2778b3fae42968af9afa5c43e /sys/vm
parent7fd3720a96e621ac034ff0797b077a357d6778b2 (diff)
always skip the first 8K of swap. Yes, 8K, not some manufactured number that ends up being 4K
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_param.h4
-rw-r--r--sys/vm/vm_swap.c10
2 files changed, 8 insertions, 6 deletions
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);
}