All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: James Bottomley <jbottomley@parallels.com>,
	Christoph Hellwig <hch@infradead.org>
Cc: Hannes Reinecke <hare@suse.de>, Jens Axboe <axboe@kernel.dk>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Joe Lawrence <jdl1291@gmail.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: [PATCH 2/3] block: Introduce blk_rq_completed()
Date: Mon, 26 May 2014 17:15:03 +0200	[thread overview]
Message-ID: <53835A77.1090708@acm.org> (raw)
In-Reply-To: <53835A52.9010306@acm.org>

Make it possible to test the REQ_ATOM_COMPLETE bit from outside the
block layer core.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@fb.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Joe Lawrence <joe.lawrence@stratus.com>
---
 block/blk-softirq.c    | 13 +++++++++++++
 include/linux/blkdev.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/block/blk-softirq.c b/block/blk-softirq.c
index 53b1737..fc7d160 100644
--- a/block/blk-softirq.c
+++ b/block/blk-softirq.c
@@ -172,6 +172,19 @@ void blk_complete_request(struct request *req)
 }
 EXPORT_SYMBOL(blk_complete_request);
 
+/**
+ * blk_rq_completed - whether or not a request has been completed
+ *
+ * Intended for debugging purposes only. Any completion handler code should go
+ * into the softirq_done_fn() and/or in the rq_timed_out_fn() request_queue
+ * callback functions.
+ */
+bool blk_rq_completed(struct request *rq)
+{
+	return test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);
+}
+EXPORT_SYMBOL(blk_rq_completed);
+
 static __init int blk_softirq_init(void)
 {
 	int i;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0d84981..a621bc5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -952,6 +952,7 @@ extern void blk_complete_request(struct request *);
 extern void __blk_complete_request(struct request *);
 extern void blk_abort_request(struct request *);
 extern void blk_unprep_request(struct request *);
+extern bool blk_rq_completed(struct request *);
 
 /*
  * Access functions for manipulating queue properties
-- 
1.8.4.5


  reply	other threads:[~2014-05-26 15:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 15:12 Make SCSI error handler code easier to understand Bart Van Assche
2014-05-26 15:14 ` [PATCH 1/3] Remove two cancel_delayed_work() calls from the error handler Bart Van Assche
2014-05-26 15:15   ` Bart Van Assche [this message]
2014-05-26 15:27     ` [PATCH 2/3] block: Introduce blk_rq_completed() James Bottomley
2014-05-27  7:49       ` Bart Van Assche
2014-05-27  7:52         ` hch
2014-05-27  8:00           ` James Bottomley
2014-05-27  8:23         ` James Bottomley
2014-05-27  9:00           ` Bart Van Assche
2014-05-27 10:21             ` James Bottomley
2014-05-27 10:47               ` Paolo Bonzini
2014-05-27 10:59                 ` James Bottomley
2014-05-27 11:13                   ` Paolo Bonzini
2014-05-27 11:26                     ` James Bottomley
2014-05-27 11:52                       ` Paolo Bonzini
2014-05-27 11:57                         ` James Bottomley
2014-05-27  5:40     ` Hannes Reinecke
2014-05-26 15:23   ` [PATCH 1/3] Remove two cancel_delayed_work() calls from the error handler Paolo Bonzini
2014-05-26 15:25     ` James Bottomley
2014-05-27  8:06     ` Bart Van Assche
2014-05-27  8:09       ` James Bottomley
2014-05-27  8:36         ` Bart Van Assche
2014-05-27  8:56           ` James Bottomley
2014-05-27  9:06             ` Paolo Bonzini
2014-05-27  5:40   ` Hannes Reinecke
2014-05-27  6:08     ` Bart Van Assche
2014-05-27  6:22       ` Hannes Reinecke
2014-05-26 15:15 ` [PATCH 3/3] Make SCSI error handler code easier to understand Bart Van Assche
2014-05-27  5:42   ` Hannes Reinecke
2014-05-28 20:15 ` Joe Lawrence
2014-05-29 11:33   ` James Bottomley

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=53835A77.1090708@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=jdl1291@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.