swap_pager_find_least(): assert that the function is called on the right object type

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37024
This commit is contained in:
Konstantin Belousov 2022-10-18 11:21:14 +03:00
parent 33ce178835
commit 5bd45b2ba3

View File

@ -2259,6 +2259,7 @@ swap_pager_find_least(vm_object_t object, vm_pindex_t pindex)
int i;
VM_OBJECT_ASSERT_LOCKED(object);
MPASS((object->flags & OBJ_SWAP) != 0);
if (pctrie_is_empty(&object->un_pager.swp.swp_blks))
return (object->size);