Adjust interface of swapon_check_swzone() to its actual usage.

The function return value is not used.  Its argument is always
swap_total/PAGE_SIZE, so make it not take any arguments.

Submitted by:	ota@j.email.ne.jp
PR:	221356
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-08-30 10:17:00 +00:00
parent f08b30995a
commit 35872e79b7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323018

View File

@ -2060,13 +2060,14 @@ sys_swapon(struct thread *td, struct swapon_args *uap)
/*
* Check that the total amount of swap currently configured does not
* exceed half the theoretical maximum. If it does, print a warning
* message and return -1; otherwise, return 0.
* message.
*/
static int
swapon_check_swzone(unsigned long npages)
static void
swapon_check_swzone(void)
{
unsigned long maxpages;
unsigned long maxpages, npages;
npages = swap_total / PAGE_SIZE;
/* absolute maximum we can handle assuming 100% efficiency */
maxpages = uma_zone_get_max(swblk_zone) * SWAP_META_PAGES;
@ -2077,9 +2078,7 @@ swapon_check_swzone(unsigned long npages)
npages, maxpages / 2);
printf("warning: increase kern.maxswzone "
"or reduce amount of swap.\n");
return (-1);
}
return (0);
}
static void
@ -2147,7 +2146,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks,
nswapdev++;
swap_pager_avail += nblks - 2;
swap_total += (vm_ooffset_t)nblks * PAGE_SIZE;
swapon_check_swzone(swap_total / PAGE_SIZE);
swapon_check_swzone();
swp_sizecheck();
mtx_unlock(&sw_dev_mtx);
EVENTHANDLER_INVOKE(swapon, sp);