[Suspend2][ 4/7] [Suspend2] Space needed to store one set of pageflags.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return the number of bytes in the image header required to store one set of
pageflags.

Signed-off-by: Nigel Cunningham <[email protected]>

 kernel/power/pageflags.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/kernel/power/pageflags.c b/kernel/power/pageflags.c
index ec028d3..7c00257 100644
--- a/kernel/power/pageflags.c
+++ b/kernel/power/pageflags.c
@@ -43,3 +43,16 @@ static int pages_for_zone(struct zone *z
 			(PAGE_SIZE << 3);
 }
 
+int suspend_pageflags_space_needed(void)
+{
+	int total = 0;
+	struct zone *zone;
+
+	for_each_zone(zone)
+		total += sizeof(int) * 2 + pages_for_zone(zone) * PAGE_SIZE;
+
+	total += sizeof(int);
+
+	return total;
+}
+

--
Nigel Cunningham		nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux