lkml.org 
[lkml]   [2006]   [Jan]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 3 Jan 2006 23:31:27 -0800
FromAndrew Morton <>
SubjectRe: [PATCH -mm 1/3] mm: add a new function (needed for swap suspend)
"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?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-04 08:34    [from the cache]
©2003-2008