]> www.infradead.org Git - users/hch/misc.git/commitdiff
ocfs2: don't opencode filemap_fdatawrite_range in ocfs2_journal_submit_inode_data_buffers
authorChristoph Hellwig <hch@lst.de>
Thu, 25 Sep 2025 11:13:44 +0000 (13:13 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 23 Oct 2025 06:47:24 +0000 (08:47 +0200)
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 <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
fs/ocfs2/journal.c

index e5f58ff2175f4161d7fead9bb9b095dc6c1abfef..85239807dec780cac1fe7b501b3456e83ac6ae94 100644 (file)
@@ -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)