tree af64a510d254c8c96f662c3e3ba5039119765b1b
parent e537a36d528053f6b9dbe6c88e763e835c0d3517
author James Bottomley <[EMAIL PROTECTED](none)> Thu, 16 Jun 2005 04:16:09 -0500
committer James Bottomley <[EMAIL PROTECTED](none)> Sun, 28 Aug 2005 20:46:39 
-0500

update scsi_wait_req to new format for blk_rq_map_kern()

Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
 drivers/scsi/scsi_lib.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -246,15 +246,18 @@ void scsi_wait_req(struct scsi_request *
                   unsigned bufflen, int timeout, int retries)
 {
        DECLARE_COMPLETION(wait);
+       int write = sreq->sr_data_direction == DMA_TO_DEVICE;
        struct request *req;
 
-       if (bufflen)
-               req = blk_rq_map_kern(sreq->sr_device->request_queue,
-                                     sreq->sr_data_direction == DMA_TO_DEVICE,
-                                     buffer, bufflen, __GFP_WAIT);
-       else
-               req = blk_get_request(sreq->sr_device->request_queue, READ,
-                                     __GFP_WAIT);
+       req = blk_get_request(sreq->sr_device->request_queue, write,
+                             __GFP_WAIT);
+       if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req,
+                                      buffer, bufflen, __GFP_WAIT)) {
+               sreq->sr_result = DRIVER_ERROR << 24;
+               blk_put_request(req);
+               return;
+       }
+
        req->flags |= REQ_NOMERGE;
        req->waiting = &wait;
        req->end_io = scsi_wait_req_end_io;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to