From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@zip.com.au>,
kernel list <linux-kernel@vger.kernel.org>
Subject: [swsusp] Fix resume from initrd
Date: Sun, 3 Jul 2005 23:53:56 +0200 [thread overview]
Message-ID: <20050703215356.GA9761@elf.ucw.cz> (raw)
Move device name resolution code around so that it is not called from
resume-from-initrd. name_to_dev_t may be unavailable at that point.
Signed-off-by: Pavel Machek <pavel@suse.cz>
---
commit b532d863c3fd0a6ee5def139cd1131a80b8c4a36
tree a781a55ce6af3b70a6e9232c548ebb8bda6e5011
parent 325107c7d4a5a28dee6eecce1ee8fa01753414c7
author <pavel@amd.(none)> Sun, 03 Jul 2005 23:53:24 +0200
committer <pavel@amd.(none)> Sun, 03 Jul 2005 23:53:24 +0200
kernel/power/disk.c | 10 ++++++++++
kernel/power/swsusp.c | 10 ----------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -236,6 +236,16 @@ static int software_resume(void)
{
int error;
+ if (!swsusp_resume_device) {
+ if (!strlen(resume_file))
+ return -ENOENT;
+ swsusp_resume_device = name_to_dev_t(resume_file);
+ pr_debug("swsusp: Resume From Partition %s\n", resume_file);
+ } else {
+ pr_debug("swsusp: Resume From Partition %d:%d\n",
+ MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
+ }
+
if (noresume) {
/**
* FIXME: If noresume is specified, we need to find the partition
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -1495,16 +1495,6 @@ int swsusp_check(void)
{
int error;
- if (!swsusp_resume_device) {
- if (!strlen(resume_file))
- return -ENOENT;
- swsusp_resume_device = name_to_dev_t(resume_file);
- pr_debug("swsusp: Resume From Partition %s\n", resume_file);
- } else {
- pr_debug("swsusp: Resume From Partition %d:%d\n",
- MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
- }
-
resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ);
if (!IS_ERR(resume_bdev)) {
set_blocksize(resume_bdev, PAGE_SIZE);
--
teflon -- maybe it is a trademark, but it should not be.
reply other threads:[~2005-07-03 21:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050703215356.GA9761@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@zip.com.au \
--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®