diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-05-01 17:52:02 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-05-10 17:08:17 -0400 |
commit | d3c1b24c50e8b2bbc840322caf26c7eada594d21 (patch) | |
tree | b411a494ec6328e217b9bfa5b619f5aa2003968a /kernel/power/power.h | |
parent | 6a727b43be8b005609e893a80af980808012cfdb (diff) |
PM / Hibernate: Snapshot cleanup
Remove support of reads with offset. This means snapshot_read/write_next
now does not accept count parameter. It allows to clean up the functions
and snapshot handle which no longer needs to care about offsets.
/dev/snapshot handler is converted to simple_{read_from,write_to}_buffer
which take care of offsets.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r-- | kernel/power/power.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h index 46c5a26630a3..b1e207dde1c2 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h | |||
@@ -97,24 +97,12 @@ extern int hibernate_preallocate_memory(void); | |||
97 | */ | 97 | */ |
98 | 98 | ||
99 | struct snapshot_handle { | 99 | struct snapshot_handle { |
100 | loff_t offset; /* number of the last byte ready for reading | ||
101 | * or writing in the sequence | ||
102 | */ | ||
103 | unsigned int cur; /* number of the block of PAGE_SIZE bytes the | 100 | unsigned int cur; /* number of the block of PAGE_SIZE bytes the |
104 | * next operation will refer to (ie. current) | 101 | * next operation will refer to (ie. current) |
105 | */ | 102 | */ |
106 | unsigned int cur_offset; /* offset with respect to the current | ||
107 | * block (for the next operation) | ||
108 | */ | ||
109 | unsigned int prev; /* number of the block of PAGE_SIZE bytes that | ||
110 | * was the current one previously | ||
111 | */ | ||
112 | void *buffer; /* address of the block to read from | 103 | void *buffer; /* address of the block to read from |
113 | * or write to | 104 | * or write to |
114 | */ | 105 | */ |
115 | unsigned int buf_offset; /* location to read from or write to, | ||
116 | * given as a displacement from 'buffer' | ||
117 | */ | ||
118 | int sync_read; /* Set to one to notify the caller of | 106 | int sync_read; /* Set to one to notify the caller of |
119 | * snapshot_write_next() that it may | 107 | * snapshot_write_next() that it may |
120 | * need to call wait_on_bio_chain() | 108 | * need to call wait_on_bio_chain() |
@@ -125,12 +113,12 @@ struct snapshot_handle { | |||
125 | * snapshot_read_next()/snapshot_write_next() is allowed to | 113 | * snapshot_read_next()/snapshot_write_next() is allowed to |
126 | * read/write data after the function returns | 114 | * read/write data after the function returns |
127 | */ | 115 | */ |
128 | #define data_of(handle) ((handle).buffer + (handle).buf_offset) | 116 | #define data_of(handle) ((handle).buffer) |
129 | 117 | ||
130 | extern unsigned int snapshot_additional_pages(struct zone *zone); | 118 | extern unsigned int snapshot_additional_pages(struct zone *zone); |
131 | extern unsigned long snapshot_get_image_size(void); | 119 | extern unsigned long snapshot_get_image_size(void); |
132 | extern int snapshot_read_next(struct snapshot_handle *handle, size_t count); | 120 | extern int snapshot_read_next(struct snapshot_handle *handle); |
133 | extern int snapshot_write_next(struct snapshot_handle *handle, size_t count); | 121 | extern int snapshot_write_next(struct snapshot_handle *handle); |
134 | extern void snapshot_write_finalize(struct snapshot_handle *handle); | 122 | extern void snapshot_write_finalize(struct snapshot_handle *handle); |
135 | extern int snapshot_image_loaded(struct snapshot_handle *handle); | 123 | extern int snapshot_image_loaded(struct snapshot_handle *handle); |
136 | 124 | ||