linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>
Cc: "Matthew Wilcox \(Oracle\)" <willy@infradead.org>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH 09/11] f2fs: Use a data folio in f2fs_submit_page_bio()
Date: Thu, 28 Nov 2024 04:58:24 +0000	[thread overview]
Message-ID: <20241128045828.527559-10-willy@infradead.org> (raw)
In-Reply-To: <20241128045828.527559-1-willy@infradead.org>

Remove a call to compound_head().  We can call bio_add_folio_nofail()
here because we just allocated the bio, so we know it can't fail and
thus the error path can never be taken.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/f2fs/data.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index cae5fa895b97..30d727808c92 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -685,32 +685,28 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
 {
 	struct bio *bio;
 	struct folio *fio_folio = page_folio(fio->page);
-	struct page *page = fio->encrypted_page ?
-			fio->encrypted_page : fio->page;
+	struct folio *data_folio = fio->encrypted_page ?
+			page_folio(fio->encrypted_page) : fio_folio;
 
 	if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr,
 			fio->is_por ? META_POR : (__is_meta_io(fio) ?
 			META_GENERIC : DATA_GENERIC_ENHANCE)))
 		return -EFSCORRUPTED;
 
-	trace_f2fs_submit_folio_bio(page_folio(page), fio);
+	trace_f2fs_submit_folio_bio(data_folio, fio);
 
 	/* Allocate a new bio */
 	bio = __bio_alloc(fio, 1);
 
 	f2fs_set_bio_crypt_ctx(bio, fio_folio->mapping->host,
 			fio_folio->index, fio, GFP_NOIO);
-
-	if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
-		bio_put(bio);
-		return -EFAULT;
-	}
+	bio_add_folio_nofail(bio, data_folio, folio_size(data_folio), 0);
 
 	if (fio->io_wbc && !is_read_io(fio->op))
 		wbc_account_cgroup_owner(fio->io_wbc, fio_folio, PAGE_SIZE);
 
 	inc_page_count(fio->sbi, is_read_io(fio->op) ?
-			__read_io_type(page) : WB_DATA_TYPE(fio->page, false));
+			__read_io_type(&data_folio->page) : WB_DATA_TYPE(fio->page, false));
 
 	if (is_read_io(bio_op(bio)))
 		f2fs_submit_read_bio(fio->sbi, bio, fio->type);
-- 
2.45.2



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

  parent reply	other threads:[~2024-11-28  5:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28  4:58 [f2fs-dev] [PATCH 00/11] f2fs folio patches Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 01/11] f2fs: Use a folio in f2fs_all_cluster_page_ready() Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 02/11] f2fs: Use a folio in f2fs_compress_write_end() Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 03/11] f2fs: Use a folio in f2fs_truncate_partial_cluster() Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 04/11] f2fs: Use a folio in f2fs_write_compressed_pages() Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 05/11] f2fs: Convert submit tracepoints to take a folio Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 06/11] f2fs: Add F2FS_F_SB() Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 07/11] f2fs: Convert f2fs_finish_read_bio() to use folios Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 08/11] f2fs: Use a folio more in f2fs_submit_page_bio() Matthew Wilcox (Oracle)
2024-11-28  4:58 ` Matthew Wilcox (Oracle) [this message]
2024-11-28  4:58 ` [f2fs-dev] [PATCH 10/11] f2fs: Convert __read_io_type() to take a folio Matthew Wilcox (Oracle)
2024-11-28  4:58 ` [f2fs-dev] [PATCH 11/11] f2fs: Remove calls to folio_file_mapping() Matthew Wilcox (Oracle)
2024-12-16 13:59 ` [f2fs-dev] [PATCH 00/11] f2fs folio patches Matthew Wilcox
2024-12-16 16:11   ` Jaegeuk Kim via Linux-f2fs-devel
2024-12-16 14:39 ` Chao Yu via Linux-f2fs-devel
2024-12-16 16:40 ` patchwork-bot+f2fs--- via Linux-f2fs-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241128045828.527559-10-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).