diff options
| author | Jan Kara <jack@suse.cz> | 2026-03-26 15:06:31 +0100 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2026-03-27 17:01:36 +0100 |
| commit | fffca572f9ca51607f180a37d0c898404c8f9112 (patch) | |
| tree | 0b91de63e160267c7b47a5b420ea880cd1fc2ece /include/linux | |
| parent | c369299895a591d96745d6492d4888259b004a9e (diff) | |
mpage: Provide variant of mpage_writepages() with own optional folio handler
Some filesystems need to treat some folios specially (for example for
inodes with inline data). Doing the handling in their .writepages method
in a race-free manner results in duplicating some of the writeback
internals. So provide generalized version of mpage_writepages() that
allows filesystem to provide a handler called for each folio which can
handle the folio in a special way.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260326140635.15895-3-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mpage.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/mpage.h b/include/linux/mpage.h index 1bdc39daac0a..358946990bfa 100644 --- a/include/linux/mpage.h +++ b/include/linux/mpage.h @@ -17,7 +17,14 @@ struct readahead_control; void mpage_readahead(struct readahead_control *, get_block_t get_block); int mpage_read_folio(struct folio *folio, get_block_t get_block); -int mpage_writepages(struct address_space *mapping, - struct writeback_control *wbc, get_block_t get_block); +int __mpage_writepages(struct address_space *mapping, + struct writeback_control *wbc, get_block_t get_block, + int (*write_folio)(struct folio *folio, + struct writeback_control *wbc)); +static inline int mpage_writepages(struct address_space *mapping, + struct writeback_control *wbc, get_block_t get_block) +{ + return __mpage_writepages(mapping, wbc, get_block, NULL); +} #endif |
