From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@suse.cz>
Subject: [PATCH 3/3] swsusp: move swap check out of swsusp_suspend
Date: Sun, 30 Oct 2005 16:48:29 +0100 [thread overview]
Message-ID: <200510301648.30191.rjw@sisk.pl> (raw)
In-Reply-To: <200510301637.48842.rjw@sisk.pl>
This patch moves the check for available swap out of swsusp_suspend(),
which is necessary for separating the swap-handling functions in swsusp
from the core code. No functionality changes.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
kernel/power/swsusp.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
Index: linux-2.6.14-rc5-mm1/kernel/power/swsusp.c
===================================================================
--- linux-2.6.14-rc5-mm1.orig/kernel/power/swsusp.c 2005-10-30 12:36:58.000000000 +0100
+++ linux-2.6.14-rc5-mm1/kernel/power/swsusp.c 2005-10-30 12:37:12.000000000 +0100
@@ -567,12 +567,15 @@
{
int error;
+ if ((error = swsusp_swap_check())) {
+ printk(KERN_ERR "swsusp: cannot find swap device, try swapon -a.\n");
+ return error;
+ }
lock_swapdevices();
error = write_suspend_image();
/* This will unlock ignored swap devices since writing is finished */
lock_swapdevices();
return error;
-
}
@@ -595,11 +598,6 @@
goto Enable_irqs;
}
- if ((error = swsusp_swap_check())) {
- printk(KERN_ERR "swsusp: cannot find swap device, try swapon -a.\n");
- goto Power_up;
- }
-
if ((error = save_highmem())) {
printk(KERN_ERR "swsusp: Not enough free pages for highmem\n");
goto Restore_highmem;
@@ -612,7 +610,6 @@
restore_processor_state();
Restore_highmem:
restore_highmem();
-Power_up:
device_power_up();
Enable_irqs:
local_irq_enable();
@@ -781,7 +778,7 @@
* Reset swap signature now.
*/
error = bio_write_page(0, &swsusp_header);
- } else {
+ } else {
return -EINVAL;
}
if (!error)
prev parent reply other threads:[~2005-10-30 15:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-30 15:37 [PATCH 0/3] swsusp: code separation continued Rafael J. Wysocki
2005-10-30 15:40 ` [PATCH 1/3] swsusp: rework swsusp_suspend Rafael J. Wysocki
2005-10-30 17:54 ` Ingo Oeser
2005-10-30 21:18 ` Rafael J. Wysocki
2005-10-30 15:44 ` [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c Rafael J. Wysocki
2005-10-30 19:52 ` Pavel Machek
2005-10-30 21:16 ` Rafael J. Wysocki
2005-10-30 21:28 ` Pavel Machek
2005-10-30 22:37 ` Rafael J. Wysocki
2005-10-30 23:04 ` Pavel Machek
2005-10-31 0:35 ` Rafael J. Wysocki
2005-10-31 21:59 ` Pavel Machek
2005-11-01 18:29 ` Rafael J. Wysocki
2005-11-01 21:04 ` Pavel Machek
2005-11-01 23:53 ` Rafael J. Wysocki
2005-11-02 21:08 ` Pavel Machek
2005-10-31 19:36 ` Rafael J. Wysocki
2005-10-31 22:02 ` Pavel Machek
2005-11-01 12:57 ` Rafael J. Wysocki
2005-11-01 17:33 ` [PATCH 1/2] swsusp: reduce code duplication (was: Re: [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c) Rafael J. Wysocki
2005-11-01 17:37 ` [PATCH 2/2] swsusp: simplify pagedir relocation Rafael J. Wysocki
2005-11-01 21:11 ` Pavel Machek
2005-11-01 23:15 ` Rafael J. Wysocki
2005-11-01 21:09 ` [PATCH 1/2] swsusp: reduce code duplication (was: Re: [PATCH 2/3] swsusp: move snapshot-handling functions to snapshot.c) Pavel Machek
2005-10-30 15:48 ` Rafael J. Wysocki [this message]
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=200510301648.30191.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.