aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2016-10-07 20:00:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:29 -0400
commitcc30c5d6461a2813406f7f84d581643781922a82 (patch)
tree663ceb261feec5694904bbed32a02b64b891d814 /mm
parenta104808e212a9ee97e6b9cb6945185e50905f009 (diff)
mm/page_io.c: replace some BUG_ON()s with VM_BUG_ON_PAGE()
So they are CONFIG_DEBUG_VM-only and more informative. Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: David S. Miller <davem@davemloft.net> Cc: Hugh Dickins <hughd@google.com> Cc: Jens Axboe <axboe@fb.com> Cc: Joe Perches <joe@perches.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Michal Hocko <mhocko@suse.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Rik van Riel <riel@redhat.com> Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index eafe5ddc2b54..a2651f58c86a 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -264,7 +264,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
264 int ret; 264 int ret;
265 struct swap_info_struct *sis = page_swap_info(page); 265 struct swap_info_struct *sis = page_swap_info(page);
266 266
267 BUG_ON(!PageSwapCache(page)); 267 VM_BUG_ON_PAGE(!PageSwapCache(page), page);
268 if (sis->flags & SWP_FILE) { 268 if (sis->flags & SWP_FILE) {
269 struct kiocb kiocb; 269 struct kiocb kiocb;
270 struct file *swap_file = sis->swap_file; 270 struct file *swap_file = sis->swap_file;
@@ -338,7 +338,7 @@ int swap_readpage(struct page *page)
338 int ret = 0; 338 int ret = 0;
339 struct swap_info_struct *sis = page_swap_info(page); 339 struct swap_info_struct *sis = page_swap_info(page);
340 340
341 BUG_ON(!PageSwapCache(page)); 341 VM_BUG_ON_PAGE(!PageSwapCache(page), page);
342 VM_BUG_ON_PAGE(!PageLocked(page), page); 342 VM_BUG_ON_PAGE(!PageLocked(page), page);
343 VM_BUG_ON_PAGE(PageUptodate(page), page); 343 VM_BUG_ON_PAGE(PageUptodate(page), page);
344 if (frontswap_load(page) == 0) { 344 if (frontswap_load(page) == 0) {
@@ -388,7 +388,8 @@ int swap_set_page_dirty(struct page *page)
388 388
389 if (sis->flags & SWP_FILE) { 389 if (sis->flags & SWP_FILE) {
390 struct address_space *mapping = sis->swap_file->f_mapping; 390 struct address_space *mapping = sis->swap_file->f_mapping;
391 BUG_ON(!PageSwapCache(page)); 391
392 VM_BUG_ON_PAGE(!PageSwapCache(page), page);
392 return mapping->a_ops->set_page_dirty(page); 393 return mapping->a_ops->set_page_dirty(page);
393 } else { 394 } else {
394 return __set_page_dirty_no_writeback(page); 395 return __set_page_dirty_no_writeback(page);