Moving the kern.dumpdev sysctl handler from kern_sysctl.c to swapgeneric.c

is not real helpful since swapgeneric.c doesn't seem to be used, except
perhaps on a GENERIC kernel. (Sorry Paul.. :-)

I've moved it from swapgeneric.c to autoconf.c, since autoconf.c also deals
with dumpdev things.  There may be a better place.....
This commit is contained in:
Peter Wemm 1995-12-06 09:04:44 +00:00
parent f92e685bdf
commit 44036f9429
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12649
3 changed files with 39 additions and 22 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
* $Id: autoconf.c,v 1.43 1995/11/28 03:15:53 peter Exp $
* $Id: autoconf.c,v 1.44 1995/12/03 17:51:36 bde Exp $
*/
/*
@ -54,6 +54,7 @@
#include <sys/reboot.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/sysctl.h>
#include <machine/cons.h>
#include <machine/md_var.h>
@ -343,3 +344,20 @@ setroot()
mindev >> (majdev == FDMAJOR ? FDUNITSHIFT : PARTITIONSHIFT),
part + 'a');
}
static int
sysctl_kern_dumpdev SYSCTL_HANDLER_ARGS
{
int error;
dev_t ndumpdev;
ndumpdev = dumpdev;
error = sysctl_handle_opaque(oidp, &ndumpdev, sizeof ndumpdev, req);
if (!error && ndumpdev != dumpdev) {
error = setdumpdev(ndumpdev);
}
return (error);
}
SYSCTL_PROC(_kern, KERN_DUMPDEV, dumpdev, CTLTYPE_OPAQUE|CTLFLAG_RW,
0, sizeof dumpdev, sysctl_kern_dumpdev, "I", "");

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
* $Id: autoconf.c,v 1.43 1995/11/28 03:15:53 peter Exp $
* $Id: autoconf.c,v 1.44 1995/12/03 17:51:36 bde Exp $
*/
/*
@ -54,6 +54,7 @@
#include <sys/reboot.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/sysctl.h>
#include <machine/cons.h>
#include <machine/md_var.h>
@ -343,3 +344,20 @@ setroot()
mindev >> (majdev == FDMAJOR ? FDUNITSHIFT : PARTITIONSHIFT),
part + 'a');
}
static int
sysctl_kern_dumpdev SYSCTL_HANDLER_ARGS
{
int error;
dev_t ndumpdev;
ndumpdev = dumpdev;
error = sysctl_handle_opaque(oidp, &ndumpdev, sizeof ndumpdev, req);
if (!error && ndumpdev != dumpdev) {
error = setdumpdev(ndumpdev);
}
return (error);
}
SYSCTL_PROC(_kern, KERN_DUMPDEV, dumpdev, CTLTYPE_OPAQUE|CTLFLAG_RW,
0, sizeof dumpdev, sysctl_kern_dumpdev, "I", "");

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
* $Id: swapgeneric.c,v 1.13 1995/10/31 17:03:26 joerg Exp $
* $Id: swapgeneric.c,v 1.14 1995/12/04 16:47:43 phk Exp $
*/
#include <sys/param.h>
@ -44,7 +44,6 @@
#include <sys/reboot.h>
#include <sys/disklabel.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <sys/devconf.h>
#include <i386/i386/cons.h>
@ -66,24 +65,6 @@
dev_t rootdev = NODEV;
dev_t dumpdev = NODEV;
static int
sysctl_kern_dumpdev SYSCTL_HANDLER_ARGS
{
int error;
dev_t ndumpdev;
ndumpdev = dumpdev;
error = sysctl_handle_opaque(oidp, &ndumpdev, sizeof ndumpdev, req);
if (!error && ndumpdev != dumpdev) {
error = setdumpdev(ndumpdev);
}
return (error);
}
SYSCTL_PROC(_kern, KERN_DUMPDEV, dumpdev, CTLTYPE_OPAQUE|CTLFLAG_RW,
0, sizeof dumpdev, sysctl_kern_dumpdev, "");
#ifdef notused
int nswap;
struct swdevt swdevt[] = {