[PATCH 4/9] blk: Call unprep_fn from elv_abort_queue is available

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mike Anderson
Date: Monday, May 3, 2010 - 8:37 pm

Call the unprep_fn for the queue if it has been set for requests that have
been prepped indicated by REQ_DONTPREP being set.

Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Cc: Jens Axobe <jens.axboe@oracle.com>
---
 block/elevator.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index ac98008..1f1e942 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -817,8 +817,12 @@ void elv_abort_queue(struct request_queue *q)
 	list_splice_init(&q->queue_head, &list);
 
 	list_for_each_entry_safe(rq, tmp, &list, queuelist) {
-		if (rq->cmd_flags & REQ_DONTPREP)
-			continue;
+		if (rq->cmd_flags & REQ_DONTPREP) {
+			if (q->unprep_rq_fn)
+				q->unprep_rq_fn(q, rq);
+			else
+				continue;
+		}
 		rq->cmd_flags |= REQ_QUIET;
 		trace_block_rq_abort(q, rq);
 		/*
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/9] blk: scsi: blk abort queue updates, Mike Anderson, (Mon May 3, 8:36 pm)
[PATCH 3/9] blk: Add a unprep_rq_fn, Mike Anderson, (Mon May 3, 8:37 pm)
[PATCH 4/9] blk: Call unprep_fn from elv_abort_queue is av ..., Mike Anderson, (Mon May 3, 8:37 pm)
[PATCH 5/9] scsi: Add a scsi_unprep_fn, Mike Anderson, (Mon May 3, 8:37 pm)
[PATCH 6/9] blk: Add request atomic flag for abort, Mike Anderson, (Mon May 3, 8:37 pm)
[PATCH 7/9] blk: Mark requests aborted, Mike Anderson, (Mon May 3, 8:37 pm)
[PATCH 8/9] scsi: Add scsi_requeue_request function, Mike Anderson, (Mon May 3, 8:37 pm)
[PATCH 9/9] scsi: Add blk_request_aborted check, Mike Anderson, (Mon May 3, 8:37 pm)
Re: [PATCH 3/9] blk: Add a unprep_rq_fn, Hannes Reinecke, (Tue May 4, 3:41 am)
Re: [dm-devel] [PATCH 5/9] scsi: Add a scsi_unprep_fn, Hannes Reinecke, (Tue May 4, 3:43 am)
Re: [PATCH 7/9] blk: Mark requests aborted, Hannes Reinecke, (Tue May 4, 3:44 am)
Re: [PATCH 9/9] scsi: Add blk_request_aborted check, Hannes Reinecke, (Tue May 4, 3:45 am)
Re: [PATCH 5/9] scsi: Add a scsi_unprep_fn, Jens Axboe, (Tue May 4, 3:48 am)