Skip to content

Commit cf5e7a6

Browse files
Christoph HellwigMatthew Wilcox (Oracle)
authored andcommitted
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
1 parent f2d3e57 commit cf5e7a6

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

fs/mpage.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
638638
* @mapping: address space structure to write
639639
* @wbc: subtract the number of written pages from *@wbc->nr_to_write
640640
* @get_block: the filesystem's block mapper function.
641-
* If this is NULL then use a_ops->writepage. Otherwise, go
642-
* direct-to-BIO.
643641
*
644642
* This is a library function, which implements the writepages()
645643
* address_space_operation.
@@ -656,24 +654,16 @@ int
656654
mpage_writepages(struct address_space *mapping,
657655
struct writeback_control *wbc, get_block_t get_block)
658656
{
657+
struct mpage_data mpd = {
658+
.get_block = get_block,
659+
};
659660
struct blk_plug plug;
660661
int ret;
661662

662663
blk_start_plug(&plug);
663-
664-
if (!get_block)
665-
ret = generic_writepages(mapping, wbc);
666-
else {
667-
struct mpage_data mpd = {
668-
.bio = NULL,
669-
.last_block_in_bio = 0,
670-
.get_block = get_block,
671-
};
672-
673-
ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd);
674-
if (mpd.bio)
675-
mpage_bio_submit(mpd.bio);
676-
}
664+
ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd);
665+
if (mpd.bio)
666+
mpage_bio_submit(mpd.bio);
677667
blk_finish_plug(&plug);
678668
return ret;
679669
}

0 commit comments

Comments
 (0)