]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] ppa: convert to accessors and !use_sg cleanup
authorBoaz Harrosh <bharrosh@panasas.com>
Sun, 9 Sep 2007 18:16:58 +0000 (21:16 +0300)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 12 Jan 2008 00:22:41 +0000 (18:22 -0600)
 - convert to accessors and !use_sg cleanup

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>
drivers/scsi/ppa.c

index 67ee51a3d7e14c2d328ac7510284ef3fe2e67bfa..f655ae320b483cfc418a30691b601f23a271b328 100644 (file)
@@ -750,18 +750,16 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
                cmd->SCp.phase++;
 
        case 4:         /* Phase 4 - Setup scatter/gather buffers */
-               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++;
 
        case 5:         /* Phase 5 - Data transfer stage */