Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3ce7c6588637614b00072569679791a04898c790
Commit:     3ce7c6588637614b00072569679791a04898c790
Parent:     57643c711c3759623e7ac651a4a418858cdaeae5
Author:     Boaz Harrosh <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 9 21:13:42 2007 +0300
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Jan 11 18:22:41 2008 -0600

    [SCSI] imm: convert to accessors and !use_sg cleanup
    
     - convert to accessors and !use_sg cleanup
     - Not ready for sg-chaining
    
    Signed-off-by: Boaz Harrosh <[EMAIL PROTECTED]>
    Acked-by: Randy Dunlap <[EMAIL PROTECTED]>
    Tested-by: Randy Dunlap <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/imm.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index a3d0c6b..f97d172 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -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++;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to