From: Christoph Hellwig <hch@lst.de>
To: Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.com>,
Dave Kleikamp <shaggy@kernel.org>,
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
jfs-discussion@lists.sourceforge.net, ntfs3@lists.linux.dev
Subject: [PATCH 6/6] fs: remove the NULL get_block case in mpage_writepages
Date: Mon, 13 Jun 2022 07:37:15 +0200 [thread overview]
Message-ID: <20220613053715.2394147-7-hch@lst.de> (raw)
In-Reply-To: <20220613053715.2394147-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
next prev parent reply other threads:[~2022-06-13 5:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 5:37 remove the nobh helpers v2 Christoph Hellwig
2022-06-13 5:37 ` [PATCH 1/6] ntfs3: refactor ntfs_writepages Christoph Hellwig
2022-06-13 10:46 ` Jan Kara
2022-06-13 5:37 ` [PATCH 2/6] ext2: remove nobh support Christoph Hellwig
2022-06-13 5:37 ` [PATCH 3/6] jfs: stop using the nobh helper Christoph Hellwig
2022-06-13 5:37 ` [PATCH 4/6] fs: remove the nobh helpers Christoph Hellwig
2022-06-13 5:37 ` [PATCH 5/6] fs: don't call ->writepage from __mpage_writepage Christoph Hellwig
2022-06-13 10:53 ` Jan Kara
2022-06-13 5:37 ` Christoph Hellwig [this message]
2022-06-13 10:53 ` [PATCH 6/6] fs: remove the NULL get_block case in mpage_writepages Jan Kara
2022-06-19 15:46 ` remove the nobh helpers v2 Matthew Wilcox
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=20220613053715.2394147-7-hch@lst.de \
--to=hch@lst.de \
--cc=almaz.alexandrovich@paragon-software.com \
--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=ntfs3@lists.linux.dev \
--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