Remove public uvm_swap_stats() routine, keep it internal.

This commit is contained in:
rmind 2011-04-27 00:35:52 +00:00
parent 5e6a27ebbb
commit fe41737f5c
4 changed files with 12 additions and 51 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: uvm.9,v 1.103 2010/11/08 02:56:12 dholland Exp $
.\" $NetBSD: uvm.9,v 1.104 2011/04/27 00:35:53 rmind Exp $
.\"
.\" Copyright (c) 1998 Matthew R. Green
.\" All rights reserved.
@ -772,8 +772,6 @@ and should match what was used for previous call to
.Fn uvn_findpages "struct uvm_object *uobj" "voff_t offset" "int *npagesp" "struct vm_page **pps" "int flags" ;
.It Ft void
.Fn uvm_vnp_setsize "struct vnode *vp" "voff_t newsize" ;
.It Ft void
.Fn uvm_swap_stats "int cmd" "struct swapent *sep" "int sec" "register_t *retval" ;
.El
.Pp
The
@ -894,26 +892,6 @@ to
Caller must hold a reference to the vnode.
If the vnode shrinks, pages no longer used are discarded.
.Pp
.Fn uvm_swap_stats
implements the
.Dv SWAP_STATS
and
.Dv SWAP_OSTATS
operation of the
.Xr swapctl 2
system call.
.Fa cmd
is the requested command,
.Dv SWAP_STATS
or
.Dv SWAP_OSTATS .
The function will copy no more than
.Fa sec
entries in the array pointed by
.Fa sep .
On return,
.Fa retval
holds the actual number of entries copied in the array.
.Sh SYSCTL
UVM provides support for the
.Dv CTL_VM

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_swap.c,v 1.154 2011/04/23 18:14:13 rmind Exp $ */
/* $NetBSD: uvm_swap.c,v 1.155 2011/04/27 00:35:52 rmind Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.154 2011/04/23 18:14:13 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.155 2011/04/27 00:35:52 rmind Exp $");
#include "opt_uvmhist.h"
#include "opt_compat_netbsd.h"
@ -107,7 +107,7 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.154 2011/04/23 18:14:13 rmind Exp $")
* [2] SWAP_STATS: given a pointer to an array of swapent structures
* (passed in via "arg") of a size passed in via "misc" ... we load
* the current swap config into the array. The actual work is done
* in the uvm_swap_stats(9) function.
* in the uvm_swap_stats() function.
* [3] SWAP_ON: given a pathname in arg (could be device or file) and a
* priority in "misc", start swapping on it.
* [4] SWAP_OFF: as SWAP_ON, but stops swapping to a device
@ -238,7 +238,7 @@ static void swaplist_trim(void);
static int swap_on(struct lwp *, struct swapdev *);
static int swap_off(struct lwp *, struct swapdev *);
static void uvm_swap_stats_locked(int, struct swapent *, int, register_t *);
static void uvm_swap_stats(int, struct swapent *, int, register_t *);
static void sw_reg_strategy(struct swapdev *, struct buf *, int);
static void sw_reg_biodone(struct buf *);
@ -513,7 +513,7 @@ sys_swapctl(struct lwp *l, const struct sys_swapctl_args *uap, register_t *retva
len = sizeof(struct swapent) * misc;
sep = (struct swapent *)malloc(len, M_TEMP, M_WAITOK);
uvm_swap_stats_locked(SCARG(uap, cmd), sep, misc, retval);
uvm_swap_stats(SCARG(uap, cmd), sep, misc, retval);
error = copyout(sep, SCARG(uap, arg), len);
free(sep, M_TEMP);
@ -723,7 +723,7 @@ out:
}
/*
* swap_stats: implements swapctl(SWAP_STATS). The function is kept
* uvm_swap_stats: implements swapctl(SWAP_STATS). The function is kept
* away from sys_swapctl() in order to allow COMPAT_* swapctl()
* emulation to use it directly without going through sys_swapctl().
* The problem with using sys_swapctl() there is that it involves
@ -731,17 +731,8 @@ out:
* is not known at build time. Hence it would not be possible to
* ensure it would fit in the stackgap in any case.
*/
void
uvm_swap_stats(int cmd, struct swapent *sep, int sec, register_t *retval)
{
rw_enter(&swap_syscall_lock, RW_READER);
uvm_swap_stats_locked(cmd, sep, sec, retval);
rw_exit(&swap_syscall_lock);
}
static void
uvm_swap_stats_locked(int cmd, struct swapent *sep, int sec, register_t *retval)
uvm_swap_stats(int cmd, struct swapent *sep, int sec, register_t *retval)
{
struct swappri *spp;
struct swapdev *sdp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_swap.h,v 1.17 2008/05/29 14:51:27 mrg Exp $ */
/* $NetBSD: uvm_swap.h,v 1.18 2011/04/27 00:35:52 rmind Exp $ */
/*
* Copyright (c) 1997 Matthew R. Green
@ -50,7 +50,6 @@ bool uvm_swapisfull(void);
#else /* defined(VMSWAP) */
#define uvm_swapisfull() true
#endif /* defined(VMSWAP) */
void uvm_swap_stats(int, struct swapent *, int, register_t *);
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_swapstub.c,v 1.6 2008/01/08 06:25:55 matt Exp $ */
/* $NetBSD: uvm_swapstub.c,v 1.7 2011/04/27 00:35:52 rmind Exp $ */
/*-
* Copyright (c)2005 YAMAMOTO Takashi,
@ -27,11 +27,11 @@
*/
/*
* dummy routines used when "options VMSWAP" is not configured.
* Dummy routines used when "options VMSWAP" is not configured.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_swapstub.c,v 1.6 2008/01/08 06:25:55 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_swapstub.c,v 1.7 2011/04/27 00:35:52 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -53,10 +53,3 @@ sys_swapctl(struct lwp *l, const struct sys_swapctl_args *v, register_t *retval)
return ENOSYS;
}
void
uvm_swap_stats(int cmd, struct swapent *sep, int sec, register_t *retval)
{
*retval = 0;
}