summaryrefslogtreecommitdiff
path: root/block/fops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2025-07-10 15:33:26 +0200
committerChristian Brauner <brauner@kernel.org>2025-07-14 10:51:31 +0200
commit67fd9615a782b11cd0c62823d722a815c9e1eb75 (patch)
treeb357562d0c6083e5188f26cd3829532ccd11ea83 /block/fops.c
parent8cd0a39cab5644539956a44af5f768bf7e45b55a (diff)
downloadlinux-67fd9615a782b11cd0c62823d722a815c9e1eb75.tar.gz
linux-67fd9615a782b11cd0c62823d722a815c9e1eb75.tar.bz2
linux-67fd9615a782b11cd0c62823d722a815c9e1eb75.zip
iomap: pass more arguments using the iomap writeback context
Add inode and wpc fields to pass the inode and writeback context that are needed in the entire writeback call chain, and let the callers initialize all fields in the writeback context before calling iomap_writepages to simplify the argument passing. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/20250710133343.399917-3-hch@lst.de Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Joanne Koong <joannelkoong@gmail.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'block/fops.c')
-rw-r--r--block/fops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/block/fops.c b/block/fops.c
index 1309861d4c2c..3394263d942b 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -558,9 +558,13 @@ static const struct iomap_writeback_ops blkdev_writeback_ops = {
static int blkdev_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{
- struct iomap_writepage_ctx wpc = { };
+ struct iomap_writepage_ctx wpc = {
+ .inode = mapping->host,
+ .wbc = wbc,
+ .ops = &blkdev_writeback_ops
+ };
- return iomap_writepages(mapping, wbc, &wpc, &blkdev_writeback_ops);
+ return iomap_writepages(&wpc);
}
const struct address_space_operations def_blk_aops = {