From 66dfd6396149e353342cd31080e6b88469aec335 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 19 Feb 2005 11:44:57 +0000 Subject: Try to unbreak the vnode locking around vop_reclaim() (based mostly on patch from kan@). Pull bufobj_invalbuf() out of vinvalbuf() and make g_vfs call it on close. This is not yet a generally safe function, but for this very specific use it is safe. This solves the problem with buffers not being flushed by unmount or after failed mount attempts. --- sys/vm/vnode_pager.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/vm') diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 0f9c3eb..af483ed 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -158,6 +158,7 @@ vnode_destroy_vobject(struct vnode *vp) obj = vp->v_object; if (obj == NULL) return; + VOP_LOCK(vp, LK_EXCLUSIVE, curthread); vp->v_object = NULL; VM_OBJECT_LOCK(obj); if (obj->ref_count == 0) { @@ -180,6 +181,7 @@ vnode_destroy_vobject(struct vnode *vp) vm_pager_deallocate(obj); VM_OBJECT_UNLOCK(obj); } + VOP_UNLOCK(vp, 0, curthread); } -- cgit v1.1