Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc30c5d6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a104808e
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -264,7 +264,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
	int ret;
	int ret;
	struct swap_info_struct *sis = page_swap_info(page);
	struct swap_info_struct *sis = page_swap_info(page);


	BUG_ON(!PageSwapCache(page));
	VM_BUG_ON_PAGE(!PageSwapCache(page), page);
	if (sis->flags & SWP_FILE) {
	if (sis->flags & SWP_FILE) {
		struct kiocb kiocb;
		struct kiocb kiocb;
		struct file *swap_file = sis->swap_file;
		struct file *swap_file = sis->swap_file;
@@ -338,7 +338,7 @@ int swap_readpage(struct page *page)
	int ret = 0;
	int ret = 0;
	struct swap_info_struct *sis = page_swap_info(page);
	struct swap_info_struct *sis = page_swap_info(page);


	BUG_ON(!PageSwapCache(page));
	VM_BUG_ON_PAGE(!PageSwapCache(page), page);
	VM_BUG_ON_PAGE(!PageLocked(page), page);
	VM_BUG_ON_PAGE(!PageLocked(page), page);
	VM_BUG_ON_PAGE(PageUptodate(page), page);
	VM_BUG_ON_PAGE(PageUptodate(page), page);
	if (frontswap_load(page) == 0) {
	if (frontswap_load(page) == 0) {
@@ -388,7 +388,8 @@ int swap_set_page_dirty(struct page *page)


	if (sis->flags & SWP_FILE) {
	if (sis->flags & SWP_FILE) {
		struct address_space *mapping = sis->swap_file->f_mapping;
		struct address_space *mapping = sis->swap_file->f_mapping;
		BUG_ON(!PageSwapCache(page));

		VM_BUG_ON_PAGE(!PageSwapCache(page), page);
		return mapping->a_ops->set_page_dirty(page);
		return mapping->a_ops->set_page_dirty(page);
	} else {
	} else {
		return __set_page_dirty_no_writeback(page);
		return __set_page_dirty_no_writeback(page);