summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-07-06 08:59:52 +0000
committerjeff <jeff@FreeBSD.org>2002-07-06 08:59:52 +0000
commit0dd7645264ca202a719af56ac11adbf83a664a12 (patch)
tree5783b378b0b909b42f518f718b5804f02cf06503 /sys/kern/vfs_subr.c
parent4037477f94b23f8b1d083009977249d2ac2c773d (diff)
downloadFreeBSD-src-0dd7645264ca202a719af56ac11adbf83a664a12.zip
FreeBSD-src-0dd7645264ca202a719af56ac11adbf83a664a12.tar.gz
Fixup uses of GETVOBJECT.
- Cache a pointer to the vnode's object in the buf. - Hold a reference to that object in addition to the vnode's reference just to be consistent. - Cleanup code that got the object indirectly through the vp and VOP calls. This fixes at least one case where we were calling GETVOBJECT without a lock. It also avoids an expensive layered call at the cost of another pointer in struct buf.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 882fc39..d8e960a 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1139,6 +1139,10 @@ brelvp(bp)
splx(s);
bp->b_vp = (struct vnode *) 0;
vdrop(vp);
+ if (bp->b_object) {
+ vm_object_deallocate(bp->b_object);
+ bp->b_object = NULL;
+ }
}
/*
OpenPOWER on IntegriCloud