Index: sys/kern/vfs_bio.c =================================================================== --- sys/kern/vfs_bio.c +++ sys/kern/vfs_bio.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -2829,9 +2830,9 @@ bool bogus; obj = bp->b_bufobj->bo_object; - KASSERT(obj->paging_in_progress >= bp->b_npages, + KASSERT(REFCOUNT_COUNT(obj->paging_in_progress) >= bp->b_npages, ("vfs_vmio_iodone: paging in progress(%d) < b_npages(%d)", - obj->paging_in_progress, bp->b_npages)); + REFCOUNT_COUNT(obj->paging_in_progress), bp->b_npages)); vp = bp->b_vp; KASSERT(vp->v_holdcnt > 0, Index: sys/vm/vm_fault.c =================================================================== --- sys/vm/vm_fault.c +++ sys/vm/vm_fault.c @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -339,7 +340,7 @@ { VM_OBJECT_ASSERT_WLOCKED(fs->first_object); - MPASS(fs->first_object->paging_in_progress > 0); + MPASS(REFCOUNT_COUNT(fs->first_object->paging_in_progress) > 0); if (!vm_map_trylock_read(fs->map)) { VM_OBJECT_WUNLOCK(fs->first_object); @@ -394,7 +395,7 @@ MPASS(fs->object == fs->first_object); VM_OBJECT_ASSERT_WLOCKED(fs->first_object); - MPASS(fs->first_object->paging_in_progress > 0); + MPASS(REFCOUNT_COUNT(fs->first_object->paging_in_progress) > 0); MPASS(fs->first_object->backing_object == NULL); MPASS(fs->lookup_still_valid); Index: sys/vm/vm_object.c =================================================================== --- sys/vm/vm_object.c +++ sys/vm/vm_object.c @@ -195,9 +195,9 @@ ("object %p has reservations", object)); #endif - KASSERT(object->paging_in_progress == 0, + KASSERT(REFCOUNT_COUNT(object->paging_in_progress) == 0, ("object %p paging_in_progress = %d", - object, object->paging_in_progress)); + object, REFCOUNT_COUNT(object->paging_in_progress))); KASSERT(object->resident_page_count == 0, ("object %p resident_page_count = %d", object, object->resident_page_count)); @@ -395,7 +395,7 @@ VM_OBJECT_ASSERT_WLOCKED(object); - while (object->paging_in_progress) { + while (REFCOUNT_COUNT(object->paging_in_progress)) { VM_OBJECT_WUNLOCK(object); refcount_wait(&object->paging_in_progress, waitid, PVM); VM_OBJECT_WLOCK(object); @@ -408,7 +408,7 @@ VM_OBJECT_ASSERT_UNLOCKED(object); - while (object->paging_in_progress) + while (REFCOUNT_COUNT(object->paging_in_progress)) refcount_wait(&object->paging_in_progress, waitid, PVM); } @@ -577,7 +577,7 @@ robject->ref_count++; retry: - if (robject->paging_in_progress) { + if (REFCOUNT_COUNT(robject->paging_in_progress)) { VM_OBJECT_WUNLOCK(object); vm_object_pip_wait(robject, "objde1"); @@ -586,7 +586,7 @@ VM_OBJECT_WLOCK(object); goto retry; } - } else if (object->paging_in_progress) { + } else if (REFCOUNT_COUNT(object->paging_in_progress)) { VM_OBJECT_WUNLOCK(robject); VM_OBJECT_WUNLOCK(object); refcount_wait( @@ -729,7 +729,7 @@ */ vm_object_pip_wait(object, "objtrm"); - KASSERT(!object->paging_in_progress, + KASSERT(!REFCOUNT_COUNT(object->paging_in_progress), ("vm_object_terminate: pageout in progress")); KASSERT(object->ref_count == 0, @@ -1660,8 +1660,8 @@ break; } - if (object->paging_in_progress != 0 || - backing_object->paging_in_progress != 0) { + if (REFCOUNT_COUNT(object->paging_in_progress) != 0 || + REFCOUNT_COUNT(backing_object->paging_in_progress) != 0) { vm_object_qcollapse(object); VM_OBJECT_WUNLOCK(backing_object); break; Index: sys/vm/vm_swapout.c =================================================================== --- sys/vm/vm_swapout.c +++ sys/vm/vm_swapout.c @@ -90,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -193,7 +194,7 @@ goto unlock_return; VM_OBJECT_ASSERT_LOCKED(object); if ((object->flags & OBJ_UNMANAGED) != 0 || - object->paging_in_progress != 0) + REFCOUNT_COUNT(object->paging_in_progress) != 0) goto unlock_return; remove_mode = 0;