[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>
This commit is contained in:

committed by
Linus Torvalds

parent
25761b6eb7
commit
a0f496517f
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user