update scsi_wait_req to new format for blk_rq_map_kern()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
e537a36d52
commit
8e6401187e
|
@ -246,15 +246,18 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
|
||||||
unsigned bufflen, int timeout, int retries)
|
unsigned bufflen, int timeout, int retries)
|
||||||
{
|
{
|
||||||
DECLARE_COMPLETION(wait);
|
DECLARE_COMPLETION(wait);
|
||||||
|
int write = sreq->sr_data_direction == DMA_TO_DEVICE;
|
||||||
struct request *req;
|
struct request *req;
|
||||||
|
|
||||||
if (bufflen)
|
req = blk_get_request(sreq->sr_device->request_queue, write,
|
||||||
req = blk_rq_map_kern(sreq->sr_device->request_queue,
|
__GFP_WAIT);
|
||||||
sreq->sr_data_direction == DMA_TO_DEVICE,
|
if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req,
|
||||||
buffer, bufflen, __GFP_WAIT);
|
buffer, bufflen, __GFP_WAIT)) {
|
||||||
else
|
sreq->sr_result = DRIVER_ERROR << 24;
|
||||||
req = blk_get_request(sreq->sr_device->request_queue, READ,
|
blk_put_request(req);
|
||||||
__GFP_WAIT);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
req->flags |= REQ_NOMERGE;
|
req->flags |= REQ_NOMERGE;
|
||||||
req->waiting = &wait;
|
req->waiting = &wait;
|
||||||
req->end_io = scsi_wait_req_end_io;
|
req->end_io = scsi_wait_req_end_io;
|
||||||
|
|
Loading…
Reference in New Issue