summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/compress.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-03-31 21:12:40 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2025-04-28 15:26:46 +0000
commit842974808ac2aa4fd22b6207146329d08fbf7141 (patch)
tree43dc12c61ee5b5e100b6b03660867c0194fe6cb3 /fs/f2fs/compress.c
parentf2fs: Use a folio in prepare_compress_overwrite() (diff)
downloadlinux-842974808ac2aa4fd22b6207146329d08fbf7141.tar.gz
linux-842974808ac2aa4fd22b6207146329d08fbf7141.zip
f2fs: Convert f2fs_load_compressed_page() to f2fs_load_compressed_folio()
The only caller already has a folio, so pass it in. Copy the entire size of the folio to support large block sizes. Remove two calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/compress.c')
-rw-r--r--fs/f2fs/compress.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 2f9c35d0abda..9da80914304f 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -1964,25 +1964,25 @@ void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi, struct page *page,
f2fs_folio_put(cfolio, true);
}
-bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi, struct page *page,
+bool f2fs_load_compressed_folio(struct f2fs_sb_info *sbi, struct folio *folio,
block_t blkaddr)
{
- struct page *cpage;
+ struct folio *cfolio;
bool hitted = false;
if (!test_opt(sbi, COMPRESS_CACHE))
return false;
- cpage = f2fs_pagecache_get_page(COMPRESS_MAPPING(sbi),
+ cfolio = f2fs_filemap_get_folio(COMPRESS_MAPPING(sbi),
blkaddr, FGP_LOCK | FGP_NOWAIT, GFP_NOFS);
- if (cpage) {
- if (PageUptodate(cpage)) {
+ if (!IS_ERR(cfolio)) {
+ if (folio_test_uptodate(cfolio)) {
atomic_inc(&sbi->compress_page_hit);
- memcpy(page_address(page),
- page_address(cpage), PAGE_SIZE);
+ memcpy(folio_address(folio),
+ folio_address(cfolio), folio_size(folio));
hitted = true;
}
- f2fs_put_page(cpage, 1);
+ f2fs_folio_put(cfolio, true);
}
return hitted;