Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

squashfs: Convert squashfs to read_folio

This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

+7 -5
+3 -2
fs/squashfs/file.c
··· 444 444 return 0; 445 445 } 446 446 447 - static int squashfs_readpage(struct file *file, struct page *page) 447 + static int squashfs_read_folio(struct file *file, struct folio *folio) 448 448 { 449 + struct page *page = &folio->page; 449 450 struct inode *inode = page->mapping->host; 450 451 struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; 451 452 int index = page->index >> (msblk->block_log - PAGE_SHIFT); ··· 497 496 498 497 499 498 const struct address_space_operations squashfs_aops = { 500 - .readpage = squashfs_readpage 499 + .read_folio = squashfs_read_folio 501 500 };
+1 -1
fs/squashfs/super.c
··· 148 148 149 149 /* 150 150 * squashfs provides 'backing_dev_info' in order to disable read-ahead. For 151 - * squashfs, I/O is not deferred, it is done immediately in readpage, 151 + * squashfs, I/O is not deferred, it is done immediately in read_folio, 152 152 * which means the user would always have to wait their own I/O. So the effect 153 153 * of readahead is very weak for squashfs. squashfs_bdi_init will set 154 154 * sb->s_bdi->ra_pages and sb->s_bdi->io_pages to 0 and close readahead for
+3 -2
fs/squashfs/symlink.c
··· 30 30 #include "squashfs.h" 31 31 #include "xattr.h" 32 32 33 - static int squashfs_symlink_readpage(struct file *file, struct page *page) 33 + static int squashfs_symlink_read_folio(struct file *file, struct folio *folio) 34 34 { 35 + struct page *page = &folio->page; 35 36 struct inode *inode = page->mapping->host; 36 37 struct super_block *sb = inode->i_sb; 37 38 struct squashfs_sb_info *msblk = sb->s_fs_info; ··· 102 101 103 102 104 103 const struct address_space_operations squashfs_symlink_aops = { 105 - .readpage = squashfs_symlink_readpage 104 + .read_folio = squashfs_symlink_read_folio 106 105 }; 107 106 108 107 const struct inode_operations squashfs_symlink_inode_ops = {