From: Pavel Machek <pavel@ucw.cz>
To: kernel list <linux-kernel@vger.kernel.org>
Subject: Writing to the swap space
Date: Tue, 7 May 2002 00:11:25 +0200 [thread overview]
Message-ID: <20020506221125.GA25298@elf.ucw.cz> (raw)
Hi!
For swsusp, I need to write to the swap space.
I used technique similar to this:
static void mark_swapfiles(swp_entry_t prev, int mode)
{
swp_entry_t entry;
union diskpage *cur;
cur = (union diskpage *)get_free_page(GFP_ATOMIC);
if (!cur)
panic("Out of memory in mark_swapfiles");
/* XXX: this is dirty hack to get first page of swap file */
entry = SWP_ENTRY(root_swap, 0);
lock_page(virt_to_page((unsigned long)cur));
rw_swap_page_nolock(READ, entry, (char *) cur);
... modify cur->fields...
lock_page(virt_to_page((unsigned long)cur));
rw_swap_page_nolock(WRITE, entry, (char *)cur);
free_page((unsigned long)cur);
}
It seems not to work any more. Some io is done, but it is not
synchronous any more, and it does not seem to hit the disk.
What am I doing wrong, or is there something wrong in 2.5.12/2.5.13?
Pavel
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
next reply other threads:[~2002-05-06 22:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-06 22:11 Pavel Machek [this message]
2002-05-06 22:29 ` Writing to the swap space Andrew Morton
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=20020506221125.GA25298@elf.ucw.cz \
--to=pavel@ucw.cz \
--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