* Set the page dirty bits and free the invalid swap space if * present. Returns the previous dirty bits. */
| 5066 | * present. Returns the previous dirty bits. |
| 5067 | */ |
| 5068 | vm_page_bits_t |
| 5069 | vm_page_set_dirty(vm_page_t m) |
| 5070 | { |
| 5071 | vm_page_bits_t old; |
| 5072 | |
| 5073 | VM_PAGE_OBJECT_BUSY_ASSERT(m); |
| 5074 | |
| 5075 | if (vm_page_xbusied(m) && !pmap_page_is_write_mapped(m)) { |
| 5076 | old = m->dirty; |
| 5077 | m->dirty = VM_PAGE_BITS_ALL; |
| 5078 | } else |
| 5079 | old = vm_page_bits_swap(m, &m->dirty, VM_PAGE_BITS_ALL); |
| 5080 | if (old == 0 && (m->a.flags & PGA_SWAP_SPACE) != 0) |
| 5081 | vm_pager_page_unswapped(m); |
| 5082 | |
| 5083 | return (old); |
| 5084 | } |
| 5085 | |
| 5086 | /* |
| 5087 | * Clear the given bits from the specified page's dirty field. |
no test coverage detected