From 890f141da068ab38d6dd52e6d109c1f488e980d8 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 24 Oct 2025 10:04:14 +0200 Subject: [PATCH] ocfs2: don't opencode filemap_fdatawrite_range in ocfs2_journal_submit_inode_data_buffers Use filemap_fdatawrite_range instead of opencoding the logic using filemap_fdatawrite_wbc. There is a slight change in the conversion as nr_to_write is now set to LONG_MAX instead of double the number of the pages in the range. LONG_MAX is the usual nr_to_write for WB_SYNC_ALL writeback, and the value expected by lower layers here. Signed-off-by: Christoph Hellwig Link: https://patch.msgid.link/20251024080431.324236-4-hch@lst.de Reviewed-by: Jan Kara Reviewed-by: Damien Le Moal Reviewed-by: Joseph Qi Reviewed-by: Johannes Thumshirn Signed-off-by: Christian Brauner --- fs/ocfs2/journal.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index e5f58ff2175f4..85239807dec78 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -902,15 +902,8 @@ bail: static int ocfs2_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) { - struct address_space *mapping = jinode->i_vfs_inode->i_mapping; - struct writeback_control wbc = { - .sync_mode = WB_SYNC_ALL, - .nr_to_write = mapping->nrpages * 2, - .range_start = jinode->i_dirty_start, - .range_end = jinode->i_dirty_end, - }; - - return filemap_fdatawrite_wbc(mapping, &wbc); + return filemap_fdatawrite_range(jinode->i_vfs_inode->i_mapping, + jinode->i_dirty_start, jinode->i_dirty_end); } int ocfs2_journal_init(struct ocfs2_super *osb, int *dirty) -- 2.47.3