aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2013-09-11 17:20:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:03 -0400
commit465c47fd8dc44302fed6c4eab8927464744ce08c (patch)
tree650b62bfe8a0ec029736b18e604575a1106cc1b5 /mm/swapfile.c
parentd6bbbd29b1de2da807753be8a3a992a72aef42de (diff)
mm/swapfile.c: convert to pr_foo()
A few 80-col gymnastics were cleaned up as a result. Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index b5212eea6c3c..6ef2d15c5fe3 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -527,16 +527,16 @@ static struct swap_info_struct *swap_info_get(swp_entry_t entry)
527 return p; 527 return p;
528 528
529bad_free: 529bad_free:
530 printk(KERN_ERR "swap_free: %s%08lx\n", Unused_offset, entry.val); 530 pr_err("swap_free: %s%08lx\n", Unused_offset, entry.val);
531 goto out; 531 goto out;
532bad_offset: 532bad_offset:
533 printk(KERN_ERR "swap_free: %s%08lx\n", Bad_offset, entry.val); 533 pr_err("swap_free: %s%08lx\n", Bad_offset, entry.val);
534 goto out; 534 goto out;
535bad_device: 535bad_device:
536 printk(KERN_ERR "swap_free: %s%08lx\n", Unused_file, entry.val); 536 pr_err("swap_free: %s%08lx\n", Unused_file, entry.val);
537 goto out; 537 goto out;
538bad_nofile: 538bad_nofile:
539 printk(KERN_ERR "swap_free: %s%08lx\n", Bad_file, entry.val); 539 pr_err("swap_free: %s%08lx\n", Bad_file, entry.val);
540out: 540out:
541 return NULL; 541 return NULL;
542} 542}
@@ -1929,7 +1929,7 @@ static unsigned long read_swap_header(struct swap_info_struct *p,
1929 unsigned long last_page; 1929 unsigned long last_page;
1930 1930
1931 if (memcmp("SWAPSPACE2", swap_header->magic.magic, 10)) { 1931 if (memcmp("SWAPSPACE2", swap_header->magic.magic, 10)) {
1932 printk(KERN_ERR "Unable to find swap-space signature\n"); 1932 pr_err("Unable to find swap-space signature\n");
1933 return 0; 1933 return 0;
1934 } 1934 }
1935 1935
@@ -1943,9 +1943,8 @@ static unsigned long read_swap_header(struct swap_info_struct *p,
1943 } 1943 }
1944 /* Check the swap header's sub-version */ 1944 /* Check the swap header's sub-version */
1945 if (swap_header->info.version != 1) { 1945 if (swap_header->info.version != 1) {
1946 printk(KERN_WARNING 1946 pr_warn("Unable to handle swap header version %d\n",
1947 "Unable to handle swap header version %d\n", 1947 swap_header->info.version);
1948 swap_header->info.version);
1949 return 0; 1948 return 0;
1950 } 1949 }
1951 1950
@@ -1971,8 +1970,7 @@ static unsigned long read_swap_header(struct swap_info_struct *p,
1971 swp_entry_to_pte(swp_entry(0, ~0UL)))) + 1; 1970 swp_entry_to_pte(swp_entry(0, ~0UL)))) + 1;
1972 last_page = swap_header->info.last_page; 1971 last_page = swap_header->info.last_page;
1973 if (last_page > maxpages) { 1972 if (last_page > maxpages) {
1974 printk(KERN_WARNING 1973 pr_warn("Truncating oversized swap area, only using %luk out of %luk\n",
1975 "Truncating oversized swap area, only using %luk out of %luk\n",
1976 maxpages << (PAGE_SHIFT - 10), 1974 maxpages << (PAGE_SHIFT - 10),
1977 last_page << (PAGE_SHIFT - 10)); 1975 last_page << (PAGE_SHIFT - 10));
1978 } 1976 }
@@ -1988,8 +1986,7 @@ static unsigned long read_swap_header(struct swap_info_struct *p,
1988 return 0; 1986 return 0;
1989 swapfilepages = i_size_read(inode) >> PAGE_SHIFT; 1987 swapfilepages = i_size_read(inode) >> PAGE_SHIFT;
1990 if (swapfilepages && maxpages > swapfilepages) { 1988 if (swapfilepages && maxpages > swapfilepages) {
1991 printk(KERN_WARNING 1989 pr_warn("Swap area shorter than signature indicates\n");
1992 "Swap area shorter than signature indicates\n");
1993 return 0; 1990 return 0;
1994 } 1991 }
1995 if (swap_header->info.nr_badpages && S_ISREG(inode->i_mode)) 1992 if (swap_header->info.nr_badpages && S_ISREG(inode->i_mode))
@@ -2032,7 +2029,7 @@ static int setup_swap_map_and_extents(struct swap_info_struct *p,
2032 nr_good_pages = p->pages; 2029 nr_good_pages = p->pages;
2033 } 2030 }
2034 if (!nr_good_pages) { 2031 if (!nr_good_pages) {
2035 printk(KERN_WARNING "Empty swap-file\n"); 2032 pr_warn("Empty swap-file\n");
2036 return -EINVAL; 2033 return -EINVAL;
2037 } 2034 }
2038 2035
@@ -2186,8 +2183,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
2186 if (p->flags & SWP_AREA_DISCARD) { 2183 if (p->flags & SWP_AREA_DISCARD) {
2187 int err = discard_swap(p); 2184 int err = discard_swap(p);
2188 if (unlikely(err)) 2185 if (unlikely(err))
2189 printk(KERN_ERR 2186 pr_err("swapon: discard_swap(%p): %d\n",
2190 "swapon: discard_swap(%p): %d\n",
2191 p, err); 2187 p, err);
2192 } 2188 }
2193 } 2189 }
@@ -2200,7 +2196,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
2200 (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT; 2196 (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT;
2201 enable_swap_info(p, prio, swap_map, frontswap_map); 2197 enable_swap_info(p, prio, swap_map, frontswap_map);
2202 2198
2203 printk(KERN_INFO "Adding %uk swap on %s. " 2199 pr_info("Adding %uk swap on %s. "
2204 "Priority:%d extents:%d across:%lluk %s%s%s%s%s\n", 2200 "Priority:%d extents:%d across:%lluk %s%s%s%s%s\n",
2205 p->pages<<(PAGE_SHIFT-10), name->name, p->prio, 2201 p->pages<<(PAGE_SHIFT-10), name->name, p->prio,
2206 nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10), 2202 nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10),
@@ -2334,7 +2330,7 @@ out:
2334 return err; 2330 return err;
2335 2331
2336bad_file: 2332bad_file:
2337 printk(KERN_ERR "swap_dup: %s%08lx\n", Bad_file, entry.val); 2333 pr_err("swap_dup: %s%08lx\n", Bad_file, entry.val);
2338 goto out; 2334 goto out;
2339} 2335}
2340 2336