summaryrefslogtreecommitdiffstats
path: root/block/blk-timeout.c
diff options
context:
space:
mode:
authorMike Anderson <andmike@linux.vnet.ibm.com>2008-09-13 20:31:27 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 08:56:13 +0200
commit11914a53d2ec2974a565311af327b8983d8c820d (patch)
tree72713d2661ed56fa5d9e29203541bad32c88a3ba /block/blk-timeout.c
parent242f9dcb8ba6f68fcd217a119a7648a4f69290e9 (diff)
downloadblackbird-op-linux-11914a53d2ec2974a565311af327b8983d8c820d.tar.gz
blackbird-op-linux-11914a53d2ec2974a565311af327b8983d8c820d.zip
block: Add interface to abort queued requests
Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-timeout.c')
-rw-r--r--block/blk-timeout.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index b36d07bf0afb..6e5c781c5af1 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -153,3 +153,25 @@ void blk_add_timer(struct request *req)
time_before(expiry, q->timeout.expires))
mod_timer(&q->timeout, expiry);
}
+
+/**
+ * blk_abort_queue -- Abort all request on given queue
+ * @queue: pointer to queue
+ *
+ */
+void blk_abort_queue(struct request_queue *q)
+{
+ unsigned long flags;
+ struct request *rq, *tmp;
+
+ spin_lock_irqsave(q->queue_lock, flags);
+
+ elv_abort_queue(q);
+
+ list_for_each_entry_safe(rq, tmp, &q->timeout_list, timeout_list)
+ blk_abort_request(rq);
+
+ spin_unlock_irqrestore(q->queue_lock, flags);
+
+}
+EXPORT_SYMBOL_GPL(blk_abort_queue);
OpenPOWER on IntegriCloud