summaryrefslogtreecommitdiff
path: root/mm/page_io.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2020-10-13 16:52:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-10-13 18:38:30 -0700
commit548d9782bd844048bc6b5159c848772a5fe3da32 (patch)
tree9f9026358ebada0890159884342e33dfbf8ee813 /mm/page_io.c
parentf3bc52cb04bcfccd12da3f03ca8bc50484898436 (diff)
mm/page_io.c: remove useless out label in __swap_writepage()
The out label is only used in one place and return ret directly without something like resource cleanup or lock release and so on. So we should remove this jump label and do some cleanup. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Link: https://lkml.kernel.org/r/20200927124032.22521-1-linmiaohe@huawei.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_io.c')
-rw-r--r--mm/page_io.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index 2ffe4c4a6d97..433df1263349 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -359,13 +359,11 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
return 0;
}
- ret = 0;
bio = get_swap_bio(GFP_NOIO, page, end_write_func);
if (bio == NULL) {
set_page_dirty(page);
unlock_page(page);
- ret = -ENOMEM;
- goto out;
+ return -ENOMEM;
}
bio->bi_opf = REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc);
bio_associate_blkg_from_page(bio, page);
@@ -373,8 +371,8 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
set_page_writeback(page);
unlock_page(page);
submit_bio(bio);
-out:
- return ret;
+
+ return 0;
}
int swap_readpage(struct page *page, bool synchronous)