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.
This commit is contained in:
parent
3ccbf2d533
commit
c410df597b
@ -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 */
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user