mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-21 15:45:02 +00:00
Lock accesses to the vm_object's ref_count and resident_page_count.
This commit is contained in:
parent
b05deb9bc1
commit
ebba1b25f9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114371
@ -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 New Issue
Block a user