Skip to content

Commit

Permalink
[SCSI] imm: convert to accessors and !use_sg cleanup
Browse files Browse the repository at this point in the history
 - convert to accessors and !use_sg cleanup
 - Not ready for sg-chaining

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Boaz Harrosh authored and James Bottomley committed Jan 12, 2008
1 parent 57643c7 commit 3ce7c65
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/scsi/imm.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,19 +837,16 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)

/* Phase 4 - Setup scatter/gather buffers */
case 4:
if (cmd->use_sg) {
/* if many buffers are available, start filling the first */
cmd->SCp.buffer =
(struct scatterlist *) cmd->request_buffer;
if (scsi_bufflen(cmd)) {
cmd->SCp.buffer = scsi_sglist(cmd);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
} else {
/* else fill the only available buffer */
cmd->SCp.buffer = NULL;
cmd->SCp.this_residual = cmd->request_bufflen;
cmd->SCp.ptr = cmd->request_buffer;
cmd->SCp.this_residual = 0;
cmd->SCp.ptr = NULL;
}
cmd->SCp.buffers_residual = cmd->use_sg - 1;
cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
Expand Down

0 comments on commit 3ce7c65

Please sign in to comment.