Update a couple vm_object lock assertions in the swap pager to reflect the

new use of the vm_object's lock to synchronize updates to a radix trie
mapping per-vm object page indices to on-disk swap blocks.

Fix a typo in a nearby comment.

Reviewed by:	kib, markj
X-MFC with:	r322913
Differential Revision:	https://reviews.freebsd.org/D12134
This commit is contained in:
Alan Cox 2017-08-28 17:02:25 +00:00
parent d5efa0a475
commit ee620ea47d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322971

View File

@ -1827,7 +1827,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count)
int i;
bool empty;
VM_OBJECT_ASSERT_LOCKED(object);
VM_OBJECT_ASSERT_WLOCKED(object);
if (object->type != OBJT_SWAP || count == 0)
return;
@ -1909,9 +1909,13 @@ swp_pager_meta_ctl(vm_object_t object, vm_pindex_t pindex, int flags)
daddr_t r1;
int i;
VM_OBJECT_ASSERT_LOCKED(object);
if ((flags & (SWM_FREE | SWM_POP)) != 0)
VM_OBJECT_ASSERT_WLOCKED(object);
else
VM_OBJECT_ASSERT_LOCKED(object);
/*
* The meta data only exists of the object is OBJT_SWAP
* The meta data only exists if the object is OBJT_SWAP
* and even then might not be allocated yet.
*/
if (object->type != OBJT_SWAP)