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: o...@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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to