]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: Use a folio in f2fs_truncate_partial_cluster()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 Nov 2024 04:58:18 +0000 (04:58 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 16 Dec 2024 16:12:01 +0000 (16:12 +0000)
Convert the incoming page to a folio and use it throughout.
Removes an access to page->index.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/compress.c

index c91a2e4fe60c3726bb796154157361eb842b7b2e..494baa1e8bd3ddc633fb766bc06b3be728e7e4e6 100644 (file)
@@ -1242,13 +1242,14 @@ int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock)
                int i;
 
                for (i = cluster_size - 1; i >= 0; i--) {
-                       loff_t start = rpages[i]->index << PAGE_SHIFT;
+                       struct folio *folio = page_folio(rpages[i]);
+                       loff_t start = folio->index << PAGE_SHIFT;
 
                        if (from <= start) {
-                               zero_user_segment(rpages[i], 0, PAGE_SIZE);
+                               folio_zero_segment(folio, 0, folio_size(folio));
                        } else {
-                               zero_user_segment(rpages[i], from - start,
-                                                               PAGE_SIZE);
+                               folio_zero_segment(folio, from - start,
+                                               folio_size(folio));
                                break;
                        }
                }