From: Nigel Cunningham <nigel@tuxonice.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
Linux PM <linux-pm@lists.linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
TuxOnIce-devel <tuxonice-devel@tuxonice.net>
Subject: [PATCH 22/22] Hibernation: Remove now-empty routines.
Date: Sat, 25 Sep 2010 14:17:04 +1000 [thread overview]
Message-ID: <1285388224-10012-23-git-send-email-nigel@tuxonice.net> (raw)
In-Reply-To: <1285388224-10012-1-git-send-email-nigel@tuxonice.net>
release_swap_writer and release_swap_reader are now empty functions.
Remove them and clean up callers (including swap_reader_finish, which
just called release_swap_reader).
Signed-off-by: Nigel Cunningham <nigel@tuxonice.net>
---
kernel/power/block_io.c | 36 ++++--------------------------------
kernel/power/block_io.h | 2 --
kernel/power/swap.c | 9 ---------
3 files changed, 4 insertions(+), 43 deletions(-)
diff --git a/kernel/power/block_io.c b/kernel/power/block_io.c
index f452650..fc2e05d 100644
--- a/kernel/power/block_io.c
+++ b/kernel/power/block_io.c
@@ -172,28 +172,19 @@ static int write_page(void *buf, sector_t offset, int sync)
return hib_bio_write_page(offset, src, sync);
}
-void release_swap_writer(void)
-{
-}
-
int hib_bio_prepare_write(void)
{
int result, result2;
result = hib_prepare_buffer();
- if (result) {
- release_swap_writer();
+ if (result)
return result;
- }
first_sector = hib_extent_current(§or_extents);
result = hib_extents_store(§or_extents);
result2 = hib_flush_write_buffer();
- if (result || result2)
- release_swap_writer();
-
return result ? result : result2;
}
@@ -211,38 +202,19 @@ int flush_swap_writer(void)
return 0;
}
-/**
- * The following functions allow us to read data using a swap map
- * in a file-alike way
- */
-
-void release_swap_reader(void)
-{
-}
-
int get_swap_reader(unsigned int *flags_p, sector_t first_page)
{
int error;
error = hib_prepare_buffer();
- if (error) {
- release_swap_reader();
+ if (error)
return error;
- }
/* Bootstrap reading the extents */
error = hib_bio_read_page(first_page, hib_ppio_buffer, 1);
- if (error) {
- release_swap_reader();
- hib_free_buffer();
- return error;
- }
- error = hib_extents_load(§or_extents, 1);
-
- if (error) {
- release_swap_reader();
- }
+ if (!error)
+ error = hib_extents_load(§or_extents, 1);
hib_free_buffer();
return error;
diff --git a/kernel/power/block_io.h b/kernel/power/block_io.h
index 1482060..228fe58 100644
--- a/kernel/power/block_io.h
+++ b/kernel/power/block_io.h
@@ -14,12 +14,10 @@ void hib_wait_on_bio_chain(void);
unsigned int hib_bio_overhead(unsigned int nr_pages);
sector_t hib_get_first_sector(void);
extern struct hib_extent_state sector_extents;
-void release_swap_writer(void);
int hib_bio_prepare_write(void);
int flush_swap_writer(void);
int swap_write_page(void *buf, int sync);
int get_swap_reader(unsigned int *flags_p, sector_t first_page);
-void release_swap_reader(void);
int swap_read_page(void *buf, int sync);
int hib_flush_write_buffer(void);
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index d3e5939..5669f92 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -223,7 +223,6 @@ static int swap_writer_finish(unsigned int flags, int error)
if (error)
free_all_swap_pages(root_swap);
- release_swap_writer();
swsusp_close(FMODE_WRITE);
return error;
@@ -312,13 +311,6 @@ out_finish:
return error;
}
-static int swap_reader_finish(void)
-{
- release_swap_reader();
-
- return 0;
-}
-
/**
* load_image - load the image using the swap map handle
* @handle and the snapshot handle @snapshot
@@ -397,7 +389,6 @@ int swsusp_read(unsigned int *flags_p)
error = swap_read_page(header, 1);
if (!error)
error = load_image(&snapshot, header->pages - 1);
- swap_reader_finish();
end:
if (!error)
pr_debug("PM: Image successfully loaded\n");
--
1.7.0.4
next prev parent reply other threads:[~2010-09-25 4:17 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-25 4:16 Nigel's current for-rafael queue Nigel Cunningham
2010-09-25 4:16 ` [PATCH 01/22] Record & display i/o speed post resume Nigel Cunningham
2010-09-25 4:16 ` [PATCH 02/22] Hibernation: Swap iteration functions Nigel Cunningham
2010-09-25 4:16 ` [PATCH 03/22] Hibernation: Move root_swap declaration Nigel Cunningham
2010-09-25 4:16 ` [PATCH 04/22] Hibernation: Add mass swap allocation routine Nigel Cunningham
2010-09-25 4:16 ` [PATCH 05/22] Hibernation: Switch to preallocating swap Nigel Cunningham
2010-09-25 21:24 ` Rafael J. Wysocki
2010-09-25 21:32 ` Nigel Cunningham
2010-09-25 22:22 ` Rafael J. Wysocki
2010-09-25 4:16 ` [PATCH 06/22] Hiberation: Fix speed display Nigel Cunningham
2010-09-25 4:16 ` [PATCH 07/22] Hibernation: Generic extents support Nigel Cunningham
2010-09-25 4:16 ` [PATCH 08/22] Hibernation: Iterate over sectors not swap entries Nigel Cunningham
2010-09-25 4:16 ` [PATCH 09/22] Hibernation: Stop passing swap_map_handle struct Nigel Cunningham
2010-09-25 4:16 ` [PATCH 10/22] Hibernation: Stop passing bio_chain around Nigel Cunningham
2010-09-25 4:16 ` [PATCH 11/22] Hibernation: Move block i/o fns to block_io.c Nigel Cunningham
2010-09-25 4:16 ` [PATCH 12/22] Hibernation: Partial page I/O support Nigel Cunningham
2010-09-25 4:16 ` [PATCH 13/22] Hibernation: Extent save/load routines Nigel Cunningham
2010-09-25 22:12 ` Rafael J. Wysocki
2010-09-25 4:16 ` [PATCH 14/22] Hibernation: Store block extents at start of image Nigel Cunningham
2010-09-25 4:16 ` [PATCH 15/22] Hibernation: Use block extents for reading image Nigel Cunningham
2010-09-25 4:16 ` [PATCH 16/22] Remove first_sector from swap_map_handle Nigel Cunningham
2010-09-25 4:16 ` [PATCH 17/22] Hibernation: Replace bio chain Nigel Cunningham
2010-09-25 4:17 ` [PATCH 18/22] Hibernation: Remove swap_map_pages Nigel Cunningham
2010-09-25 4:17 ` [PATCH 19/22] Hibernation: Remove wait_on_bio_chain result Nigel Cunningham
2010-09-25 4:17 ` [PATCH 20/22] Hibernation: Prepare for handle.cur removal Nigel Cunningham
2010-09-25 4:17 ` [PATCH 21/22] Hibernation: Remove swap_map structure Nigel Cunningham
2010-09-25 4:17 ` Nigel Cunningham [this message]
2010-09-25 15:04 ` [linux-pm] Nigel's current for-rafael queue Martin Steigerwald
2010-09-25 21:21 ` Nigel Cunningham
2010-09-25 22:19 ` Rafael J. Wysocki
2010-09-25 22:33 ` Nigel Cunningham
2010-09-25 22:36 ` Rafael J. Wysocki
2010-09-28 10:34 ` [TuxOnIce-devel] " Martin Steigerwald
2010-09-30 7:52 ` unable to handle paging request at resume (was: Re: [TuxOnIce-devel] Nigel's current for-rafael queue) Martin Steigerwald
2010-10-02 16:51 ` [linux-pm] " Martin Steigerwald
2010-09-28 19:45 ` [TuxOnIce-devel] Nigel's current for-rafael queue Martin Steigerwald
2010-09-28 21:25 ` Nigel Cunningham
2010-09-30 7:56 ` Martin Steigerwald
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=1285388224-10012-23-git-send-email-nigel@tuxonice.net \
--to=nigel@tuxonice.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=rjw@sisk.pl \
--cc=tuxonice-devel@tuxonice.net \
/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;
as well as URLs for NNTP newsgroup(s).