This patch exports pageout() function. Memory migration code calls the function to write back dirty pages. Signed-off-by: Hirokazu Takahashi Signed-off-by: Dave Hansen Index: linux-2.6.13/include/linux/swap.h =================================================================== --- linux-2.6.13.orig/include/linux/swap.h 2005-08-28 16:41:01.000000000 -0700 +++ linux-2.6.13/include/linux/swap.h 2005-08-30 12:16:24.000000000 -0700 @@ -176,6 +176,17 @@ extern void swap_setup(void); extern int try_to_free_pages(struct zone **, unsigned int); extern int zone_reclaim(struct zone *, unsigned int, unsigned int); extern int shrink_all_memory(int); +typedef enum { + /* failed to write page out, page is locked */ + PAGE_KEEP, + /* move page to the active list, page is locked */ + PAGE_ACTIVATE, + /* page has been sent to the disk successfully, page is unlocked */ + PAGE_SUCCESS, + /* page is clean and locked */ + PAGE_CLEAN, +} pageout_t; +extern pageout_t pageout(struct page *, struct address_space *); extern int vm_swappiness; #ifdef CONFIG_MMU Index: linux-2.6.13/mm/vmscan.c =================================================================== --- linux-2.6.13.orig/mm/vmscan.c 2005-08-30 12:16:22.000000000 -0700 +++ linux-2.6.13/mm/vmscan.c 2005-08-30 12:16:24.000000000 -0700 @@ -39,18 +39,6 @@ #include -/* possible outcome of pageout() */ -typedef enum { - /* failed to write page out, page is locked */ - PAGE_KEEP, - /* move page to the active list, page is locked */ - PAGE_ACTIVATE, - /* page has been sent to the disk successfully, page is unlocked */ - PAGE_SUCCESS, - /* page is clean and locked */ - PAGE_CLEAN, -} pageout_t; - struct scan_control { /* Ask refill_inactive_zone, or shrink_cache to scan this many pages */ unsigned long nr_to_scan; @@ -302,7 +290,7 @@ static void handle_write_error(struct ad /* * pageout is called by shrink_list() for each dirty page. Calls ->writepage(). */ -static pageout_t pageout(struct page *page, struct address_space *mapping) +pageout_t pageout(struct page *page, struct address_space *mapping) { /* * If the page is dirty, only perform writeback if that write