summaryrefslogtreecommitdiff
path: root/fs/squashfs/file_direct.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-12-20 22:46:26 +0000
committerAndrew Morton <akpm@linux-foundation.org>2025-01-24 22:47:22 -0800
commit2a7aea59cf4dd4a070c4550fddaffc5a73312cad (patch)
tree9ad0bb5fcdddc9e38ae06ae6bebd8f1793dbd59c /fs/squashfs/file_direct.c
parent8c1565fcf6392d2f962b7cbc9fde43bfcd175c2f (diff)
squashfs: convert squashfs_readpage_block() to take a folio
Remove a few accesses to page->mapping. Link: https://lkml.kernel.org/r/20241220224634.723899-3-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>
Diffstat (limited to 'fs/squashfs/file_direct.c')
-rw-r--r--fs/squashfs/file_direct.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c
index d19d4db74af8..2c3e809d6891 100644
--- a/fs/squashfs/file_direct.c
+++ b/fs/squashfs/file_direct.c
@@ -19,12 +19,11 @@
#include "page_actor.h"
/* Read separately compressed datablock directly into page cache */
-int squashfs_readpage_block(struct page *target_page, u64 block, int bsize,
- int expected)
-
+int squashfs_readpage_block(struct folio *folio, u64 block, int bsize,
+ int expected)
{
- struct folio *folio = page_folio(target_page);
- struct inode *inode = target_page->mapping->host;
+ struct page *target_page = &folio->page;
+ struct inode *inode = folio->mapping->host;
struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
loff_t file_end = (i_size_read(inode) - 1) >> PAGE_SHIFT;
int mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1;
@@ -48,7 +47,7 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize,
/* Try to grab all the pages covered by the Squashfs block */
for (i = 0, index = start_index; index <= end_index; index++) {
page[i] = (index == folio->index) ? target_page :
- grab_cache_page_nowait(target_page->mapping, index);
+ grab_cache_page_nowait(folio->mapping, index);
if (page[i] == NULL)
continue;