* Insert an object into a backing_object's shadow list with an additional * reference to the backing_object added. */
| 784 | * reference to the backing_object added. |
| 785 | */ |
| 786 | static void |
| 787 | vm_object_backing_insert_ref(vm_object_t object, vm_object_t backing_object) |
| 788 | { |
| 789 | |
| 790 | VM_OBJECT_ASSERT_WLOCKED(object); |
| 791 | |
| 792 | if ((backing_object->flags & OBJ_ANON) != 0) { |
| 793 | VM_OBJECT_WLOCK(backing_object); |
| 794 | KASSERT((backing_object->flags & OBJ_DEAD) == 0, |
| 795 | ("shadowing dead anonymous object")); |
| 796 | vm_object_reference_locked(backing_object); |
| 797 | vm_object_backing_insert_locked(object, backing_object); |
| 798 | vm_object_clear_flag(backing_object, OBJ_ONEMAPPING); |
| 799 | VM_OBJECT_WUNLOCK(backing_object); |
| 800 | } else { |
| 801 | vm_object_reference(backing_object); |
| 802 | object->backing_object = backing_object; |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | /* |
| 807 | * Transfer a backing reference from backing_object to object. |
no test coverage detected