Commit 3ce7c658 authored by Boaz Harrosh's avatar Boaz Harrosh Committed by James Bottomley

[SCSI] imm: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup
 - Not ready for sg-chaining
Signed-off-by: default avatarBoaz Harrosh <bharrosh@panasas.com>
Acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Tested-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 57643c71
...@@ -837,19 +837,16 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) ...@@ -837,19 +837,16 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
/* Phase 4 - Setup scatter/gather buffers */ /* Phase 4 - Setup scatter/gather buffers */
case 4: case 4:
if (cmd->use_sg) { if (scsi_bufflen(cmd)) {
/* if many buffers are available, start filling the first */ cmd->SCp.buffer = scsi_sglist(cmd);
cmd->SCp.buffer =
(struct scatterlist *) cmd->request_buffer;
cmd->SCp.this_residual = cmd->SCp.buffer->length; cmd->SCp.this_residual = cmd->SCp.buffer->length;
cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
} else { } else {
/* else fill the only available buffer */
cmd->SCp.buffer = NULL; cmd->SCp.buffer = NULL;
cmd->SCp.this_residual = cmd->request_bufflen; cmd->SCp.this_residual = 0;
cmd->SCp.ptr = cmd->request_buffer; cmd->SCp.ptr = NULL;
} }
cmd->SCp.buffers_residual = cmd->use_sg - 1; cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
cmd->SCp.phase++; cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01) if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++; cmd->SCp.this_residual++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment