summaryrefslogtreecommitdiffstats
path: root/block/elevator.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/elevator.c
parentblock: unify request timeout handling (diff)
downloadlinux-11914a53d2ec2974a565311af327b8983d8c820d.tar.xz
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/elevator.c')
-rw-r--r--block/elevator.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/block/elevator.c b/block/elevator.c
index a91fc59edd01..8a74eedc3530 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -914,6 +914,19 @@ int elv_may_queue(struct request_queue *q, int rw)
return ELV_MQUEUE_MAY;
}
+void elv_abort_queue(struct request_queue *q)
+{
+ struct request *rq;
+
+ while (!list_empty(&q->queue_head)) {
+ rq = list_entry_rq(q->queue_head.next);
+ rq->cmd_flags |= REQ_QUIET;
+ blk_add_trace_rq(q, rq, BLK_TA_ABORT);
+ end_queued_request(rq, 0);
+ }
+}
+EXPORT_SYMBOL(elv_abort_queue);
+
void elv_completed_request(struct request_queue *q, struct request *rq)
{
elevator_t *e = q->elevator;