Use readlocking now that assertions on vm_page_lookup() are relaxed.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	alc
Tested by:	flo, pho
This commit is contained in:
Attilio Rao 2013-05-17 20:03:55 +00:00
parent 8ebb983529
commit e3ed7ff03f

View File

@ -2772,7 +2772,7 @@ inmem(struct vnode * vp, daddr_t blkno)
size = vp->v_mount->mnt_stat.f_iosize;
off = (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize;
VM_OBJECT_WLOCK(obj);
VM_OBJECT_RLOCK(obj);
for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) {
m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
if (!m)
@ -2784,11 +2784,11 @@ inmem(struct vnode * vp, daddr_t blkno)
(vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
goto notinmem;
}
VM_OBJECT_WUNLOCK(obj);
VM_OBJECT_RUNLOCK(obj);
return 1;
notinmem:
VM_OBJECT_WUNLOCK(obj);
VM_OBJECT_RUNLOCK(obj);
return (0);
}