diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 5771a9c60dd3..0fb5d2203113 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 48ddf0011f29..23fc08508846 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 cff7cf6afc69..b94854e1ac6d 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 3f75289053a5..14530af9b47e 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) {