squashfs: pass a folio to squashfs_readpage_fragment()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 20 Dec 2024 22:46:25 +0000 (22:46 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 25 Jan 2025 06:47:22 +0000 (22:47 -0800)
Remove an access to page->mapping.

Link: https://lkml.kernel.org/r/20241220224634.723899-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/squashfs/file.c

index bc6598c3a48fb1819253fef0c08b15194e1a8a1e..6bd16e12493b277035820126dc4fec9ede0f6d83 100644 (file)
@@ -417,9 +417,9 @@ skip_page:
 }
 
 /* Read datablock stored packed inside a fragment (tail-end packed block) */
-static int squashfs_readpage_fragment(struct page *page, int expected)
+static int squashfs_readpage_fragment(struct folio *folio, int expected)
 {
-       struct inode *inode = page->mapping->host;
+       struct inode *inode = folio->mapping->host;
        struct squashfs_cache_entry *buffer = squashfs_get_fragment(inode->i_sb,
                squashfs_i(inode)->fragment_block,
                squashfs_i(inode)->fragment_size);
@@ -430,7 +430,7 @@ static int squashfs_readpage_fragment(struct page *page, int expected)
                        squashfs_i(inode)->fragment_block,
                        squashfs_i(inode)->fragment_size);
        else
-               squashfs_copy_cache(page, buffer, expected,
+               squashfs_copy_cache(&folio->page, buffer, expected,
                        squashfs_i(inode)->fragment_offset);
 
        squashfs_cache_put(buffer);
@@ -474,7 +474,7 @@ static int squashfs_read_folio(struct file *file, struct folio *folio)
                else
                        res = squashfs_readpage_block(&folio->page, block, res, expected);
        } else
-               res = squashfs_readpage_fragment(&folio->page, expected);
+               res = squashfs_readpage_fragment(folio, expected);
 
        if (!res)
                return 0;