Message ID | 20181221192236.12866-5-axboe@kernel.dk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/22] fs: add an iopoll method to struct file_operations | expand |
On 12/21/18 12:22 PM, Jens Axboe wrote: > Tell the block layer if it's a sync or async polled request, so it can > do the right thing. Forgot to drop this one, please disregard it as it's super ceded by the next patch anyway...
On Fri, Dec 21, 2018 at 12:25:07PM -0700, Jens Axboe wrote: > On 12/21/18 12:22 PM, Jens Axboe wrote: > > Tell the block layer if it's a sync or async polled request, so it can > > do the right thing. > > Forgot to drop this one, please disregard it as it's super ceded by the > next patch anyway... FYI, I'd just add the users in the patch introducing bio_set_polled.
On 12/27/18 6:15 AM, Christoph Hellwig wrote: > On Fri, Dec 21, 2018 at 12:25:07PM -0700, Jens Axboe wrote: >> On 12/21/18 12:22 PM, Jens Axboe wrote: >>> Tell the block layer if it's a sync or async polled request, so it can >>> do the right thing. >> >> Forgot to drop this one, please disregard it as it's super ceded by the >> next patch anyway... > > FYI, I'd just add the users in the patch introducing bio_set_polled. Folded.
diff --git a/fs/block_dev.c b/fs/block_dev.c index 6de8d35f6e41..b8f574615792 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -402,8 +402,12 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES); if (!nr_pages) { - if (iocb->ki_flags & IOCB_HIPRI) - bio->bi_opf |= REQ_HIPRI; + if (iocb->ki_flags & IOCB_HIPRI) { + if (!is_sync) + bio->bi_opf |= REQ_HIPRI_ASYNC; + else + bio->bi_opf |= REQ_HIPRI; + } qc = submit_bio(bio); WRITE_ONCE(iocb->ki_cookie, qc);
Tell the block layer if it's a sync or async polled request, so it can do the right thing. Signed-off-by: Jens Axboe <axboe@kernel.dk> --- fs/block_dev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)