diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2005-10-30 23:59:57 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-31 02:37:14 +0100 |
commit | a0f496517f3e28d651d0cbbcf2d4fb701ed6957e (patch) | |
tree | 39ab8b387061cc5737c542f6cddea7320b82970b /kernel/power/swsusp.c | |
parent | [PATCH] swsusp: move snapshot functionality to separate file (diff) | |
download | linux-a0f496517f3e28d651d0cbbcf2d4fb701ed6957e.tar.xz linux-a0f496517f3e28d651d0cbbcf2d4fb701ed6957e.zip |
[PATCH] swsusp: reduce the use of global variables
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/swsusp.c')
-rw-r--r-- | kernel/power/swsusp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index fc50b5d2dd26..f6abfdb0a02a 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -550,14 +550,14 @@ static int write_suspend_image(void) * We should only consider resume_device. */ -int enough_swap(void) +int enough_swap(unsigned nr_pages) { struct sysinfo i; si_swapinfo(&i); pr_debug("swsusp: available swap: %lu pages\n", i.freeswap); - return i.freeswap > (nr_copy_pages + PAGES_FOR_IO + - nr_copy_pages/PBES_PER_PAGE + !!(nr_copy_pages%PBES_PER_PAGE)); + return i.freeswap > (nr_pages + PAGES_FOR_IO + + (nr_pages + PBES_PER_PAGE - 1) / PBES_PER_PAGE); } |