Skip to content

Commit 1cda5bc

Browse files
Matthew Wilcox (Oracle)Jaegeuk Kim
authored andcommitted
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) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent ff6c82a commit 1cda5bc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/f2fs/compress.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,13 +1242,14 @@ int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock)
12421242
int i;
12431243

12441244
for (i = cluster_size - 1; i >= 0; i--) {
1245-
loff_t start = rpages[i]->index << PAGE_SHIFT;
1245+
struct folio *folio = page_folio(rpages[i]);
1246+
loff_t start = folio->index << PAGE_SHIFT;
12461247

12471248
if (from <= start) {
1248-
zero_user_segment(rpages[i], 0, PAGE_SIZE);
1249+
folio_zero_segment(folio, 0, folio_size(folio));
12491250
} else {
1250-
zero_user_segment(rpages[i], from - start,
1251-
PAGE_SIZE);
1251+
folio_zero_segment(folio, from - start,
1252+
folio_size(folio));
12521253
break;
12531254
}
12541255
}

0 commit comments

Comments
 (0)