Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2017 10:17:00 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323018 - head/sys/vm
Message-ID:  <201708301017.v7UAH02t059726@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Aug 30 10:17:00 2017
New Revision: 323018
URL: https://svnweb.freebsd.org/changeset/base/323018

Log:
  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

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Wed Aug 30 09:44:05 2017	(r323017)
+++ head/sys/vm/swap_pager.c	Wed Aug 30 10:17:00 2017	(r323018)
@@ -2060,13 +2060,14 @@ done:
 /*
  * 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 nbl
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708301017.v7UAH02t059726>