summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}