diff options
Diffstat (limited to 'kernel/power/snapshot.c')
-rw-r--r-- | kernel/power/snapshot.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 75d4886e648e..591301ae8b7d 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -314,7 +314,7 @@ static unsigned int unsafe_pages; | |||
314 | * and we count them using unsafe_pages | 314 | * and we count them using unsafe_pages |
315 | */ | 315 | */ |
316 | 316 | ||
317 | static inline void *alloc_image_page(gfp_t gfp_mask, int safe_needed) | 317 | static void *alloc_image_page(gfp_t gfp_mask, int safe_needed) |
318 | { | 318 | { |
319 | void *res; | 319 | void *res; |
320 | 320 | ||
@@ -828,13 +828,16 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count) | |||
828 | } | 828 | } |
829 | if (!handle->offset) | 829 | if (!handle->offset) |
830 | handle->buffer = buffer; | 830 | handle->buffer = buffer; |
831 | handle->sync_read = 1; | ||
831 | if (handle->prev < handle->page) { | 832 | if (handle->prev < handle->page) { |
832 | if (!handle->prev) { | 833 | if (!handle->prev) { |
833 | error = load_header(handle, (struct swsusp_info *)buffer); | 834 | error = load_header(handle, |
835 | (struct swsusp_info *)buffer); | ||
834 | if (error) | 836 | if (error) |
835 | return error; | 837 | return error; |
836 | } else if (handle->prev <= nr_meta_pages) { | 838 | } else if (handle->prev <= nr_meta_pages) { |
837 | handle->pbe = unpack_orig_addresses(buffer, handle->pbe); | 839 | handle->pbe = unpack_orig_addresses(buffer, |
840 | handle->pbe); | ||
838 | if (!handle->pbe) { | 841 | if (!handle->pbe) { |
839 | error = prepare_image(handle); | 842 | error = prepare_image(handle); |
840 | if (error) | 843 | if (error) |
@@ -842,10 +845,12 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count) | |||
842 | handle->pbe = pagedir_nosave; | 845 | handle->pbe = pagedir_nosave; |
843 | handle->last_pbe = NULL; | 846 | handle->last_pbe = NULL; |
844 | handle->buffer = get_buffer(handle); | 847 | handle->buffer = get_buffer(handle); |
848 | handle->sync_read = 0; | ||
845 | } | 849 | } |
846 | } else { | 850 | } else { |
847 | handle->pbe = handle->pbe->next; | 851 | handle->pbe = handle->pbe->next; |
848 | handle->buffer = get_buffer(handle); | 852 | handle->buffer = get_buffer(handle); |
853 | handle->sync_read = 0; | ||
849 | } | 854 | } |
850 | handle->prev = handle->page; | 855 | handle->prev = handle->page; |
851 | } | 856 | } |