From: Andrew Morton <akpm@osdl.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: pavel@suse.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm 1/3] mm: add a new function (needed for swap suspend)
Date: Tue, 3 Jan 2006 23:31:27 -0800 [thread overview]
Message-ID: <20060103233127.26328cba.akpm@osdl.org> (raw)
In-Reply-To: <200512271752.47003.rjw@sisk.pl>
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:
>
> @@ -211,6 +211,26 @@
> return (swp_entry_t) {0};
> }
>
> +swp_entry_t get_swap_page_of_type(int type)
> +{
> + struct swap_info_struct *si;
> + pgoff_t offset;
> +
> + spin_lock(&swap_lock);
> + si = swap_info + type;
> + if (si->flags & SWP_WRITEOK) {
> + nr_swap_pages--;
> + offset = scan_swap_map(si);
> + if (offset) {
> + spin_unlock(&swap_lock);
> + return swp_entry(type, offset);
> + }
> + nr_swap_pages++;
> + }
> + spin_unlock(&swap_lock);
> + return (swp_entry_t) {0};
> +}
A little introductory comment would have been nice..
Would it be appropriate to put this under CONFIG_SOMETHING to save a little
space?
next prev parent reply other threads:[~2006-01-04 7:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-27 16:47 [PATCH -mm 0/3] swsusp: swap handling improvements Rafael J. Wysocki
2005-12-27 16:52 ` [PATCH -mm 1/3] mm: add a new function (needed for swap suspend) Rafael J. Wysocki
2006-01-04 7:31 ` Andrew Morton [this message]
2005-12-27 16:57 ` [PATCH -mm 2/3] swsusp: improve handling of swap partitions Rafael J. Wysocki
2005-12-27 17:07 ` [PATCH -mm 3/3] swsusp: save image header first Rafael J. Wysocki
2005-12-27 17:27 ` [PATCH -mm 0/3] swsusp: swap handling improvements Pavel Machek
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=20060103233127.26328cba.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=rjw@sisk.pl \
/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®