aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vnode_pager.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2002-09-25 01:23:43 +0000
committerJeff Roberson <jeff@FreeBSD.org>2002-09-25 01:23:43 +0000
commit63e7e60dba5098560bb3220c7cb47d9401d57e1e (patch)
tree91edd21b81132664a507c88a1d6dde214dd343cd /sys/vm/vnode_pager.c
parent7576c7c9c2a69267cb4c1c810a2483e6fd55b847 (diff)
downloadsrc-63e7e60dba5098560bb3220c7cb47d9401d57e1e.tar.gz
src-63e7e60dba5098560bb3220c7cb47d9401d57e1e.zip
- Add a ASSERT_VOP_LOCKED in vnode_pager_alloc.
- Lock access to v_iflags.
Notes
Notes: svn path=/head/; revision=103923
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r--sys/vm/vnode_pager.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index f09f147efee9..d47cb7c62064 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -120,6 +120,8 @@ vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
vp = (struct vnode *) handle;
+ ASSERT_VOP_LOCKED(vp, "vnode_pager_alloc");
+
mtx_lock(&Giant);
/*
* Prevent race condition when allocating the object. This
@@ -212,9 +214,12 @@ vnode_pager_haspage(object, pindex, before, after)
if (vp == NULL)
return FALSE;
- mp_fixme("Unlocked iflags access");
- if (vp->v_iflag & VI_DOOMED)
+ VI_LOCK(vp);
+ if (vp->v_iflag & VI_DOOMED) {
+ VI_UNLOCK(vp);
return FALSE;
+ }
+ VI_UNLOCK(vp);
/*
* If filesystem no longer mounted or offset beyond end of file we do
* not have the page.