diff options
Diffstat (limited to 'kernel/power/swsusp.c')
-rw-r--r-- | kernel/power/swsusp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index d967e875ee82..1cc9ff25e479 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -363,7 +363,7 @@ static void lock_swapdevices(void) | |||
363 | } | 363 | } |
364 | 364 | ||
365 | /** | 365 | /** |
366 | * write_swap_page - Write one page to a fresh swap location. | 366 | * write_page - Write one page to a fresh swap location. |
367 | * @addr: Address we're writing. | 367 | * @addr: Address we're writing. |
368 | * @loc: Place to store the entry we used. | 368 | * @loc: Place to store the entry we used. |
369 | * | 369 | * |
@@ -863,6 +863,9 @@ static int alloc_image_pages(void) | |||
863 | return 0; | 863 | return 0; |
864 | } | 864 | } |
865 | 865 | ||
866 | /* Free pages we allocated for suspend. Suspend pages are alocated | ||
867 | * before atomic copy, so we need to free them after resume. | ||
868 | */ | ||
866 | void swsusp_free(void) | 869 | void swsusp_free(void) |
867 | { | 870 | { |
868 | BUG_ON(PageNosave(virt_to_page(pagedir_save))); | 871 | BUG_ON(PageNosave(virt_to_page(pagedir_save))); |
@@ -918,6 +921,7 @@ static int swsusp_alloc(void) | |||
918 | 921 | ||
919 | pagedir_nosave = NULL; | 922 | pagedir_nosave = NULL; |
920 | nr_copy_pages = calc_nr(nr_copy_pages); | 923 | nr_copy_pages = calc_nr(nr_copy_pages); |
924 | nr_copy_pages_check = nr_copy_pages; | ||
921 | 925 | ||
922 | pr_debug("suspend: (pages needed: %d + %d free: %d)\n", | 926 | pr_debug("suspend: (pages needed: %d + %d free: %d)\n", |
923 | nr_copy_pages, PAGES_FOR_IO, nr_free_pages()); | 927 | nr_copy_pages, PAGES_FOR_IO, nr_free_pages()); |
@@ -940,7 +944,6 @@ static int swsusp_alloc(void) | |||
940 | return error; | 944 | return error; |
941 | } | 945 | } |
942 | 946 | ||
943 | nr_copy_pages_check = nr_copy_pages; | ||
944 | return 0; | 947 | return 0; |
945 | } | 948 | } |
946 | 949 | ||
@@ -1213,8 +1216,9 @@ static struct pbe * swsusp_pagedir_relocate(struct pbe *pblist) | |||
1213 | free_pagedir(pblist); | 1216 | free_pagedir(pblist); |
1214 | free_eaten_memory(); | 1217 | free_eaten_memory(); |
1215 | pblist = NULL; | 1218 | pblist = NULL; |
1216 | } | 1219 | /* Is this even worth handling? It should never ever happen, and we |
1217 | else | 1220 | have just lost user's state, anyway... */ |
1221 | } else | ||
1218 | printk("swsusp: Relocated %d pages\n", rel); | 1222 | printk("swsusp: Relocated %d pages\n", rel); |
1219 | 1223 | ||
1220 | return pblist; | 1224 | return pblist; |