]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntfs3: Remove an access to page->index
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 Nov 2024 19:44:28 +0000 (19:44 +0000)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 18 Dec 2024 13:42:01 +0000 (16:42 +0300)
Convert the first page passed to ni_write_frame() to a folio and use
folio_pos() on that instead of open-coding the access to folio->index,
cast & shift.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/frecord.c

index 8b39d0ce5f2890df881d313099aac73d0c21f26b..c57f0686b14b3392f68f4882171968a169b54f3e 100644 (file)
@@ -2726,9 +2726,10 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
 {
        int err;
        struct ntfs_sb_info *sbi = ni->mi.sbi;
+       struct folio *folio = page_folio(pages[0]);
        u8 frame_bits = NTFS_LZNT_CUNIT + sbi->cluster_bits;
        u32 frame_size = sbi->cluster_size << NTFS_LZNT_CUNIT;
-       u64 frame_vbo = (u64)pages[0]->index << PAGE_SHIFT;
+       u64 frame_vbo = folio_pos(folio);
        CLST frame = frame_vbo >> frame_bits;
        char *frame_ondisk = NULL;
        struct page **pages_disk = NULL;