* vm_object_reference_locked: * * Gets another reference to the given object. * * The object must be locked. */
| 518 | * The object must be locked. |
| 519 | */ |
| 520 | void |
| 521 | vm_object_reference_locked(vm_object_t object) |
| 522 | { |
| 523 | u_int old; |
| 524 | |
| 525 | VM_OBJECT_ASSERT_LOCKED(object); |
| 526 | old = refcount_acquire(&object->ref_count); |
| 527 | if (object->type == OBJT_VNODE && old == 0) |
| 528 | vref(object->handle); |
| 529 | KASSERT((object->flags & OBJ_DEAD) == 0, |
| 530 | ("vm_object_reference: Referenced dead object.")); |
| 531 | } |
| 532 | |
| 533 | /* |
| 534 | * Handle deallocating an object of type OBJT_VNODE. |
no test coverage detected