From: "Fengnan" <changfengnan@bytedance.com>
To: "Pankaj Raghav (Samsung)" <pankaj.raghav@linux.dev>
Cc: <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>, <p.raghav@samsung.com>
Subject: Re: [PATCH v4] iomap: add simple read path for small direct I/O
Date: Thu, 11 Jun 2026 20:04:14 +0800 [thread overview]
Message-ID: <94fac0c6-13fe-4d5d-a794-04b43678a295@bytedance.com> (raw)
In-Reply-To: <mmbe4kdeqg6zlblhysi27qno22dtkaahv7bzslaqopsg4k3qs7@nofv525nnl6c>
在 2026/6/11 17:36, Pankaj Raghav (Samsung) 写道:
>> +static ssize_t iomap_dio_simple_read_complete(struct kiocb *iocb,
>> + struct bio *bio)
>> +{
>> + struct inode *inode = file_inode(iocb->ki_filp);
>> + ssize_t ret;
>> +
>> + WRITE_ONCE(iocb->private, NULL);
>> +
>> + ret = iomap_dio_simple_read_finish(iocb, bio,
>> + blk_status_to_errno(bio->bi_status));
>> +
>> + inode_dio_end(inode);
>> + trace_iomap_dio_complete(iocb, ret < 0 ? ret : 0, ret > 0 ? ret : 0);
> Shouldn't the second parameter here be
> blk_status_to_errno(bio->bi_status)?
>
> I think that will be more meaningful for tracing here.
> trace_iomap_dio_complete(iocb, blk_status_to_errno(bio->bi_status), ret);
Makes sense. I’ll update it in the next version.
>
> <snip>
>> + return ret;
>> +}
>> +
>> + sr->iocb = iocb;
>> + sr->dio_flags = dio_flags;
>> +
>> + bio->bi_iter.bi_sector = iomap_sector(&iomi.iomap, iomi.pos);
>> + bio->bi_ioprio = iocb->ki_ioprio;
>> + bio->bi_private = sr;
>> + bio->bi_end_io = iomap_dio_simple_read_end_io;
>> +
>> + if (dio_flags & IOMAP_DIO_BOUNCE)
>> + ret = bio_iov_iter_bounce(bio, iter, count);
>> + else
>> + ret = bio_iov_iter_get_pages(bio, iter, alignment - 1);
>> + if (unlikely(ret))
>> + goto out_bio_put;
>> +
>> + if (bio->bi_iter.bi_size != count) {
>> + iov_iter_revert(iter, bio->bi_iter.bi_size);
>> + ret = -ENOTBLK;
>> + goto out_bio_release_pages;
>> + }
>> +
>> + sr->size = bio->bi_iter.bi_size;
>> +
>> + if ((dio_flags & IOMAP_DIO_USER_BACKED) &&
>> + !(dio_flags & IOMAP_DIO_BOUNCE))
>> + bio_set_pages_dirty(bio);
>> +
>> + if (iocb->ki_flags & IOCB_NOWAIT)
>> + bio->bi_opf |= REQ_NOWAIT;
>> + if ((iocb->ki_flags & IOCB_HIPRI) && !wait_for_completion) {
>> + bio->bi_opf |= REQ_POLLED;
>> + bio_set_polled(bio, iocb);
> This results in build failure as the following patch removed this call:
> https://lore.kernel.org/linux-block/20260518062917.506483-1-hch@lst.de/
>
> I think this call can just be removed as you are setting REQ_POLLED
> anyway.
You’re right. I’ll update that in the next version too.
Thanks.
>
>> + WRITE_ONCE(iocb->private, bio);
>> + }
>> +
>> + if (wait_for_completion) {
>> + sr->waiter = current;
>> + blk_crypto_submit_bio(bio);
>> + } else {
>> + atomic_set(&sr->state, IOMAP_DIO_SIMPLE_SUBMITTING);
>> + sr->waiter = NULL;
>> + blk_crypto_submit_bio(bio);
>> + ret = -EIOCBQUEUED;
>> + }
>> +
> --
> Pankaj
next prev parent reply other threads:[~2026-06-11 12:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 7:31 Fengnan Chang
2026-06-11 9:36 ` Pankaj Raghav (Samsung)
2026-06-11 12:04 ` Fengnan [this message]
2026-06-24 15:37 ` Christoph Hellwig
2026-06-25 2:24 ` Fengnan
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=94fac0c6-13fe-4d5d-a794-04b43678a295@bytedance.com \
--to=changfengnan@bytedance.com \
--cc=brauner@kernel.org \
--cc=dgc@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--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=p.raghav@samsung.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
all inboxes | Powered by JetHome®