aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-06-15 19:16:09 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-08-28 11:46:39 -0400
commit8e6401187ef7fb1edc2740832b48bf47ed2c90f2 (patch)
treeaf64a510d254c8c96f662c3e3ba5039119765b1b
parente537a36d528053f6b9dbe6c88e763e835c0d3517 (diff)
update scsi_wait_req to new format for blk_rq_map_kern()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/scsi_lib.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 253c1a98d159..60f07b6a5ffc 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -246,15 +246,18 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
246 unsigned bufflen, int timeout, int retries) 246 unsigned bufflen, int timeout, int retries)
247{ 247{
248 DECLARE_COMPLETION(wait); 248 DECLARE_COMPLETION(wait);
249 int write = sreq->sr_data_direction == DMA_TO_DEVICE;
249 struct request *req; 250 struct request *req;
250 251
251 if (bufflen) 252 req = blk_get_request(sreq->sr_device->request_queue, write,
252 req = blk_rq_map_kern(sreq->sr_device->request_queue, 253 __GFP_WAIT);
253 sreq->sr_data_direction == DMA_TO_DEVICE, 254 if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req,
254 buffer, bufflen, __GFP_WAIT); 255 buffer, bufflen, __GFP_WAIT)) {
255 else 256 sreq->sr_result = DRIVER_ERROR << 24;
256 req = blk_get_request(sreq->sr_device->request_queue, READ, 257 blk_put_request(req);
257 __GFP_WAIT); 258 return;
259 }
260
258 req->flags |= REQ_NOMERGE; 261 req->flags |= REQ_NOMERGE;
259 req->waiting = &wait; 262 req->waiting = &wait;
260 req->end_io = scsi_wait_req_end_io; 263 req->end_io = scsi_wait_req_end_io;