public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: use writeback_iter
@ 2025-04-24  8:27 Christoph Hellwig
  2025-05-02  6:48 ` Christoph Hellwig
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Christoph Hellwig @ 2025-04-24  8:27 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

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;
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-02 15:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-05-02  9:10 ` Johannes Thumshirn
2025-05-02 15:25 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox