aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-timeout.c
diff options
context:
space:
mode:
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 b36d07bf0af..6e5c781c5af 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -153,3 +153,25 @@ void blk_add_timer(struct request *req)
153 time_before(expiry, q->timeout.expires)) 153 time_before(expiry, q->timeout.expires))
154 mod_timer(&q->timeout, expiry); 154 mod_timer(&q->timeout, expiry);
155} 155}
156
157/**
158 * blk_abort_queue -- Abort all request on given queue
159 * @queue: pointer to queue
160 *
161 */
162void blk_abort_queue(struct request_queue *q)
163{
164 unsigned long flags;
165 struct request *rq, *tmp;
166
167 spin_lock_irqsave(q->queue_lock, flags);
168
169 elv_abort_queue(q);
170
171 list_for_each_entry_safe(rq, tmp, &q->timeout_list, timeout_list)
172 blk_abort_request(rq);
173
174 spin_unlock_irqrestore(q->queue_lock, flags);
175
176}
177EXPORT_SYMBOL_GPL(blk_abort_queue);