Commit cf5e7a65 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Matthew Wilcox (Oracle)

fs: remove the NULL get_block case in mpage_writepages

No one calls mpage_writepages with a NULL get_block paramter, so remove
support for that case.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent f2d3e573
...@@ -638,8 +638,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, ...@@ -638,8 +638,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
* @mapping: address space structure to write * @mapping: address space structure to write
* @wbc: subtract the number of written pages from *@wbc->nr_to_write * @wbc: subtract the number of written pages from *@wbc->nr_to_write
* @get_block: the filesystem's block mapper function. * @get_block: the filesystem's block mapper function.
* If this is NULL then use a_ops->writepage. Otherwise, go
* direct-to-BIO.
* *
* This is a library function, which implements the writepages() * This is a library function, which implements the writepages()
* address_space_operation. * address_space_operation.
...@@ -656,24 +654,16 @@ int ...@@ -656,24 +654,16 @@ int
mpage_writepages(struct address_space *mapping, mpage_writepages(struct address_space *mapping,
struct writeback_control *wbc, get_block_t get_block) struct writeback_control *wbc, get_block_t get_block)
{ {
struct mpage_data mpd = {
.get_block = get_block,
};
struct blk_plug plug; struct blk_plug plug;
int ret; int ret;
blk_start_plug(&plug); blk_start_plug(&plug);
ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd);
if (!get_block) if (mpd.bio)
ret = generic_writepages(mapping, wbc); mpage_bio_submit(mpd.bio);
else {
struct mpage_data mpd = {
.bio = NULL,
.last_block_in_bio = 0,
.get_block = get_block,
};
ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd);
if (mpd.bio)
mpage_bio_submit(mpd.bio);
}
blk_finish_plug(&plug); blk_finish_plug(&plug);
return ret; return ret;
} }
......
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