f2fs: fix to call clear_page_private_reference in .{release,invalid}_folio
authorChao Yu <chao@kernel.org>
Wed, 21 Dec 2022 12:13:45 +0000 (20:13 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 4 Jan 2023 20:56:04 +0000 (12:56 -0800)
b763f3bedc2d ("f2fs: restructure f2fs page.private layout") missed
to call clear_page_private_reference() in .{release,invalid}_folio,
fix it, though it's not a big deal since folio_detach_private() was
called to clear all privae info and reference count in the page.

BTW, remove page_private_reference() definition as it never be used.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h

index 97e816590cd95ad7f4fa93a41abe6c51bb6f9a16..017c9746a705b761156d824f677a2edf191e8a43 100644 (file)
@@ -3698,6 +3698,7 @@ void f2fs_invalidate_folio(struct folio *folio, size_t offset, size_t length)
                }
        }
 
+       clear_page_private_reference(&folio->page);
        clear_page_private_gcing(&folio->page);
 
        if (test_opt(sbi, COMPRESS_CACHE) &&
@@ -3723,6 +3724,7 @@ bool f2fs_release_folio(struct folio *folio, gfp_t wait)
                        clear_page_private_data(&folio->page);
        }
 
+       clear_page_private_reference(&folio->page);
        clear_page_private_gcing(&folio->page);
 
        folio_detach_private(folio);
index 9c7df2f1df73d79c25d5d4dce2ed8ed5aa47b7de..5fdefb82509d41617a3285656bf1d9985d2861f8 100644 (file)
@@ -1448,7 +1448,6 @@ static inline void clear_page_private_##name(struct page *page) \
 }
 
 PAGE_PRIVATE_GET_FUNC(nonpointer, NOT_POINTER);
-PAGE_PRIVATE_GET_FUNC(reference, REF_RESOURCE);
 PAGE_PRIVATE_GET_FUNC(inline, INLINE_INODE);
 PAGE_PRIVATE_GET_FUNC(gcing, ONGOING_MIGRATION);
 PAGE_PRIVATE_GET_FUNC(dummy, DUMMY_WRITE);