scsi: set sc_data_direction in common code
The data direction fiel in the SCSI command is derived only from the block request structure. Move setting it up into common code instead of duplicating it in the ULDs. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
This commit is contained in:
@@ -994,14 +994,12 @@ static int sd_init_command(struct scsi_cmnd *SCpnt)
|
||||
goto out;
|
||||
}
|
||||
SCpnt->cmnd[0] = WRITE_6;
|
||||
SCpnt->sc_data_direction = DMA_TO_DEVICE;
|
||||
|
||||
if (blk_integrity_rq(rq))
|
||||
sd_dif_prepare(rq, block, sdp->sector_size);
|
||||
|
||||
} else if (rq_data_dir(rq) == READ) {
|
||||
SCpnt->cmnd[0] = READ_6;
|
||||
SCpnt->sc_data_direction = DMA_FROM_DEVICE;
|
||||
} else {
|
||||
scmd_printk(KERN_ERR, SCpnt, "Unknown command %llx\n", (unsigned long long) rq->cmd_flags);
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user