Add a new swapctl(2) command to unset the dump device.

This commit is contained in:
martin 2006-08-22 14:07:07 +00:00
parent eeb51ff4c3
commit c8872be34c
2 changed files with 11 additions and 3 deletions

View File

@ -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 */

View File

@ -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 <sys/cdefs.h>
__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