From: Nigel Cunningham <nigel@suspend2.net>
To: linux-kernel@vger.kernel.org
Subject: [Suspend2][ 4/7] [Suspend2] Space needed to store one set of pageflags.
Date: Tue, 27 Jun 2006 08:31:43 +1000 [thread overview]
Message-ID: <20060626223141.3725.33148.stgit@nigel.suspend2.net> (raw)
In-Reply-To: <20060626223128.3725.55605.stgit@nigel.suspend2.net>
Return the number of bytes in the image header required to store one set of
pageflags.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
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
next prev parent reply other threads:[~2006-06-26 22:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 22:31 [Suspend2][ 0/7] Pageflags support Nigel Cunningham
2006-06-26 22:31 ` [Suspend2][ 1/7] [Suspend2] Pagedir.h Nigel Cunningham
2006-06-26 22:31 ` [Suspend2][ 2/7] [Suspend2] Return number of zones used Nigel Cunningham
2006-06-26 22:31 ` [Suspend2][ 3/7] [Suspend2] Pages for zone Nigel Cunningham
2006-06-26 22:31 ` Nigel Cunningham [this message]
2006-06-26 22:31 ` [Suspend2][ 5/7] [Suspend2] Serialise pageflags Nigel Cunningham
2006-06-26 22:31 ` [Suspend2][ 6/7] [Suspend2] Relocate pageflags Nigel Cunningham
2006-06-26 22:31 ` [Suspend2][ 7/7] [Suspend2] Pageflags.h Nigel Cunningham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060626223141.3725.33148.stgit@nigel.suspend2.net \
--to=nigel@suspend2.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®