Commit cf1e3fe4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Andrew Morton

mm/swap: remove the end_write_func argument to __swap_writepage

The argument is always set to end_swap_bio_write, so remove the argument
and mark end_swap_bio_write static.

Link: https://lkml.kernel.org/r/20220811141741.660214-1-hch@lst.deSigned-off-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f24263a5
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <linux/delayacct.h> #include <linux/delayacct.h>
#include "swap.h" #include "swap.h"
void end_swap_bio_write(struct bio *bio) static void end_swap_bio_write(struct bio *bio)
{ {
struct page *page = bio_first_page_all(bio); struct page *page = bio_first_page_all(bio);
...@@ -202,7 +202,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc) ...@@ -202,7 +202,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
end_page_writeback(page); end_page_writeback(page);
goto out; goto out;
} }
ret = __swap_writepage(page, wbc, end_swap_bio_write); ret = __swap_writepage(page, wbc);
out: out:
return ret; return ret;
} }
...@@ -332,8 +332,7 @@ static int swap_writepage_fs(struct page *page, struct writeback_control *wbc) ...@@ -332,8 +332,7 @@ static int swap_writepage_fs(struct page *page, struct writeback_control *wbc)
return 0; return 0;
} }
int __swap_writepage(struct page *page, struct writeback_control *wbc, int __swap_writepage(struct page *page, struct writeback_control *wbc)
bio_end_io_t end_write_func)
{ {
struct bio *bio; struct bio *bio;
int ret; int ret;
...@@ -358,7 +357,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, ...@@ -358,7 +357,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc), REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc),
GFP_NOIO); GFP_NOIO);
bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_iter.bi_sector = swap_page_sector(page);
bio->bi_end_io = end_write_func; bio->bi_end_io = end_swap_bio_write;
bio_add_page(bio, page, thp_size(page), 0); bio_add_page(bio, page, thp_size(page), 0);
bio_associate_blkg_from_page(bio, page); bio_associate_blkg_from_page(bio, page);
......
...@@ -18,9 +18,7 @@ static inline void swap_read_unplug(struct swap_iocb *plug) ...@@ -18,9 +18,7 @@ static inline void swap_read_unplug(struct swap_iocb *plug)
} }
void swap_write_unplug(struct swap_iocb *sio); void swap_write_unplug(struct swap_iocb *sio);
int swap_writepage(struct page *page, struct writeback_control *wbc); int swap_writepage(struct page *page, struct writeback_control *wbc);
void end_swap_bio_write(struct bio *bio); int __swap_writepage(struct page *page, struct writeback_control *wbc);
int __swap_writepage(struct page *page, struct writeback_control *wbc,
bio_end_io_t end_write_func);
/* linux/mm/swap_state.c */ /* linux/mm/swap_state.c */
/* One swap address space for each 64M swap space */ /* One swap address space for each 64M swap space */
......
...@@ -1026,7 +1026,7 @@ static int zswap_writeback_entry(struct zpool *pool, unsigned long handle) ...@@ -1026,7 +1026,7 @@ static int zswap_writeback_entry(struct zpool *pool, unsigned long handle)
SetPageReclaim(page); SetPageReclaim(page);
/* start writeback */ /* start writeback */
__swap_writepage(page, &wbc, end_swap_bio_write); __swap_writepage(page, &wbc);
put_page(page); put_page(page);
zswap_written_back_pages++; zswap_written_back_pages++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment