aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-02-10 04:43:03 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:18 -0500
commit96177299416dbccb73b54e6b344260154a445375 (patch)
tree586454851d0fbbb365d6b12c852d5a7dd6b004f4 /kernel
parent51ed4491271be8c56bdb2a03481ed34ea4984bc2 (diff)
[PATCH] Drop free_pages()
nr_free_pages is now a simple access to a global variable. Make it a macro instead of a function. The nr_free_pages now requires vmstat.h to be included. There is one occurrence in power management where we need to add the include. Directly refrer to global_page_state() there to clarify why the #include was added. [akpm@osdl.org: arm build fix] [akpm@osdl.org: sparc64 build fix] Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index ff3a6182f5f0..47ca5a2b653b 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -20,6 +20,7 @@
20#include <linux/cpu.h> 20#include <linux/cpu.h>
21#include <linux/resume-trace.h> 21#include <linux/resume-trace.h>
22#include <linux/freezer.h> 22#include <linux/freezer.h>
23#include <linux/vmstat.h>
23 24
24#include "power.h" 25#include "power.h"
25 26
@@ -72,7 +73,8 @@ static int suspend_prepare(suspend_state_t state)
72 goto Thaw; 73 goto Thaw;
73 } 74 }
74 75
75 if ((free_pages = nr_free_pages()) < FREE_PAGE_NUMBER) { 76 if ((free_pages = global_page_state(NR_FREE_PAGES))
77 < FREE_PAGE_NUMBER) {
76 pr_debug("PM: free some memory\n"); 78 pr_debug("PM: free some memory\n");
77 shrink_all_memory(FREE_PAGE_NUMBER - free_pages); 79 shrink_all_memory(FREE_PAGE_NUMBER - free_pages);
78 if (nr_free_pages() < FREE_PAGE_NUMBER) { 80 if (nr_free_pages() < FREE_PAGE_NUMBER) {