From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, axboe@kernel.dk
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH] block: use writeback_iter
Date: Fri, 2 May 2025 09:22:05 +0200 [thread overview]
Message-ID: <064e6ed7-d1fd-44bb-b383-6299a71bc504@suse.de> (raw)
In-Reply-To: <20250424082752.1967679-1-hch@lst.de>
On 4/24/25 10:27, Christoph Hellwig wrote:
> Use writeback_iter instead of the deprecated write_cache_pages wrapper
> in blkdev_writepages. This removes an indirect call per folio.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/fops.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/block/fops.c b/block/fops.c
> index be9f1dbea9ce..f073ef6d3f27 100644
> --- a/block/fops.c
> +++ b/block/fops.c
> @@ -451,12 +451,13 @@ static int blkdev_get_block(struct inode *inode, sector_t iblock,
> static int blkdev_writepages(struct address_space *mapping,
> struct writeback_control *wbc)
> {
> + struct folio *folio = NULL;
> struct blk_plug plug;
> int err;
>
> blk_start_plug(&plug);
> - err = write_cache_pages(mapping, wbc, block_write_full_folio,
> - blkdev_get_block);
> + while ((folio = writeback_iter(mapping, wbc, folio, &err)))
> + err = block_write_full_folio(folio, wbc, blkdev_get_block);
> blk_finish_plug(&plug);
>
> return err;
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2025-05-02 7:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 8:27 [PATCH] block: use writeback_iter Christoph Hellwig
2025-05-02 6:48 ` Christoph Hellwig
2025-05-02 7:30 ` John Garry
2025-05-02 7:22 ` Hannes Reinecke [this message]
2025-05-02 9:10 ` Johannes Thumshirn
2025-05-02 15:25 ` Jens Axboe
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=064e6ed7-d1fd-44bb-b383-6299a71bc504@suse.de \
--to=hare@suse.de \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.