public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: remove folio_detach_private() in .invalidate_folio and .release_folio
@ 2023-04-10  2:24 Chao Yu
  2023-04-10  2:24 ` [PATCH 2/2] f2fs: clean up with {attach,detach}_page_private() Chao Yu
  2023-04-10 18:33 ` [PATCH 1/2] f2fs: remove folio_detach_private() in .invalidate_folio and .release_folio Jaegeuk Kim
  0 siblings, 2 replies; 8+ messages in thread
From: Chao Yu @ 2023-04-10  2:24 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu

We have maintain PagePrivate and page_private and page reference
w/ {set,clear}_page_private_*, it doesn't need to call
folio_detach_private() in the end of .invalidate_folio and
.release_folio, remove it and use f2fs_bug_on instead.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/data.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 4946df6dd253..8b179b4bdc03 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3737,7 +3737,8 @@ void f2fs_invalidate_folio(struct folio *folio, size_t offset, size_t length)
 			inode->i_ino == F2FS_COMPRESS_INO(sbi))
 		clear_page_private_data(&folio->page);
 
-	folio_detach_private(folio);
+	f2fs_bug_on(sbi, PagePrivate(&folio->page));
+	f2fs_bug_on(sbi, page_private(&folio->page));
 }
 
 bool f2fs_release_folio(struct folio *folio, gfp_t wait)
@@ -3759,7 +3760,9 @@ bool f2fs_release_folio(struct folio *folio, gfp_t wait)
 	clear_page_private_reference(&folio->page);
 	clear_page_private_gcing(&folio->page);
 
-	folio_detach_private(folio);
+	f2fs_bug_on(sbi, PagePrivate(&folio->page));
+	f2fs_bug_on(sbi, page_private(&folio->page));
+
 	return true;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-12 16:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-10  2:24 [PATCH 1/2] f2fs: remove folio_detach_private() in .invalidate_folio and .release_folio Chao Yu
2023-04-10  2:24 ` [PATCH 2/2] f2fs: clean up with {attach,detach}_page_private() Chao Yu
2023-04-10 18:47   ` Jaegeuk Kim
2023-04-11  8:37     ` Chao Yu
2023-04-10 18:33 ` [PATCH 1/2] f2fs: remove folio_detach_private() in .invalidate_folio and .release_folio Jaegeuk Kim
2023-04-11  8:34   ` Chao Yu
2023-04-11 16:58     ` Jaegeuk Kim
2023-04-12 16:16       ` [f2fs-dev] " Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox