Add vm_object locking to vmspace_swap_count().
This commit is contained in:
parent
3edc7b4e0b
commit
8ba20a48bd
@ -363,15 +363,16 @@ vmspace_swap_count(struct vmspace *vmspace)
|
||||
vm_object_t object;
|
||||
|
||||
if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 &&
|
||||
(object = cur->object.vm_object) != NULL &&
|
||||
object->type == OBJT_SWAP
|
||||
) {
|
||||
int n = (cur->end - cur->start) / PAGE_SIZE;
|
||||
(object = cur->object.vm_object) != NULL) {
|
||||
VM_OBJECT_LOCK(object);
|
||||
if (object->type == OBJT_SWAP &&
|
||||
object->un_pager.swp.swp_bcount != 0) {
|
||||
int n = (cur->end - cur->start) / PAGE_SIZE;
|
||||
|
||||
if (object->un_pager.swp.swp_bcount) {
|
||||
count += object->un_pager.swp.swp_bcount *
|
||||
SWAP_META_PAGES * n / object->size + 1;
|
||||
}
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
}
|
||||
}
|
||||
return (count);
|
||||
|
Loading…
x
Reference in New Issue
Block a user