Skip to content

Commit e438454

Browse files
pedrodemargomesJaegeuk Kim
authored andcommitted
f2fs: use folio_nr_pages() instead of shift operation
folio_nr_pages() is a faster helper function to get the number of pages when NR_PAGES_IN_LARGE_FOLIO is enabled. Signed-off-by: Pedro Demarchi Gomes <pedrodemargomes@gmail.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 81464df commit e438454

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/f2fs/f2fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi)
20962096
static inline struct f2fs_super_block *F2FS_SUPER_BLOCK(struct folio *folio,
20972097
pgoff_t index)
20982098
{
2099-
pgoff_t idx_in_folio = index % (1 << folio_order(folio));
2099+
pgoff_t idx_in_folio = index % folio_nr_pages(folio);
21002100

21012101
return (struct f2fs_super_block *)
21022102
(page_address(folio_page(folio, idx_in_folio)) +

0 commit comments

Comments
 (0)