Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7642
b: refs/heads/master
c: 8e64011
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley committed Aug 28, 2005
1 parent a513e62 commit 9d570f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e537a36d528053f6b9dbe6c88e763e835c0d3517
refs/heads/master: 8e6401187ef7fb1edc2740832b48bf47ed2c90f2
17 changes: 10 additions & 7 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,18 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
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;
Expand Down

0 comments on commit 9d570f3

Please sign in to comment.