Simplify vref() code in object_reference. The local temporary is no longer
necessary. Fix formatting errors. Reported by: mjg Discussed with: kib
This commit is contained in:
parent
86dc6f3bc4
commit
45d716be60
@ -484,7 +484,6 @@ vm_object_allocate_anon(vm_pindex_t size, vm_object_t backing_object,
|
|||||||
static void
|
static void
|
||||||
vm_object_reference_vnode(vm_object_t object)
|
vm_object_reference_vnode(vm_object_t object)
|
||||||
{
|
{
|
||||||
struct vnode *vp;
|
|
||||||
u_int old;
|
u_int old;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -494,10 +493,8 @@ vm_object_reference_vnode(vm_object_t object)
|
|||||||
if (!refcount_acquire_if_gt(&object->ref_count, 0)) {
|
if (!refcount_acquire_if_gt(&object->ref_count, 0)) {
|
||||||
VM_OBJECT_RLOCK(object);
|
VM_OBJECT_RLOCK(object);
|
||||||
old = refcount_acquire(&object->ref_count);
|
old = refcount_acquire(&object->ref_count);
|
||||||
if (object->type == OBJT_VNODE && old == 0) {
|
if (object->type == OBJT_VNODE && old == 0)
|
||||||
vp = object->handle;
|
vref(object->handle);
|
||||||
vref(vp);
|
|
||||||
}
|
|
||||||
VM_OBJECT_RUNLOCK(object);
|
VM_OBJECT_RUNLOCK(object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,13 +529,12 @@ vm_object_reference(vm_object_t object)
|
|||||||
void
|
void
|
||||||
vm_object_reference_locked(vm_object_t object)
|
vm_object_reference_locked(vm_object_t object)
|
||||||
{
|
{
|
||||||
struct vnode *vp;
|
|
||||||
u_int old;
|
u_int old;
|
||||||
|
|
||||||
VM_OBJECT_ASSERT_LOCKED(object);
|
VM_OBJECT_ASSERT_LOCKED(object);
|
||||||
old = refcount_acquire(&object->ref_count);
|
old = refcount_acquire(&object->ref_count);
|
||||||
if (object->type == OBJT_VNODE && old == 0) {
|
if (object->type == OBJT_VNODE && old == 0)
|
||||||
vp = object->handle; vref(vp); }
|
vref(object->handle);
|
||||||
KASSERT((object->flags & OBJ_DEAD) == 0,
|
KASSERT((object->flags & OBJ_DEAD) == 0,
|
||||||
("vm_object_reference: Referenced dead object."));
|
("vm_object_reference: Referenced dead object."));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user