

This patch exports shrink_list() function. Memory migration code calls the
function to free inactive 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 |   24 ++++++++++++++++++++++++
 memhotplug-dave/mm/vmscan.c          |   26 +-------------------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff -puN include/linux/swap.h~P18-export_shrink_list include/linux/swap.h
--- memhotplug/include/linux/swap.h~P18-export_shrink_list	2004-12-10 13:53:15.000000000 -0800
+++ memhotplug-dave/include/linux/swap.h	2004-12-10 13:53:15.000000000 -0800
@@ -186,6 +186,30 @@ typedef enum {
 	PAGE_CLEAN,
 } pageout_t;
 extern pageout_t pageout(struct page *, struct address_space *);
+struct scan_control {
+	/* Ask refill_inactive_zone, or shrink_cache to scan this many pages */
+	unsigned long nr_to_scan;
+
+	/* Incremented by the number of inactive pages that were scanned */
+	unsigned long nr_scanned;
+
+	/* Incremented by the number of pages reclaimed */
+	unsigned long nr_reclaimed;
+
+	unsigned long nr_mapped;	/* From page_state */
+
+	/* How many pages shrink_cache() should reclaim */
+	int nr_to_reclaim;
+
+	/* Ask shrink_caches, or shrink_zone to scan at this priority */
+	unsigned int priority;
+
+	/* This context's GFP mask */
+	unsigned int gfp_mask;
+
+	int may_writepage;
+};
+extern int shrink_list(struct list_head *, struct scan_control *);
 extern int vm_swappiness;
 
 #ifdef CONFIG_MMU
diff -puN mm/vmscan.c~P18-export_shrink_list mm/vmscan.c
--- memhotplug/mm/vmscan.c~P18-export_shrink_list	2004-12-10 13:53:15.000000000 -0800
+++ memhotplug-dave/mm/vmscan.c	2004-12-10 13:53:15.000000000 -0800
@@ -40,30 +40,6 @@
 
 #include <linux/swapops.h>
 
-struct scan_control {
-	/* Ask refill_inactive_zone, or shrink_cache to scan this many pages */
-	unsigned long nr_to_scan;
-
-	/* Incremented by the number of inactive pages that were scanned */
-	unsigned long nr_scanned;
-
-	/* Incremented by the number of pages reclaimed */
-	unsigned long nr_reclaimed;
-
-	unsigned long nr_mapped;	/* From page_state */
-
-	/* How many pages shrink_cache() should reclaim */
-	int nr_to_reclaim;
-
-	/* Ask shrink_caches, or shrink_zone to scan at this priority */
-	unsigned int priority;
-
-	/* This context's GFP mask */
-	unsigned int gfp_mask;
-
-	int may_writepage;
-};
-
 /*
  * The list of shrinker callbacks used by to apply pressure to
  * ageable caches.
@@ -334,7 +310,7 @@ pageout_t pageout(struct page *page, str
 /*
  * shrink_list adds the number of reclaimed pages to sc->nr_reclaimed
  */
-static int shrink_list(struct list_head *page_list, struct scan_control *sc)
+int shrink_list(struct list_head *page_list, struct scan_control *sc)
 {
 	LIST_HEAD(ret_pages);
 	struct pagevec freed_pvec;
_
