]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
f2fs: use folio_nr_pages() instead of shift operation
authorPedro Demarchi Gomes <pedrodemargomes@gmail.com>
Sat, 4 Oct 2025 03:12:17 +0000 (00:12 -0300)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 24 Oct 2025 21:23:55 +0000 (21:23 +0000)
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>
fs/f2fs/f2fs.h

index 5b4e9548a231f31abd4e89bd4be8133849e1c222..b6e35fdd5fd3d42c1d2c6c6eab6744c5ea788858 100644 (file)
@@ -2096,7 +2096,7 @@ static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi)
 static inline struct f2fs_super_block *F2FS_SUPER_BLOCK(struct folio *folio,
                                                                pgoff_t index)
 {
-       pgoff_t idx_in_folio = index % (1 << folio_order(folio));
+       pgoff_t idx_in_folio = index % folio_nr_pages(folio);
 
        return (struct f2fs_super_block *)
                (page_address(folio_page(folio, idx_in_folio)) +