svn commit: r310472 - stable/10/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Fri Dec 23 09:39:52 UTC 2016
Author: kib
Date: Fri Dec 23 09:39:50 2016
New Revision: 310472
URL: https://svnweb.freebsd.org/changeset/base/310472
Log:
MFC r310182:
In swp_pager_meta_free_all(), fix type of the index variable. Style.
Modified:
stable/10/sys/vm/swap_pager.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/vm/swap_pager.c
==============================================================================
--- stable/10/sys/vm/swap_pager.c Fri Dec 23 09:35:39 2016 (r310471)
+++ stable/10/sys/vm/swap_pager.c Fri Dec 23 09:39:50 2016 (r310472)
@@ -1997,30 +1997,30 @@ swp_pager_meta_free(vm_object_t object,
static void
swp_pager_meta_free_all(vm_object_t object)
{
- daddr_t index = 0;
+ struct swblock **pswap, *swap;
+ vm_pindex_t index;
+ daddr_t v;
+ int i;
VM_OBJECT_ASSERT_WLOCKED(object);
if (object->type != OBJT_SWAP)
return;
- while (object->un_pager.swp.swp_bcount) {
- struct swblock **pswap;
- struct swblock *swap;
-
+ index = 0;
+ while (object->un_pager.swp.swp_bcount != 0) {
mtx_lock(&swhash_mtx);
pswap = swp_pager_hash(object, index);
if ((swap = *pswap) != NULL) {
- int i;
-
for (i = 0; i < SWAP_META_PAGES; ++i) {
- daddr_t v = swap->swb_pages[i];
+ v = swap->swb_pages[i];
if (v != SWAPBLK_NONE) {
--swap->swb_count;
swp_pager_freeswapspace(v, 1);
}
}
if (swap->swb_count != 0)
- panic("swap_pager_meta_free_all: swb_count != 0");
+ panic(
+ "swap_pager_meta_free_all: swb_count != 0");
*pswap = swap->swb_hnext;
uma_zfree(swap_zone, swap);
--object->un_pager.swp.swp_bcount;
More information about the svn-src-stable
mailing list