mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Lock accesses to the vm_object's ref_count and resident_page_count.
This commit is contained in:
parent
b05deb9bc1
commit
ebba1b25f9
1 changed files with 9 additions and 5 deletions
|
|
@ -829,11 +829,15 @@ vcanrecycle(struct vnode *vp, struct mount **vnmpp)
|
|||
/*
|
||||
* Don't recycle if we still have cached pages.
|
||||
*/
|
||||
if (VOP_GETVOBJECT(vp, &object) == 0 &&
|
||||
(object->resident_page_count ||
|
||||
object->ref_count)) {
|
||||
error = EBUSY;
|
||||
goto done;
|
||||
if (VOP_GETVOBJECT(vp, &object) == 0) {
|
||||
VM_OBJECT_LOCK(object);
|
||||
if (object->resident_page_count ||
|
||||
object->ref_count) {
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
error = EBUSY;
|
||||
goto done;
|
||||
}
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
}
|
||||
if (LIST_FIRST(&vp->v_cache_src)) {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue