[PATCH] swsusp: use block device offsets to identify swap locations
[safe/jmp/linux-2.6] / kernel / power / power.h
index e18ba20..210ebba 100644 (file)
@@ -81,16 +81,6 @@ struct snapshot_handle {
        unsigned int    prev;   /* number of the block of PAGE_SIZE bytes that
                                 * was the current one previously
                                 */
-       struct pbe      *pbe;   /* PBE that corresponds to 'buffer' */
-       struct pbe      *last_pbe;      /* When the image is restored (eg. read
-                                        * from disk) we can store some image
-                                        * data directly in the page frames
-                                        * in which they were before suspend.
-                                        * In such a case the PBEs that
-                                        * correspond to them will be unused.
-                                        * This is the last PBE, so far, that
-                                        * does not correspond to such data.
-                                        */
        void            *buffer;        /* address of the block to read from
                                         * or write to
                                         */
@@ -109,9 +99,11 @@ struct snapshot_handle {
  */
 #define data_of(handle)        ((handle).buffer + (handle).buf_offset)
 
+extern unsigned int snapshot_additional_pages(struct zone *zone);
 extern int snapshot_read_next(struct snapshot_handle *handle, size_t count);
 extern int snapshot_write_next(struct snapshot_handle *handle, size_t count);
-int snapshot_image_loaded(struct snapshot_handle *handle);
+extern int snapshot_image_loaded(struct snapshot_handle *handle);
+extern void snapshot_free_unused_memory(struct snapshot_handle *handle);
 
 #define SNAPSHOT_IOC_MAGIC     '3'
 #define SNAPSHOT_FREEZE                        _IO(SNAPSHOT_IOC_MAGIC, 1)
@@ -125,7 +117,12 @@ int snapshot_image_loaded(struct snapshot_handle *handle);
 #define SNAPSHOT_FREE_SWAP_PAGES       _IO(SNAPSHOT_IOC_MAGIC, 9)
 #define SNAPSHOT_SET_SWAP_FILE         _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int)
 #define SNAPSHOT_S2RAM                 _IO(SNAPSHOT_IOC_MAGIC, 11)
-#define SNAPSHOT_IOC_MAXNR     11
+#define SNAPSHOT_PMOPS                 _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int)
+#define SNAPSHOT_IOC_MAXNR     12
+
+#define PMOPS_PREPARE  1
+#define PMOPS_ENTER    2
+#define PMOPS_FINISH   3
 
 /**
  *     The bitmap is used for tracing allocated swap pages
@@ -149,7 +146,7 @@ struct bitmap_page {
 
 extern void free_bitmap(struct bitmap_page *bitmap);
 extern struct bitmap_page *alloc_bitmap(unsigned int nr_bits);
-extern unsigned long alloc_swap_page(int swap, struct bitmap_page *bitmap);
+extern sector_t alloc_swapdev_block(int swap, struct bitmap_page *bitmap);
 extern void free_all_swap_pages(int swap, struct bitmap_page *bitmap);
 
 extern int swsusp_check(void);