mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
block: Add interface to abort queued requests
Signed-off-by: Mike Anderson <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
242f9dcb8b
commit
11914a53d2
5 changed files with 39 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue