1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-06 13:09:50 +00:00

In swp_pager_meta_free_all(), fix type of the index variable. Style.

Noted and reviewed by:	alc (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2016-12-16 23:33:37 +00:00
parent aeb76c0bb7
commit 71057cd207
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=310182

View File

@ -1916,30 +1916,30 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count)
static void static void
swp_pager_meta_free_all(vm_object_t object) 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); VM_OBJECT_ASSERT_WLOCKED(object);
if (object->type != OBJT_SWAP) if (object->type != OBJT_SWAP)
return; return;
while (object->un_pager.swp.swp_bcount) { index = 0;
struct swblock **pswap; while (object->un_pager.swp.swp_bcount != 0) {
struct swblock *swap;
mtx_lock(&swhash_mtx); mtx_lock(&swhash_mtx);
pswap = swp_pager_hash(object, index); pswap = swp_pager_hash(object, index);
if ((swap = *pswap) != NULL) { if ((swap = *pswap) != NULL) {
int i;
for (i = 0; i < SWAP_META_PAGES; ++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) { if (v != SWAPBLK_NONE) {
--swap->swb_count; --swap->swb_count;
swp_pager_freeswapspace(v, 1); swp_pager_freeswapspace(v, 1);
} }
} }
if (swap->swb_count != 0) 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; *pswap = swap->swb_hnext;
uma_zfree(swap_zone, swap); uma_zfree(swap_zone, swap);
--object->un_pager.swp.swp_bcount; --object->un_pager.swp.swp_bcount;