- Fix silly VI locking that is used to check a single flag. The vnode

lock also protects this flag so it is not necessary.
 - Don't rely on v_mount to detect whether or not we've been recycled, use
   the more appropriate VI_DOOMED instead.

Sponsored by:	Isilon Systems, Inc.
MFC After:	1 week
This commit is contained in:
Jeff Roberson 2006-02-06 10:14:12 +00:00
parent 36a52c3cae
commit b73f64c484
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155384

View File

@ -282,21 +282,13 @@ vnode_pager_haspage(object, pindex, before, after)
* If no vp or vp is doomed or marked transparent to VM, we do not
* have the page.
*/
if (vp == NULL)
if (vp == NULL || vp->v_iflag & VI_DOOMED)
return FALSE;
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
* If the offset is beyond end of file we do
* not have the page.
*/
if ((vp->v_mount == NULL) ||
(IDX_TO_OFF(pindex) >= object->un_pager.vnp.vnp_size))
if (IDX_TO_OFF(pindex) >= object->un_pager.vnp.vnp_size)
return FALSE;
bsize = vp->v_mount->mnt_stat.f_iosize;
@ -461,7 +453,7 @@ vnode_pager_addr(vp, address, run)
if (address < 0)
return -1;
if (vp->v_mount == NULL)
if (vp->v_iflag & VI_DOOMED)
return -1;
bsize = vp->v_mount->mnt_stat.f_iosize;
@ -502,7 +494,7 @@ vnode_pager_input_smlfs(object, m)
int error = 0;
vp = object->handle;
if (vp->v_mount == NULL)
if (vp->v_iflag & VI_DOOMED)
return VM_PAGER_BAD;
bsize = vp->v_mount->mnt_stat.f_iosize;
@ -716,7 +708,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
KASSERT(vp->v_type != VCHR && vp->v_type != VBLK,
("vnode_pager_generic_getpages does not support devices"));
if (vp->v_mount == NULL)
if (vp->v_iflag & VI_DOOMED)
return VM_PAGER_BAD;
bsize = vp->v_mount->mnt_stat.f_iosize;