Re: [PATCH 7/7] block, directio: set a REQ_POLL flag when submitting polled bios

Started by Jeff Moyer on Feb 26, 2016 · 2 messages from 2 authors · Last reply Feb 27, 2016

open the first message on its own page

Message details and related content
Hi, Christoph,

REQ_POLL is set but never checked.  Is part of the patch missing, or was
that intentional?

-Jeff

Christoph Hellwig [off-list ref] writes:
quoted hunk
Signed-off-by: Christoph Hellwig <redacted>
---
 block/blk-core.c          | 9 +++++++--
 fs/direct-io.c            | 4 ++++
 include/linux/blk_types.h | 2 ++
 include/linux/blkdev.h    | 1 +
 4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index b83d297..81b4b8b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -3335,13 +3335,18 @@ void blk_finish_plug(struct blk_plug *plug)
 }
 EXPORT_SYMBOL(blk_finish_plug);
 
+inline bool blk_queue_can_poll(struct request_queue *q)
+{
+	return q->mq_ops && q->mq_ops->poll &&
+		test_bit(QUEUE_FLAG_POLL, &q->queue_flags);
+}
+
 bool blk_poll(struct request_queue *q, blk_qc_t cookie)
 {
 	struct blk_plug *plug;
 	long state;
 
-	if (!q->mq_ops || !q->mq_ops->poll || !blk_qc_t_valid(cookie) ||
-	    !test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+	if (!blk_queue_can_poll(q) || !blk_qc_t_valid(cookie))
 		return false;
 
 	plug = current->plug;
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 0a8d937..ba5ba7e 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1197,6 +1197,10 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 	dio->inode = inode;
 	dio->rw = iov_iter_rw(iter) == WRITE ? WRITE_ODIRECT : READ;

40 more quoted lines

Message details and related content
On Fri, Feb 26, 2016 at 04:10:51PM -0500, Jeff Moyer wrote:
Hi, Christoph,

REQ_POLL is set but never checked.  Is part of the patch missing, or was
that intentional?
Jens insisted that I add it, even if there aren't users.  I disagree,
but in the end he'll have to apply the series..
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help