Initialize the buf's b_object in pbgetvp(). Clear it in pbrelvp(). (This

facilitates synchronization of the vm page's valid field using the
vm object's lock.)

Suggested by:	tegge
This commit is contained in:
Alan Cox 2003-10-20 18:24:38 +00:00
parent 62a531a702
commit f2b1200d08
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121287
2 changed files with 2 additions and 1 deletions

View file

@ -373,7 +373,6 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
bp->b_offset = tbp->b_offset;
KASSERT(bp->b_offset != NOOFFSET, ("cluster_rbuild: no buffer offset"));
pbgetvp(vp, bp);
bp->b_object = tbp->b_object;
TAILQ_INIT(&bp->b_cluster.cluster_head);

View file

@ -1840,6 +1840,7 @@ pbgetvp(vp, bp)
KASSERT(bp->b_vp == NULL, ("pbgetvp: not free"));
bp->b_vp = vp;
bp->b_object = vp->v_object;
bp->b_flags |= B_PAGING;
bp->b_dev = vn_todev(vp);
}
@ -1865,6 +1866,7 @@ pbrelvp(bp)
}
VI_UNLOCK(bp->b_vp);
bp->b_vp = (struct vnode *) 0;
bp->b_object = NULL;
bp->b_flags &= ~B_PAGING;
}