MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_page_object_remove

Function vm_page_object_remove

freebsd/vm/vm_page.c:1611–1646  ·  view source on GitHub ↗

* Do the work to remove a page from its object. The caller is responsible for * updating the page's fields to reflect this removal. */

Source from the content-addressed store, hash-verified

1609 * updating the page's fields to reflect this removal.
1610 */
1611static void
1612vm_page_object_remove(vm_page_t m)
1613{
1614 vm_object_t object;
1615 vm_page_t mrem;
1616
1617 vm_page_assert_xbusied(m);
1618 object = m->object;
1619 VM_OBJECT_ASSERT_WLOCKED(object);
1620 KASSERT((m->ref_count & VPRC_OBJREF) != 0,
1621 ("page %p is missing its object ref", m));
1622
1623 /* Deferred free of swap space. */
1624 if ((m->a.flags & PGA_SWAP_FREE) != 0)
1625 vm_pager_page_unswapped(m);
1626
1627 m->object = NULL;
1628 mrem = vm_radix_remove(&object->rtree, m->pindex);
1629 KASSERT(mrem == m, ("removed page %p, expected page %p", mrem, m));
1630
1631 /*
1632 * Now remove from the object's list of backed pages.
1633 */
1634 TAILQ_REMOVE(&object->memq, m, listq);
1635
1636 /*
1637 * And show that the object has one fewer resident page.
1638 */
1639 object->resident_page_count--;
1640
1641 /*
1642 * The vnode may now be recycled.
1643 */
1644 if (object->resident_page_count == 0 && object->type == OBJT_VNODE)
1645 vdrop(object->handle);
1646}
1647
1648/*
1649 * vm_page_remove:

Callers 3

vm_page_remove_xbusyFunction · 0.85
vm_page_renameFunction · 0.85
vm_page_free_prepFunction · 0.85

Calls 3

vm_pager_page_unswappedFunction · 0.85
vm_radix_removeFunction · 0.85
vdropFunction · 0.85

Tested by

no test coverage detected