public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.com>,
	Dave Kleikamp <shaggy@kernel.org>,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	jfs-discussion@lists.sourceforge.net
Subject: [PATCH 5/5] fs: remove the NULL get_block case in mpage_writepages
Date: Wed,  8 Jun 2022 17:04:51 +0200	[thread overview]
Message-ID: <20220608150451.1432388-6-hch@lst.de> (raw)
In-Reply-To: <20220608150451.1432388-1-hch@lst.de>

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>
---
 fs/mpage.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/fs/mpage.c b/fs/mpage.c
index a354ef2b4b4eb..e4cf881634a6a 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -636,8 +636,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
  * @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.
@@ -654,24 +652,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;
 }
-- 
2.30.2


  parent reply	other threads:[~2022-06-08 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 15:04 remove the nobh helpers Christoph Hellwig
2022-06-08 15:04 ` [PATCH 1/5] ext2: remove nobh support Christoph Hellwig
2022-06-08 16:39   ` Matthew Wilcox
2022-06-09  3:54     ` Christoph Hellwig
2022-06-09 17:32   ` Jan Kara
2022-06-08 15:04 ` [PATCH 2/5] jfs: stop using the nobh helper Christoph Hellwig
2022-06-08 15:04 ` [PATCH 3/5] fs: remove the nobh helpers Christoph Hellwig
2022-06-09 17:33   ` Jan Kara
2022-06-08 15:04 ` [PATCH 4/5] fs: don't call ->writepage from __mpage_writepage Christoph Hellwig
2022-06-09 17:31   ` Jan Kara
2022-06-10  8:00     ` Christoph Hellwig
2022-06-08 15:04 ` Christoph Hellwig [this message]
2022-06-09 17:25   ` [PATCH 5/5] fs: remove the NULL get_block case in mpage_writepages Jan Kara
2022-06-10  8:00     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220608150451.1432388-6-hch@lst.de \
    --to=hch@lst.de \
    --cc=jack@suse.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaggy@kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox