diff options
author | Mike Anderson <andmike@linux.vnet.ibm.com> | 2008-09-13 14:31:27 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:13 -0400 |
commit | 11914a53d2ec2974a565311af327b8983d8c820d (patch) | |
tree | 72713d2661ed56fa5d9e29203541bad32c88a3ba /block/elevator.c | |
parent | 242f9dcb8ba6f68fcd217a119a7648a4f69290e9 (diff) |
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.c | 13 |
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) | |||
914 | return ELV_MQUEUE_MAY; | 914 | return ELV_MQUEUE_MAY; |
915 | } | 915 | } |
916 | 916 | ||
917 | void elv_abort_queue(struct request_queue *q) | ||
918 | { | ||
919 | struct request *rq; | ||
920 | |||
921 | while (!list_empty(&q->queue_head)) { | ||
922 | rq = list_entry_rq(q->queue_head.next); | ||
923 | rq->cmd_flags |= REQ_QUIET; | ||
924 | blk_add_trace_rq(q, rq, BLK_TA_ABORT); | ||
925 | end_queued_request(rq, 0); | ||
926 | } | ||
927 | } | ||
928 | EXPORT_SYMBOL(elv_abort_queue); | ||
929 | |||
917 | void elv_completed_request(struct request_queue *q, struct request *rq) | 930 | void elv_completed_request(struct request_queue *q, struct request *rq) |
918 | { | 931 | { |
919 | elevator_t *e = q->elevator; | 932 | elevator_t *e = q->elevator; |