

This patch exports pageout() function. Memory migration code calls the
function to write back dirty pages.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 memhotplug-dave/include/linux/swap.h |   11 +++++++++++
 memhotplug-dave/mm/vmscan.c          |   14 +-------------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff -puN include/linux/swap.h~AA-PM-02-export-pageout include/linux/swap.h
--- memhotplug/include/linux/swap.h~AA-PM-02-export-pageout	2005-03-28 16:38:09.000000000 -0800
+++ memhotplug-dave/include/linux/swap.h	2005-03-28 16:38:09.000000000 -0800
@@ -174,6 +174,17 @@ extern void swap_setup(void);
 /* linux/mm/vmscan.c */
 extern int try_to_free_pages(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
diff -puN mm/vmscan.c~AA-PM-02-export-pageout mm/vmscan.c
--- memhotplug/mm/vmscan.c~AA-PM-02-export-pageout	2005-03-28 16:38:09.000000000 -0800
+++ memhotplug-dave/mm/vmscan.c	2005-03-28 16:38:09.000000000 -0800
@@ -39,18 +39,6 @@
 
 #include <linux/swapops.h>
 
-/* 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;
@@ -292,7 +280,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
_
