diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-11-28 04:58:18 +0000 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-12-16 16:12:01 +0000 |
commit | 1cda5bc0b2fe93cdcb5f05a02f814a282d32742c (patch) | |
tree | edf58f17f226ef0569e54f66e50e2fe3e4c236be /fs/f2fs/compress.c | |
parent | ff6c82a934f7b5df8702579d921209c5ca336102 (diff) |
f2fs: Use a folio in f2fs_truncate_partial_cluster()
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>
Diffstat (limited to 'fs/f2fs/compress.c')
-rw-r--r-- | fs/f2fs/compress.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index c91a2e4fe60c..494baa1e8bd3 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -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; } } |