]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fs: remove the NULL get_block case in mpage_writepages
authorChristoph Hellwig <hch@lst.de>
Mon, 13 Jun 2022 05:37:15 +0000 (07:37 +0200)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 2 Aug 2022 16:34:04 +0000 (12:34 -0400)
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>
fs/mpage.c

index bf7d1cf621e2f843888b33f59c0179193403fe3f..8326ff8a7a96eb728f027f4c309ebdbd64820858 100644 (file)
@@ -638,8 +638,6 @@ out:
  * @mapping: address space structure to write
  * @wbc: subtract the number of written pages from *@wbc->nr_to_write
  * @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()
  * address_space_operation.
@@ -656,24 +654,16 @@ int
 mpage_writepages(struct address_space *mapping,
                struct writeback_control *wbc, get_block_t get_block)
 {
+       struct mpage_data mpd = {
+               .get_block      = get_block,
+       };
        struct blk_plug plug;
        int ret;
 
        blk_start_plug(&plug);
-
-       if (!get_block)
-               ret = generic_writepages(mapping, wbc);
-       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);
-       }
+       ret = write_cache_pages(mapping, wbc, __mpage_writepage, &mpd);
+       if (mpd.bio)
+               mpage_bio_submit(mpd.bio);
        blk_finish_plug(&plug);
        return ret;
 }