/* Pageout daemon. Copyright 1999-2002 Johan Rydberg, jrydberg@rtmk.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Set up page M for pageout. Move or copy the page to a new object, as part of which it will be sent to its memory manager in a memory_pager_data_write or memory_pager_initialize message. The PAGIN_OFFSET argument specifies the offset of the page within its external memory object. The NEW_OBJECT and NEW_OFFSET arguments indicate where the page should be moved. The FLUSH_P argument specifies whether the page should be flushed from its object. If not, a copy of the page is moved to the new object. The page in question must not be on any pageout queues, and must be busy. The object to which it belongs must be unlocked, and the caller must hold a paging reference to it. The NEW_OBJECT must not be locked. If the page is flushed from its original object, this routine returns a pointer to a place-holder page, inserted at the same offset, to block out-of-order requests for the page. The place-holder page must be freed after the data_write or initialize message has been sent. If the page is copied, the holding page is NULL. The original page is put on a paging queue and marked not busy on exit. */ extern struct vm_page *vm_pageout_setup (struct vm_page *m, vm_offset_t paging_offset, struct vm_object *new_object, vm_offset_t new_offset, int flush_p); /* Causes the specified page M to be written back to the appropriate memory object. The INITIAL_P argument specifies whether this data is an initialization only, and should use memory_pager_data_initialize instead of memory_pager_data_write. The FLUSH_P argument specifies whether the page should be flushed from the object. If not, a copy of the data is sent to the memory object. The page in question must not be on any pageout queues. The object to which it belongs must be locked. [Move this page to a completely new object, if flushing; copy to a new page in a new object, if not.] */ extern void vm_pageout_page (struct vm_page *m, int initial_p, int flush_p);