Skip to content

Commit e7606f4

Browse files
marktinguelyakpm00
authored andcommitted
ocfs2: support large folios in ocfs2_write_zero_page()
Remove assumptions that a folio is PAGE_SIZE. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Mark Tinguely <[email protected]> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Joel Becker <[email protected]> Cc: Jun Piao <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Mark Fasheh <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2ebe9ef commit e7606f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/ocfs2/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,11 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
782782
goto out_commit_trans;
783783
}
784784

785-
/* Get the offsets within the page that we want to zero */
786-
zero_from = abs_from & (PAGE_SIZE - 1);
787-
zero_to = abs_to & (PAGE_SIZE - 1);
785+
/* Get the offsets within the folio that we want to zero */
786+
zero_from = offset_in_folio(folio, abs_from);
787+
zero_to = offset_in_folio(folio, abs_to);
788788
if (!zero_to)
789-
zero_to = PAGE_SIZE;
789+
zero_to = folio_size(folio);
790790

791791
trace_ocfs2_write_zero_page(
792792
(unsigned long long)OCFS2_I(inode)->ip_blkno,

0 commit comments

Comments
 (0)