Module Name:    src
Committed By:   rmind
Date:           Wed Apr 27 00:35:53 UTC 2011

Modified Files:
        src/share/man/man9: uvm.9
        src/sys/uvm: uvm_swap.c uvm_swap.h uvm_swapstub.c

Log Message:
Remove public uvm_swap_stats() routine, keep it internal.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/share/man/man9/uvm.9
cvs rdiff -u -r1.154 -r1.155 src/sys/uvm/uvm_swap.c
cvs rdiff -u -r1.17 -r1.18 src/sys/uvm/uvm_swap.h
cvs rdiff -u -r1.6 -r1.7 src/sys/uvm/uvm_swapstub.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/uvm.9
diff -u src/share/man/man9/uvm.9:1.103 src/share/man/man9/uvm.9:1.104
--- src/share/man/man9/uvm.9:1.103	Mon Nov  8 02:56:12 2010
+++ src/share/man/man9/uvm.9	Wed Apr 27 00:35:53 2011
@@ -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

Index: src/sys/uvm/uvm_swap.c
diff -u src/sys/uvm/uvm_swap.c:1.154 src/sys/uvm/uvm_swap.c:1.155
--- src/sys/uvm/uvm_swap.c:1.154	Sat Apr 23 18:14:13 2011
+++ src/sys/uvm/uvm_swap.c	Wed Apr 27 00:35:52 2011
@@ -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,17 +731,8 @@
  * 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;

Index: src/sys/uvm/uvm_swap.h
diff -u src/sys/uvm/uvm_swap.h:1.17 src/sys/uvm/uvm_swap.h:1.18
--- src/sys/uvm/uvm_swap.h:1.17	Thu May 29 14:51:27 2008
+++ src/sys/uvm/uvm_swap.h	Wed Apr 27 00:35:52 2011
@@ -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 */
 

Index: src/sys/uvm/uvm_swapstub.c
diff -u src/sys/uvm/uvm_swapstub.c:1.6 src/sys/uvm/uvm_swapstub.c:1.7
--- src/sys/uvm/uvm_swapstub.c:1.6	Tue Jan  8 06:25:55 2008
+++ src/sys/uvm/uvm_swapstub.c	Wed Apr 27 00:35:52 2011
@@ -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;
-}

Reply via email to