From a0cd128542cd9c67f27458a08e989db486a293ce Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 21 Sep 2007 10:41:07 +0200 Subject: block: add end_queued_request() and end_dequeued_request() helpers We can use this helper in the elevator core for BLKPREP_KILL, and it'll also be useful for the empty barrier patch. Signed-off-by: Jens Axboe --- block/elevator.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'block/elevator.c') diff --git a/block/elevator.c b/block/elevator.c index b9c518afe1f8..ec23ca02f2fe 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -751,15 +751,8 @@ struct request *elv_next_request(struct request_queue *q) rq = NULL; break; } else if (ret == BLKPREP_KILL) { - int nr_bytes = rq->hard_nr_sectors << 9; - - if (!nr_bytes) - nr_bytes = rq->data_len; - - blkdev_dequeue_request(rq); rq->cmd_flags |= REQ_QUIET; - end_that_request_chunk(rq, 0, nr_bytes); - end_that_request_last(rq, 0); + end_queued_request(rq, 0); } else { printk(KERN_ERR "%s: bad return=%d\n", __FUNCTION__, ret); -- cgit v1.2.3-59-g8ed1b