| 473 | } |
| 474 | |
| 475 | static void |
| 476 | vm_object_reference_vnode(vm_object_t object) |
| 477 | { |
| 478 | u_int old; |
| 479 | |
| 480 | /* |
| 481 | * vnode objects need the lock for the first reference |
| 482 | * to serialize with vnode_object_deallocate(). |
| 483 | */ |
| 484 | if (!refcount_acquire_if_gt(&object->ref_count, 0)) { |
| 485 | VM_OBJECT_RLOCK(object); |
| 486 | old = refcount_acquire(&object->ref_count); |
| 487 | if (object->type == OBJT_VNODE && old == 0) |
| 488 | vref(object->handle); |
| 489 | VM_OBJECT_RUNLOCK(object); |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | /* |
| 494 | * vm_object_reference: |
no test coverage detected