summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-03-29 07:06:13 +0000
committerjeff <jeff@FreeBSD.org>2008-03-29 07:06:13 +0000
commit43963c5cfaf5dd778dc967d53b014678d2cf8d16 (patch)
tree5d634998b0cd77b0387b3d371c2b7270573f2092 /sys/vm
parente581a2ffe9b632ea0d8cbf41095c1e73fbf4d141 (diff)
downloadFreeBSD-src-43963c5cfaf5dd778dc967d53b014678d2cf8d16.zip
FreeBSD-src-43963c5cfaf5dd778dc967d53b014678d2cf8d16.tar.gz
- Use vm_object_reference_locked() directly from
vm_object_reference(). This is intended to get rid of vget() consumers who don't wish to acquire a lock. This is functionally the same as calling vref(). vm_object_reference_locked() already uses vref. Discussed with: alc
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a8ed619..041b289 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -364,22 +364,11 @@ vm_object_allocate(objtype_t type, vm_pindex_t size)
void
vm_object_reference(vm_object_t object)
{
- struct vnode *vp;
-
if (object == NULL)
return;
VM_OBJECT_LOCK(object);
- object->ref_count++;
- if (object->type == OBJT_VNODE) {
- int vfslocked;
-
- vp = object->handle;
- VM_OBJECT_UNLOCK(object);
- vfslocked = VFS_LOCK_GIANT(vp->v_mount);
- vget(vp, LK_RETRY, curthread);
- VFS_UNLOCK_GIANT(vfslocked);
- } else
- VM_OBJECT_UNLOCK(object);
+ vm_object_reference_locked(object);
+ VM_OBJECT_UNLOCK(object);
}
/*
@@ -395,8 +384,6 @@ vm_object_reference_locked(vm_object_t object)
struct vnode *vp;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
- KASSERT((object->flags & OBJ_DEAD) == 0,
- ("vm_object_reference_locked: dead object referenced"));
object->ref_count++;
if (object->type == OBJT_VNODE) {
vp = object->handle;
OpenPOWER on IntegriCloud