Linux EXT4 FS development
 help / color / mirror / Atom feed
From: "Fengnan Chang" <changfengnan@bytedance.com>
To: <brauner@kernel.org>, <djwong@kernel.org>, <hch@infradead.org>,
	 <ojaswin@linux.ibm.com>, <dgc@kernel.org>,
	<linux-xfs@vger.kernel.org>,  <linux-fsdevel@vger.kernel.org>,
	<linux-ext4@vger.kernel.org>,  <linux-kernel@vger.kernel.org>,
	<lidiangang@bytedance.com>,  <pankaj.raghav@linux.dev>
Cc: "Fengnan Chang" <changfengnan@bytedance.com>,
	 "Christoph Hellwig" <hch@lst.de>
Subject: [PATCH v6 2/3] iomap: pass error code to should_report_dio_fserror directly
Date: Wed,  1 Jul 2026 11:32:52 +0800	[thread overview]
Message-ID: <20260701033253.46420-3-changfengnan@bytedance.com> (raw)
In-Reply-To: <20260701033253.46420-1-changfengnan@bytedance.com>

Change should_report_dio_fserror() to take an error code instead of the
full struct iomap_dio, decoupling it for reuse by the upcoming simple
direct I/O path.

No functional change.

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/iomap/direct-io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 487c4763f3fde..1b9abdd831d0b 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -88,9 +88,9 @@ static inline enum fserror_type iomap_dio_err_type(const struct iomap_dio *dio)
 	return FSERR_DIRECTIO_READ;
 }
 
-static inline bool should_report_dio_fserror(const struct iomap_dio *dio)
+static inline bool should_report_dio_fserror(int error)
 {
-	switch (dio->error) {
+	switch (error) {
 	case 0:
 	case -EAGAIN:
 	case -ENOTBLK:
@@ -110,7 +110,7 @@ ssize_t iomap_dio_complete(struct iomap_dio *dio)
 
 	if (dops && dops->end_io)
 		ret = dops->end_io(iocb, dio->size, ret, dio->flags);
-	if (should_report_dio_fserror(dio))
+	if (should_report_dio_fserror(dio->error))
 		fserror_report_io(file_inode(iocb->ki_filp),
 				  iomap_dio_err_type(dio), offset, dio->size,
 				  dio->error, GFP_NOFS);
-- 
2.39.5 (Apple Git-154)

  parent reply	other threads:[~2026-07-01  3:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01  3:32 [PATCH v6 0/3] iomap: add simple dio path for small direct I/O Fengnan Chang
2026-07-01  3:32 ` [PATCH v6 1/3] iomap: factor out iomap_dio_alignment helper Fengnan Chang
2026-07-01  3:32 ` Fengnan Chang [this message]
2026-07-01  3:32 ` [PATCH v6 3/3] iomap: add simple dio path for small direct I/O Fengnan Chang
2026-07-01 11:23   ` Christoph Hellwig
2026-07-01 19:35     ` Joanne Koong
2026-07-02 14:35       ` Christoph Hellwig
2026-07-03  3:05         ` Joanne Koong
2026-07-03  9:13           ` changfengnan
2026-07-03 12:40             ` Christoph Hellwig
2026-07-06 11:09               ` changfengnan
2026-07-06 19:27                 ` Joanne Koong
2026-07-03  9:22           ` changfengnan
2026-07-01 12:44 ` [PATCH v6 0/3] " Christian Brauner

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=20260701033253.46420-3-changfengnan@bytedance.com \
    --to=changfengnan@bytedance.com \
    --cc=brauner@kernel.org \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=lidiangang@bytedance.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=pankaj.raghav@linux.dev \
    /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