]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iomap: pass error code to should_report_dio_fserror directly
authorFengnan Chang <changfengnan@bytedance.com>
Wed, 1 Jul 2026 03:32:52 +0000 (11:32 +0800)
committerChristian Brauner <brauner@kernel.org>
Fri, 31 Jul 2026 10:28:45 +0000 (12:28 +0200)
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>
Link: https://patch.msgid.link/20260701033253.46420-3-changfengnan@bytedance.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/iomap/direct-io.c

index 487c4763f3fde1b0ebbdd1b0bc1f060b5a620f0a..1b9abdd831d0bda83e61cee93961eca1ada21a49 100644 (file)
@@ -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);