linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/4] f2fs: clean up w/ bio_add_folio_nofail()
@ 2025-10-14  6:27 Chao Yu via Linux-f2fs-devel
  2025-10-14  6:27 ` [f2fs-dev] [PATCH 2/4] f2fs: convert add_ipu_page() to use folio Chao Yu via Linux-f2fs-devel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-10-14  6:27 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

In add_bio_entry(), adding a page to newly allocated bio should never fail,
let's use bio_add_folio_nofail() instead of bio_add_page() & unnecessary
error handling for cleanup.

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

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 775aa4f63aa3..50538c26c1a1 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -752,7 +752,7 @@ static bool io_is_mergeable(struct f2fs_sb_info *sbi, struct bio *bio,
 }
 
 static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio,
-				struct page *page, enum temp_type temp)
+				struct folio *folio, enum temp_type temp)
 {
 	struct f2fs_bio_info *io = sbi->write_io[DATA] + temp;
 	struct bio_entry *be;
@@ -761,8 +761,7 @@ static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio,
 	be->bio = bio;
 	bio_get(bio);
 
-	if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE)
-		f2fs_bug_on(sbi, 1);
+	bio_add_folio_nofail(bio, folio, folio_size(folio), 0);
 
 	f2fs_down_write(&io->bio_list_lock);
 	list_add_tail(&be->list, &io->bio_list);
@@ -904,7 +903,7 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio)
 		f2fs_set_bio_crypt_ctx(bio, folio->mapping->host,
 				folio->index, fio, GFP_NOIO);
 
-		add_bio_entry(fio->sbi, bio, &data_folio->page, fio->temp);
+		add_bio_entry(fio->sbi, bio, data_folio, fio->temp);
 	} else {
 		if (add_ipu_page(fio, &bio, &data_folio->page))
 			goto alloc_new;
-- 
2.49.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2025-10-14  7:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14  6:27 [f2fs-dev] [PATCH 1/4] f2fs: clean up w/ bio_add_folio_nofail() Chao Yu via Linux-f2fs-devel
2025-10-14  6:27 ` [f2fs-dev] [PATCH 2/4] f2fs: convert add_ipu_page() to use folio Chao Yu via Linux-f2fs-devel
2025-10-14  6:27 ` [f2fs-dev] [PATCH 3/4] f2fs: use f2fs_filemap_get_folio() instead of f2fs_pagecache_get_page() Chao Yu via Linux-f2fs-devel
2025-10-14  6:27 ` [f2fs-dev] [PATCH 4/4] f2fs: use f2fs_filemap_get_folio() to support fault injection Chao Yu via Linux-f2fs-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).