mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-05 09:57:21 +02:00
fffca572f9
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>
31 lines
912 B
C
31 lines
912 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* include/linux/mpage.h
|
|
*
|
|
* Contains declarations related to preparing and submitting BIOS which contain
|
|
* multiple pagecache pages.
|
|
*/
|
|
|
|
/*
|
|
* (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do
|
|
* nested includes. Get it right in the .c file).
|
|
*/
|
|
#ifdef CONFIG_BLOCK
|
|
|
|
struct writeback_control;
|
|
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 (*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
|