diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-09-26 10:50:29 +0100 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-09-26 10:50:29 +0100 |
commit | e8c2cd99a3933d93413910bc93cbd5b53177110b (patch) | |
tree | ea4c1d63b1bdeb9ef1aacacad0ac9c7dc0768fdc /kernel/power/swsusp.c | |
parent | 5a8c0cc32bb6e029cd9c36f655c6b0955b0d9967 (diff) | |
parent | 8ddec7460d2f5db3ac35812c03676b1473d1d668 (diff) |
Merge branch 'master' of /home/src/linux-2.6/
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 d967e875ee8..1cc9ff25e47 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -363,7 +363,7 @@ static void lock_swapdevices(void) } /** - * write_swap_page - Write one page to a fresh swap location. + * write_page - Write one page to a fresh swap location. * @addr: Address we're writing. * @loc: Place to store the entry we used. * @@ -863,6 +863,9 @@ static int alloc_image_pages(void) return 0; } +/* Free pages we allocated for suspend. Suspend pages are alocated + * before atomic copy, so we need to free them after resume. + */ void swsusp_free(void) { BUG_ON(PageNosave(virt_to_page(pagedir_save))); @@ -918,6 +921,7 @@ static int swsusp_alloc(void) pagedir_nosave = NULL; nr_copy_pages = calc_nr(nr_copy_pages); + nr_copy_pages_check = nr_copy_pages; pr_debug("suspend: (pages needed: %d + %d free: %d)\n", nr_copy_pages, PAGES_FOR_IO, nr_free_pages()); @@ -940,7 +944,6 @@ static int swsusp_alloc(void) return error; } - nr_copy_pages_check = nr_copy_pages; return 0; } @@ -1213,8 +1216,9 @@ static struct pbe * swsusp_pagedir_relocate(struct pbe *pblist) free_pagedir(pblist); free_eaten_memory(); pblist = NULL; - } - else + /* Is this even worth handling? It should never ever happen, and we + have just lost user's state, anyway... */ + } else printk("swsusp: Relocated %d pages\n", rel); return pblist; |