Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> --- fs/iomap/buffered-io.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 5050adbd4bc8..ec0189dc6747 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -534,7 +534,6 @@ EXPORT_SYMBOL_GPL(iomap_migrate_page); struct iomap_write_ctx { struct iomap_ioend *ioend; struct list_head iolist; - bool write_through; }; static void @@ -587,7 +586,7 @@ static bool iomap_can_add_to_ioend(struct iomap *iomap, } static struct iomap_ioend *iomap_alloc_ioend(struct inode *inode, - struct iomap *iomap, loff_t offset, sector_t sector, + const struct iomap *iomap, loff_t offset, sector_t sector, struct writeback_control *wbc) { struct iomap_ioend *ioend; @@ -888,7 +887,7 @@ static bool iomap_write_through(struct iomap_write_ctx *iwc, { unsigned int blksize = i_blocksize(inode); - if (!iwc || !iwc->write_through) + if (!iwc) return false; if (folio_test_dirty(folio)) return true; @@ -1078,13 +1077,13 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, }; struct iomap_write_ctx iwc = { .iolist = LIST_HEAD_INIT(iwc.iolist), - .write_through = iocb->ki_flags & IOCB_SYNC, }; + struct iomap_write_ctx *iwcp = iocb->ki_flags & IOCB_SYNC ? &iwc : NULL; struct iomap_ioend *ioend, *next; int ret; while ((ret = iomap_iter(&iter, ops)) > 0) - iter.processed = iomap_write_iter(&iter, i, &iwc); + iter.processed = iomap_write_iter(&iter, i, iwcp); list_for_each_entry_safe(ioend, next, &iwc.iolist, io_list) { list_del_init(&ioend->io_list); -- 2.34.1