diff --git a/sys/sys/swap.h b/sys/sys/swap.h index 3b2e1a6453aa..6f97eeef7e30 100644 --- a/sys/sys/swap.h +++ b/sys/sys/swap.h @@ -1,4 +1,4 @@ -/* $NetBSD: swap.h,v 1.5 2000/11/17 11:32:55 mrg Exp $ */ +/* $NetBSD: swap.h,v 1.6 2006/08/22 14:07:07 martin Exp $ */ /* * Copyright (c) 1995, 1996, 1998 Matthew R. Green @@ -65,6 +65,7 @@ struct swapent { #define SWAP_STATS 6 /* get device info */ #define SWAP_DUMPDEV 7 /* use this device as dump device */ #define SWAP_GETDUMPDEV 8 /* use this device as dump device */ +#define SWAP_DUMPOFF 9 /* stop using the dump device */ #define SWF_INUSE 0x00000001 /* in use: we have swapped here */ #define SWF_ENABLE 0x00000002 /* enabled: we can swap here */ diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index c4dad292c8d6..9d941f557ea0 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.103 2006/07/21 16:48:54 ad Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.104 2006/08/22 14:07:07 martin Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Matthew R. Green @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.103 2006/07/21 16:48:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.104 2006/08/22 14:07:07 martin Exp $"); #include "fs_nfs.h" #include "opt_uvmhist.h" @@ -512,6 +512,13 @@ sys_swapctl(struct lwp *l, void *v, register_t *retval) &l->l_acflag))) goto out; + if (SCARG(uap, cmd) == SWAP_DUMPOFF) { + /* drop the current dump device */ + dumpdev = NODEV; + cpu_dumpconf(); + goto out; + } + /* * at this point we expect a path name in arg. we will * use namei() to gain a vnode reference (vref), and lock