aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-12-07 20:09:43 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 18:30:55 -0500
commit23976728a48c3b76d34e17ead19addd52b3a280e (patch)
tree964eb95ae9dccb179165649c7ea631d96b23bc91 /kernel/power/swap.c
parent465d2b477f6a0ffe01242561a93e7bf81d67c776 (diff)
Hibernation: Update messages
Make hibernation messages start with one common prefix "PM: " and use the word "hibernation" in the messages as a synonym of "suspend to disk". Turn some KERN_INFO messages into debug ones. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'kernel/power/swap.c')
-rw-r--r--kernel/power/swap.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index ef41440879ba..a0abf9a463f9 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -71,7 +71,8 @@ static int submit(int rw, pgoff_t page_off, struct page *page,
71 bio->bi_end_io = end_swap_bio_read; 71 bio->bi_end_io = end_swap_bio_read;
72 72
73 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { 73 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
74 printk("swsusp: ERROR: adding page to bio at %ld\n", page_off); 74 printk(KERN_ERR "PM: Adding page to bio failed at %ld\n",
75 page_off);
75 bio_put(bio); 76 bio_put(bio);
76 return -EFAULT; 77 return -EFAULT;
77 } 78 }
@@ -151,7 +152,7 @@ static int mark_swapfiles(sector_t start, unsigned int flags)
151 error = bio_write_page(swsusp_resume_block, 152 error = bio_write_page(swsusp_resume_block,
152 swsusp_header, NULL); 153 swsusp_header, NULL);
153 } else { 154 } else {
154 printk(KERN_ERR "swsusp: Swap header not found!\n"); 155 printk(KERN_ERR "PM: Swap header not found!\n");
155 error = -ENODEV; 156 error = -ENODEV;
156 } 157 }
157 return error; 158 return error;
@@ -323,7 +324,8 @@ static int save_image(struct swap_map_handle *handle,
323 struct timeval start; 324 struct timeval start;
324 struct timeval stop; 325 struct timeval stop;
325 326
326 printk("Saving image data pages (%u pages) ... ", nr_to_write); 327 printk(KERN_INFO "PM: Saving image data pages (%u pages) ... ",
328 nr_to_write);
327 m = nr_to_write / 100; 329 m = nr_to_write / 100;
328 if (!m) 330 if (!m)
329 m = 1; 331 m = 1;
@@ -363,7 +365,7 @@ static int enough_swap(unsigned int nr_pages)
363{ 365{
364 unsigned int free_swap = count_swap_pages(root_swap, 1); 366 unsigned int free_swap = count_swap_pages(root_swap, 1);
365 367
366 pr_debug("swsusp: free swap pages: %u\n", free_swap); 368 pr_debug("PM: Free swap pages: %u\n", free_swap);
367 return free_swap > nr_pages + PAGES_FOR_IO; 369 return free_swap > nr_pages + PAGES_FOR_IO;
368} 370}
369 371
@@ -386,7 +388,7 @@ int swsusp_write(unsigned int flags)
386 388
387 error = swsusp_swap_check(); 389 error = swsusp_swap_check();
388 if (error) { 390 if (error) {
389 printk(KERN_ERR "swsusp: Cannot find swap device, try " 391 printk(KERN_ERR "PM: Cannot find swap device, try "
390 "swapon -a.\n"); 392 "swapon -a.\n");
391 return error; 393 return error;
392 } 394 }
@@ -400,7 +402,7 @@ int swsusp_write(unsigned int flags)
400 } 402 }
401 header = (struct swsusp_info *)data_of(snapshot); 403 header = (struct swsusp_info *)data_of(snapshot);
402 if (!enough_swap(header->pages)) { 404 if (!enough_swap(header->pages)) {
403 printk(KERN_ERR "swsusp: Not enough free swap\n"); 405 printk(KERN_ERR "PM: Not enough free swap\n");
404 error = -ENOSPC; 406 error = -ENOSPC;
405 goto out; 407 goto out;
406 } 408 }
@@ -415,7 +417,7 @@ int swsusp_write(unsigned int flags)
415 417
416 if (!error) { 418 if (!error) {
417 flush_swap_writer(&handle); 419 flush_swap_writer(&handle);
418 printk("S"); 420 printk(KERN_INFO "PM: S");
419 error = mark_swapfiles(start, flags); 421 error = mark_swapfiles(start, flags);
420 printk("|\n"); 422 printk("|\n");
421 } 423 }
@@ -505,7 +507,8 @@ static int load_image(struct swap_map_handle *handle,
505 int err2; 507 int err2;
506 unsigned nr_pages; 508 unsigned nr_pages;
507 509
508 printk("Loading image data pages (%u pages) ... ", nr_to_read); 510 printk(KERN_INFO "PM: Loading image data pages (%u pages) ... ",
511 nr_to_read);
509 m = nr_to_read / 100; 512 m = nr_to_read / 100;
510 if (!m) 513 if (!m)
511 m = 1; 514 m = 1;
@@ -556,7 +559,7 @@ int swsusp_read(unsigned int *flags_p)
556 559
557 *flags_p = swsusp_header->flags; 560 *flags_p = swsusp_header->flags;
558 if (IS_ERR(resume_bdev)) { 561 if (IS_ERR(resume_bdev)) {
559 pr_debug("swsusp: block device not initialised\n"); 562 pr_debug("PM: Image device not initialised\n");
560 return PTR_ERR(resume_bdev); 563 return PTR_ERR(resume_bdev);
561 } 564 }
562 565
@@ -575,9 +578,9 @@ int swsusp_read(unsigned int *flags_p)
575 blkdev_put(resume_bdev); 578 blkdev_put(resume_bdev);
576 579
577 if (!error) 580 if (!error)
578 pr_debug("swsusp: Reading resume file was successful\n"); 581 pr_debug("PM: Image successfully loaded\n");
579 else 582 else
580 pr_debug("swsusp: Error %d resuming\n", error); 583 pr_debug("PM: Error %d resuming\n", error);
581 return error; 584 return error;
582} 585}
583 586
@@ -609,13 +612,13 @@ int swsusp_check(void)
609 if (error) 612 if (error)
610 blkdev_put(resume_bdev); 613 blkdev_put(resume_bdev);
611 else 614 else
612 pr_debug("swsusp: Signature found, resuming\n"); 615 pr_debug("PM: Signature found, resuming\n");
613 } else { 616 } else {
614 error = PTR_ERR(resume_bdev); 617 error = PTR_ERR(resume_bdev);
615 } 618 }
616 619
617 if (error) 620 if (error)
618 pr_debug("swsusp: Error %d check for resume file\n", error); 621 pr_debug("PM: Error %d checking image file\n", error);
619 622
620 return error; 623 return error;
621} 624}
@@ -627,7 +630,7 @@ int swsusp_check(void)
627void swsusp_close(void) 630void swsusp_close(void)
628{ 631{
629 if (IS_ERR(resume_bdev)) { 632 if (IS_ERR(resume_bdev)) {
630 pr_debug("swsusp: block device not initialised\n"); 633 pr_debug("PM: Image device not initialised\n");
631 return; 634 return;
632 } 635 }
633 636