diff options
| author | Chao Yu <chao@kernel.org> | 2025-10-14 14:27:01 +0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2025-12-04 01:55:56 +0000 |
| commit | 28b68b2a3b2fae3789717ca9e306ae8f01269849 (patch) | |
| tree | 161db2c0c5c0f1de137bc58737e4314d66f5125e | |
| parent | 2308de27c03d8ed75b28dab2354eb02c5f8e69be (diff) | |
f2fs: clean up w/ bio_add_folio_nofail()
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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/data.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 16a713013427..d8a9f8f8cb5d 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 @@ alloc_new: 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; |
