Re: [PATCH -mm 1/3] mm: add a new function (needed for swap suspend)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Rafael J. Wysocki" <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux