mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
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>
This commit is contained in:
parent
ff6c82a934
commit
1cda5bc0b2
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user