Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a7c59e79ce060c746358b08521de0acbca6a4f1
Commit:     2a7c59e79ce060c746358b08521de0acbca6a4f1
Parent:     8889e3c129780cdbe15fed3c366ba3aa3026684d
Author:     FUJITA Tomonori <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 12:17:28 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 11:24:44 2007 +0200

    remove sglist_len
    
    Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 drivers/scsi/scsi_lib.c  |   11 ++++-------
 include/scsi/scsi_cmnd.h |    1 -
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1a7e8d8..aac8a02 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -769,10 +769,8 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd 
*cmd, gfp_t gfp_mask)
                /*
                 * first loop through, set initial index and return value
                 */
-               if (!ret) {
-                       cmd->sglist_len = index;
+               if (!ret)
                        ret = sgl;
-               }
 
                /*
                 * chain previous sglist, if any. we know the previous
@@ -825,8 +823,6 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd)
        struct scatterlist *sgl = cmd->request_buffer;
        struct scsi_host_sg_pool *sgp;
 
-       BUG_ON(cmd->sglist_len >= SG_MEMPOOL_NR);
-
        /*
         * if this is the biggest size sglist, check if we have
         * chained parts we need to free
@@ -861,9 +857,10 @@ void scsi_free_sgtable(struct scsi_cmnd *cmd)
                 * Restore original, will be freed below
                 */
                sgl = cmd->request_buffer;
-       }
+               sgp = scsi_sg_pools + SG_MEMPOOL_NR - 1;
+       } else
+               sgp = scsi_sg_pools + scsi_sgtable_index(cmd->__use_sg);
 
-       sgp = scsi_sg_pools + cmd->sglist_len;
        mempool_free(sgl, sgp->pool);
 }
 
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 4a5fa2d..3f47e52 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -69,7 +69,6 @@ struct scsi_cmnd {
 
        /* These elements define the operation we ultimately want to perform */
        unsigned short use_sg;  /* Number of pieces of scatter-gather */
-       unsigned short sglist_len;      /* size of malloc'd scatter-gather list 
*/
        unsigned short __use_sg;
 
        unsigned underflow;     /* Return error if less than
-
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