diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-12-09 17:45:22 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-12-14 00:29:27 -0500 |
commit | c9526497cf03ee775c3a6f8ba62335735f98de7a (patch) | |
tree | 46619a6e57ca84b51fed852722114c2fd25a9289 /drivers/scsi/sd.c | |
parent | 322e079f1b606e46b79bb8b8e6cf6110b5f2aa3f (diff) |
[SCSI] Consolidate REQ_BLOCK_PC handling path (fix ipod panic)
This follows on from Jens' patch and consolidates all of the ULD
separate handlers for REQ_BLOCK_PC into a single call which has his
fix for our direction bug.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8613a1317712..03fcbab30033 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -245,24 +245,10 @@ static int sd_init_command(struct scsi_cmnd * SCpnt) | |||
245 | * SG_IO from block layer already setup, just copy cdb basically | 245 | * SG_IO from block layer already setup, just copy cdb basically |
246 | */ | 246 | */ |
247 | if (blk_pc_request(rq)) { | 247 | if (blk_pc_request(rq)) { |
248 | if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) | 248 | scsi_setup_blk_pc_cmnd(SCpnt, SD_PASSTHROUGH_RETRIES); |
249 | return 0; | ||
250 | |||
251 | memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); | ||
252 | SCpnt->cmd_len = rq->cmd_len; | ||
253 | if (rq_data_dir(rq) == WRITE) | ||
254 | SCpnt->sc_data_direction = DMA_TO_DEVICE; | ||
255 | else if (rq->data_len) | ||
256 | SCpnt->sc_data_direction = DMA_FROM_DEVICE; | ||
257 | else | ||
258 | SCpnt->sc_data_direction = DMA_NONE; | ||
259 | |||
260 | this_count = rq->data_len; | ||
261 | if (rq->timeout) | 249 | if (rq->timeout) |
262 | timeout = rq->timeout; | 250 | timeout = rq->timeout; |
263 | 251 | ||
264 | SCpnt->transfersize = rq->data_len; | ||
265 | SCpnt->allowed = SD_PASSTHROUGH_RETRIES; | ||
266 | goto queue; | 252 | goto queue; |
267 | } | 253 | } |
268 | 254 | ||