]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
squashfs: Pass the inode to squashfs_readahead_fragment()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 17 Mar 2025 13:33:21 +0000 (09:33 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 17 Mar 2025 19:55:41 +0000 (15:55 -0400)
Eliminate a reference to page->mapping by passing the inode from
the caller.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
fs/squashfs/file.c

index 5ca2baa16dc25dc10c3a69bb0de82956a222e062..ce7d661d5ad86638da6fd31f817f2784cdc4f95e 100644 (file)
@@ -493,10 +493,9 @@ out:
        return res;
 }
 
-static int squashfs_readahead_fragment(struct page **page,
+static int squashfs_readahead_fragment(struct inode *inode, struct page **page,
        unsigned int pages, unsigned int expected, loff_t start)
 {
-       struct inode *inode = page[0]->mapping->host;
        struct squashfs_cache_entry *buffer = squashfs_get_fragment(inode->i_sb,
                squashfs_i(inode)->fragment_block,
                squashfs_i(inode)->fragment_size);
@@ -605,8 +604,8 @@ static void squashfs_readahead(struct readahead_control *ractl)
 
                if (start >> msblk->block_log == file_end &&
                                squashfs_i(inode)->fragment_block != SQUASHFS_INVALID_BLK) {
-                       res = squashfs_readahead_fragment(pages, nr_pages,
-                                                         expected, start);
+                       res = squashfs_readahead_fragment(inode, pages,
+                                       nr_pages, expected, start);
                        if (res)
                                goto skip_pages;
                        continue;