[PATCH 01/10] dont copy pages that arent RAM

Johannes Berg
2007-02-05T18:30:28Z

[-- Attachment #1: dont-copy-non-ram-pages.patch --]
[-- Type: text/plain, Size: 708 bytes --]

Pages that aren't RAM obviously cannot be saved during suspend-to-disk
so skip them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

---
Pavel Machek requested this be put into -mm for some more
testing although he says it seems fine.

--- mb-wireless.orig/kernel/power/snapshot.c 2007-02-05 14:24:06.894526864 +0100
+++ mb-wireless/kernel/power/snapshot.c 2007-02-05 14:24:36.544526864 +0100
@@ -686,6 +686,8 @@ static struct page *saveable_page(unsign

if (PageReserved(page) && pfn_is_nosave(pfn))
return NULL;
+ if (!page_is_ram(pfn))
+ return NULL;

return page;
}

--