diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-10-24 10:04:12 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-10-29 15:50:40 +0100 |
| commit | a21134b5d6cb5e9e11fd170c48eeba6f82f1b2a0 (patch) | |
| tree | e9a725eeec0a862879af5c79ccd60a7366b94a2b /mm/filemap.c | |
| parent | d6e6215907640801b1f407dc9e871b19ca5a3805 (diff) | |
mm: don't opencode filemap_fdatawrite_range in filemap_invalidate_inode
Use filemap_fdatawrite_range instead of opencoding the logic using
filemap_fdatawrite_wbc.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20251024080431.324236-2-hch@lst.de
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'mm/filemap.c')
| -rw-r--r-- | mm/filemap.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 13f0259d993c..99d6919af60d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -4457,16 +4457,8 @@ int filemap_invalidate_inode(struct inode *inode, bool flush, unmap_mapping_pages(mapping, first, nr, false); /* Write back the data if we're asked to. */ - if (flush) { - struct writeback_control wbc = { - .sync_mode = WB_SYNC_ALL, - .nr_to_write = LONG_MAX, - .range_start = start, - .range_end = end, - }; - - filemap_fdatawrite_wbc(mapping, &wbc); - } + if (flush) + filemap_fdatawrite_range(mapping, start, end); /* Wait for writeback to complete on all folios and discard. */ invalidate_inode_pages2_range(mapping, start / PAGE_SIZE, end / PAGE_SIZE); |