summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-01-03 14:30:46 +0000
committerphk <phk@FreeBSD.org>2003-01-03 14:30:46 +0000
commit88bd74d1841dba3f36f98fb64c7e2a630af3489f (patch)
tree1d1c4afb47b6f3606e254d491ad14375a8a3f8bd /sys/vm
parent2f7baffed6ea2747341f4ac70543257dcd1b16cc (diff)
downloadFreeBSD-src-88bd74d1841dba3f36f98fb64c7e2a630af3489f.zip
FreeBSD-src-88bd74d1841dba3f36f98fb64c7e2a630af3489f.tar.gz
Avoid extern decls in .c files by putting them in the vm/swap_pager.h
include file where they belong. Share the dmmax_mask variable.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c13
-rw-r--r--sys/vm/swap_pager.h9
-rw-r--r--sys/vm/vm_pageout.c1
-rw-r--r--sys/vm/vm_swap.c5
4 files changed, 12 insertions, 16 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 5771a9c..0fb5d22 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -104,12 +104,6 @@
#define SWM_FREE 0x02 /* free, period */
#define SWM_POP 0x04 /* pop out */
-/*
- * vm_swap_size is in page-sized chunks now. It was DEV_BSIZE'd chunks
- * in the old system.
- */
-extern int vm_swap_size; /* number of free swap blocks, in pages */
-
int swap_pager_full; /* swap space exhaustion (task killing) */
static int swap_pager_almost_full; /* swap space exhaustion (w/ hysteresis)*/
static int nsw_rcount; /* free read buffers */
@@ -124,10 +118,6 @@ static int swhash_mask;
static int swap_async_max = 4; /* maximum in-progress async I/O's */
static struct sx sw_alloc_sx;
-/* from vm_swap.c */
-extern struct vnode *swapdev_vp;
-extern struct swdevt *swdevt;
-extern int nswdev;
SYSCTL_INT(_vm, OID_AUTO, swap_async_max,
CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops");
@@ -185,8 +175,7 @@ static void waitchainbuf(struct bio *bp, int count, int done);
* swap_*() routines are externally accessible. swp_*() routines are
* internal.
*/
-int dmmax;
-static int dmmax_mask;
+int dmmax, dmmax_mask;
int nswap_lowat = 128; /* in pages, swap_pager_almost_full warn */
int nswap_hiwat = 512; /* in pages, swap_pager_almost_full warn */
diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h
index 48ddf00..23fc085 100644
--- a/sys/vm/swap_pager.h
+++ b/sys/vm/swap_pager.h
@@ -84,6 +84,15 @@ extern int swap_pager_full;
extern struct blist *swapblist;
extern struct uma_zone *swap_zone;
extern int nswap_lowat, nswap_hiwat;
+extern int dmmax, dmmax_mask;
+extern struct vnode *swapdev_vp;
+extern struct swdevt *swdevt;
+extern int nswdev;
+/*
+ * vm_swap_size is in page-sized chunks now. It was DEV_BSIZE'd chunks
+ * in the old system.
+ */
+extern int vm_swap_size; /* number of free swap blocks, in pages */
void swap_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *);
boolean_t swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after);
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index cff7cf6..b94854e 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -144,7 +144,6 @@ int vm_pageout_pages_needed=0; /* flag saying that the pageout daemon needs page
static int vm_pageout_req_swapout; /* XXX */
static int vm_daemon_needed;
#endif
-extern int vm_swap_size;
static int vm_max_launder = 32;
static int vm_pageout_stats_max=0, vm_pageout_stats_interval = 0;
static int vm_pageout_full_stats_interval = 0;
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 3f75289..14530af 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -67,7 +67,6 @@
*/
typedef int32_t swblk_t; /* swap offset */
-extern int dmmax;
#ifndef NSWAPDEV
#define NSWAPDEV 4
@@ -351,7 +350,7 @@ swaponvp(td, vp, dev, nblks)
* DEV_BSIZE'd. aligned_nblks is used to calculate the
* size of the swap bitmap, taking into account the stripe size.
*/
- aligned_nblks = (nblks + (dmmax - 1)) & ~(u_long)(dmmax - 1);
+ aligned_nblks = (nblks + dmmax_mask) & ~(u_long)dmmax_mask;
if (aligned_nblks * nswdev > nswap)
nswap = aligned_nblks * nswdev;
@@ -470,7 +469,7 @@ found:
nblks = max(nblks, sp->sw_nblks);
}
- aligned_nblks = (nblks + (dmmax - 1)) & ~(u_long)(dmmax - 1);
+ aligned_nblks = (nblks + dmmax_mask) & ~(u_long)dmmax_mask;
nswap = aligned_nblks * nswdev;
if (nswap == 0) {
OpenPOWER on IntegriCloud