Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Remove public uvm_swap_stats() routine, keep it internal.
details: https://anonhg.NetBSD.org/src/rev/141601ccaf70
branches: trunk
changeset: 764548:141601ccaf70
user: rmind <rmind%NetBSD.org@localhost>
date: Wed Apr 27 00:35:52 2011 +0000
description:
Remove public uvm_swap_stats() routine, keep it internal.
diffstat:
share/man/man9/uvm.9 | 24 +-----------------------
sys/uvm/uvm_swap.c | 23 +++++++----------------
sys/uvm/uvm_swap.h | 3 +--
sys/uvm/uvm_swapstub.c | 13 +++----------
4 files changed, 12 insertions(+), 51 deletions(-)
diffs (170 lines):
diff -r 32b1589c6192 -r 141601ccaf70 share/man/man9/uvm.9
--- a/share/man/man9/uvm.9 Wed Apr 27 00:00:46 2011 +0000
+++ b/share/man/man9/uvm.9 Wed Apr 27 00:35:52 2011 +0000
@@ -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 @@
.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 @@
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
diff -r 32b1589c6192 -r 141601ccaf70 sys/uvm/uvm_swap.c
--- a/sys/uvm/uvm_swap.c Wed Apr 27 00:00:46 2011 +0000
+++ b/sys/uvm/uvm_swap.c Wed Apr 27 00:35:52 2011 +0000
@@ -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 @@
* [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 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 @@
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 @@
}
/*
- * 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,18 +731,9 @@
* is not known at build time. Hence it would not be possible to
* ensure it would fit in the stackgap in any case.
*/
-void
+static 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)
-{
struct swappri *spp;
struct swapdev *sdp;
int count = 0;
diff -r 32b1589c6192 -r 141601ccaf70 sys/uvm/uvm_swap.h
--- a/sys/uvm/uvm_swap.h Wed Apr 27 00:00:46 2011 +0000
+++ b/sys/uvm/uvm_swap.h Wed Apr 27 00:35:52 2011 +0000
@@ -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 @@
#else /* defined(VMSWAP) */
#define uvm_swapisfull() true
#endif /* defined(VMSWAP) */
-void uvm_swap_stats(int, struct swapent *, int, register_t *);
#endif /* _KERNEL */
diff -r 32b1589c6192 -r 141601ccaf70 sys/uvm/uvm_swapstub.c
--- a/sys/uvm/uvm_swapstub.c Wed Apr 27 00:00:46 2011 +0000
+++ b/sys/uvm/uvm_swapstub.c Wed Apr 27 00:35:52 2011 +0000
@@ -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 @@
return ENOSYS;
}
-
-void
-uvm_swap_stats(int cmd, struct swapent *sep, int sec, register_t *retval)
-{
-
- *retval = 0;
-}
Home |
Main Index |
Thread Index |
Old Index