From b12d4f82c1a3cdcb2441c803a3368a9426f2f47f Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Fri, 8 May 2009 11:54:06 +0900 Subject: paride: dequeue in-flight request pd/pf/pcd have track in-flight request by pd/pf/pcd_req. They can be converted to dequeueing model by updating fetching and completion paths. Convert them. Note that removal of elv_next_request() call from pf_next_buf() doesn't make any functional difference. The path is traveled only during partial completion of a request and elv_next_request() call must return the same request anyway. [ Impact: dequeue in-flight request ] Signed-off-by: Tejun Heo Cc: Tim Waugh Signed-off-by: Jens Axboe --- drivers/block/paride/pf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/block/paride/pf.c') diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index e88c889aa7f2..d6f7bd84ed39 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -752,10 +752,8 @@ static struct request_queue *pf_queue; static void pf_end_request(int err) { - if (pf_req) { - __blk_end_request_cur(pf_req, err); + if (pf_req && !__blk_end_request_cur(pf_req, err)) pf_req = NULL; - } } static void do_pf_request(struct request_queue * q) @@ -763,9 +761,12 @@ static void do_pf_request(struct request_queue * q) if (pf_busy) return; repeat: - pf_req = elv_next_request(q); - if (!pf_req) - return; + if (!pf_req) { + pf_req = elv_next_request(q); + if (!pf_req) + return; + blkdev_dequeue_request(pf_req); + } pf_current = pf_req->rq_disk->private_data; pf_block = blk_rq_pos(pf_req); @@ -806,7 +807,6 @@ static int pf_next_buf(void) if (!pf_count) { spin_lock_irqsave(&pf_spin_lock, saved_flags); pf_end_request(0); - pf_req = elv_next_request(pf_queue); spin_unlock_irqrestore(&pf_spin_lock, saved_flags); if (!pf_req) return 1; -- cgit v1.2.3