diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 85a59287fb01..b974a1f9e88a 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -484,7 +484,6 @@ vm_object_allocate_anon(vm_pindex_t size, vm_object_t backing_object, static void vm_object_reference_vnode(vm_object_t object) { - struct vnode *vp; u_int old; /* @@ -494,10 +493,8 @@ vm_object_reference_vnode(vm_object_t object) if (!refcount_acquire_if_gt(&object->ref_count, 0)) { VM_OBJECT_RLOCK(object); old = refcount_acquire(&object->ref_count); - if (object->type == OBJT_VNODE && old == 0) { - vp = object->handle; - vref(vp); - } + if (object->type == OBJT_VNODE && old == 0) + vref(object->handle); VM_OBJECT_RUNLOCK(object); } } @@ -532,13 +529,12 @@ vm_object_reference(vm_object_t object) void vm_object_reference_locked(vm_object_t object) { - struct vnode *vp; u_int old; VM_OBJECT_ASSERT_LOCKED(object); old = refcount_acquire(&object->ref_count); - if (object->type == OBJT_VNODE && old == 0) { - vp = object->handle; vref(vp); } + if (object->type == OBJT_VNODE && old == 0) + vref(object->handle); KASSERT((object->flags & OBJ_DEAD) == 0, ("vm_object_reference: Referenced dead object.")); }