Skip to content

Commit ca742a8

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
squashfs: pass the inode to squashfs_readahead_fragment()
Patch series "squashfs: Remove page->mapping references". We're close to being able to kill page->mapping. These two patches get us a little bit closer. This patch (of 2): Eliminate a reference to page->mapping by passing the inode from the caller. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Phillip Lougher <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0ba5a25 commit ca742a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/squashfs/file.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,9 @@ static int squashfs_read_folio(struct file *file, struct folio *folio)
493493
return res;
494494
}
495495

496-
static int squashfs_readahead_fragment(struct page **page,
496+
static int squashfs_readahead_fragment(struct inode *inode, struct page **page,
497497
unsigned int pages, unsigned int expected, loff_t start)
498498
{
499-
struct inode *inode = page[0]->mapping->host;
500499
struct squashfs_cache_entry *buffer = squashfs_get_fragment(inode->i_sb,
501500
squashfs_i(inode)->fragment_block,
502501
squashfs_i(inode)->fragment_size);
@@ -605,8 +604,8 @@ static void squashfs_readahead(struct readahead_control *ractl)
605604

606605
if (start >> msblk->block_log == file_end &&
607606
squashfs_i(inode)->fragment_block != SQUASHFS_INVALID_BLK) {
608-
res = squashfs_readahead_fragment(pages, nr_pages,
609-
expected, start);
607+
res = squashfs_readahead_fragment(inode, pages,
608+
nr_pages, expected, start);
610609
if (res)
611610
goto skip_pages;
612611
continue;

0 commit comments

Comments
 (0)