Re: [RFC][PATCH 3/6] swsusp: introduce the swap map structure and interface functions

From: Pavel Machek
Date: Sat Oct 29 2005 - 17:58:08 EST


Hi!

> This is the main part. It introduces a new data structure for the
> swap-handling part of swsusp (the swap map structure, described in a comment)
> and new functions for writing the image data to and reading them from swap.
> It also introduces the interface functions allowing the snapshot-handling part
> to communicate with the swap-handling part and modifies the struct pbe
> structure (the swap_address member of it is no longer needed as the
> swap-handling part uses its own independent data structures).

One small comment. I miss "a" in "swap". Pretty please...

> + * Rafael J. Wysocki <rjw@xxxxxxx>
> + * Added the swap map data structure and reworked the handling of swap
> + *

Feel free to add yourself to CREDITS, too. CREDITS are going to stay,
but this does not really belong here, and may have to be moved
somewhere else in future.

> + * During resume we only need to use one swp_map_page structure
> + * at a time, which means that we only need to use two memory pages for
> + * reading the image - one for reading the swp_map_page structures
> + * and the second for reading the data pages from swap.
> */

Nice...

> +struct swp_map_page {
> + swp_entry_t entries[MAP_PAGE_SIZE];
> + swp_entry_t next_swp;
> + struct swp_map_page *next;
> +};
> +
> +typedef struct swp_map_page swp_map_t;

Please don't. Just use "struct swap_map_page" instead.

> +extern unsigned snapshot_pages_to_save(void);
> +extern unsigned snapshot_image_pages(void);

Make it "extern unsigned int". (That is in more than one place).

> +int snapshot_recv_init(unsigned nr_pages, unsigned img_pages)

Please, usefull words, that's receive_init and image_pages....

Otherwise it looks good. I'll check it once more...

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