Another minor optimization, this time to incore().

This commit is contained in:
dg 1995-08-24 13:59:14 +00:00
parent 71510114b2
commit 05ce7ad654

View File

@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions * 5. Modifications may be freely made to this file if the above conditions
* are met. * are met.
* *
* $Id: vfs_bio.c,v 1.57 1995/08/06 12:10:39 davidg Exp $ * $Id: vfs_bio.c,v 1.58 1995/08/24 13:28:16 davidg Exp $
*/ */
/* /*
@ -697,9 +697,9 @@ incore(struct vnode * vp, daddr_t blkno)
bp = bh->lh_first; bp = bh->lh_first;
/* Search hash chain */ /* Search hash chain */
while (bp) { while (bp != NULL) {
/* hit */ /* hit */
if (bp->b_lblkno == blkno && bp->b_vp == vp && if (bp->b_vp == vp && bp->b_lblkno == blkno &&
(bp->b_flags & B_INVAL) == 0) { (bp->b_flags & B_INVAL) == 0) {
splx(s); splx(s);
return (bp); return (bp);
@ -708,7 +708,7 @@ incore(struct vnode * vp, daddr_t blkno)
} }
splx(s); splx(s);
return (0); return (NULL);
} }
/* /*
@ -726,9 +726,9 @@ inmem(struct vnode * vp, daddr_t blkno)
if (incore(vp, blkno)) if (incore(vp, blkno))
return 1; return 1;
if (vp->v_mount == 0) if (vp->v_mount == NULL)
return 0; return 0;
if ((vp->v_object == 0) || (vp->v_flag & VVMIO) == 0) if ((vp->v_object == NULL) || (vp->v_flag & VVMIO) == 0)
return 0; return 0;
obj = vp->v_object; obj = vp->v_object;