diff options
author | alc <alc@FreeBSD.org> | 2003-10-20 18:24:38 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-10-20 18:24:38 +0000 |
commit | 512489f3013cd39afcf15c4934ce2af09940d38e (patch) | |
tree | 770442b32d45fa8d881dda0c53a2e702ba70bae9 /sys/kern | |
parent | 3d2d2c4fd8c46cc963348070f842de9820f64ee1 (diff) | |
download | FreeBSD-src-512489f3013cd39afcf15c4934ce2af09940d38e.zip FreeBSD-src-512489f3013cd39afcf15c4934ce2af09940d38e.tar.gz |
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
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_cluster.c | 1 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 11964ac..dc86fb9 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -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); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index e65ec91..4092506 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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; } |