fs: Convert mpage_readpage to mpage_read_folio
mpage_readpage still works in terms of pages, and has not been audited for correctness with large folios, so include an assertion that the filesystem is not passing it large folios. Convert all the filesystems to call mpage_read_folio() instead of mpage_readpage(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
7bcf79cf5a
commit
c9d13ea12a
11
inode.c
11
inode.c
@ -337,10 +337,17 @@ unlock_ret:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
|
||||||
|
static int exfat_read_folio(struct file *file, struct folio *folio)
|
||||||
|
{
|
||||||
|
return mpage_read_folio(folio, exfat_get_block);
|
||||||
|
}
|
||||||
|
#else
|
||||||
static int exfat_readpage(struct file *file, struct page *page)
|
static int exfat_readpage(struct file *file, struct page *page)
|
||||||
{
|
{
|
||||||
return mpage_readpage(page, exfat_get_block);
|
return mpage_readpage(page, exfat_get_block);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||||
static void exfat_readahead(struct readahead_control *rac)
|
static void exfat_readahead(struct readahead_control *rac)
|
||||||
@ -516,7 +523,11 @@ static const struct address_space_operations exfat_aops = {
|
|||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||||
.invalidate_folio = block_invalidate_folio,
|
.invalidate_folio = block_invalidate_folio,
|
||||||
#endif
|
#endif
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
|
||||||
|
.read_folio = exfat_read_folio,
|
||||||
|
#else
|
||||||
.readpage = exfat_readpage,
|
.readpage = exfat_readpage,
|
||||||
|
#endif
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||||
.readahead = exfat_readahead,
|
.readahead = exfat_readahead,
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user