Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7d6cf55ea47684b704d67a6046044c29bad4824
Commit:     e7d6cf55ea47684b704d67a6046044c29bad4824
Parent:     58e2a02eb18393e76a469580fedf7caec190eb5e
Author:     FUJITA Tomonori <[EMAIL PROTECTED]>
AuthorDate: Mon May 14 19:27:06 2007 +0900
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sat May 26 19:18:10 2007 -0500

    [SCSI] wd7000: convert to use the data buffer accessors
    
    - remove the unnecessary map_single path.
    
    - convert to use the new accessors for the sg lists and the
    parameters.
    
    Jens Axboe <[EMAIL PROTECTED]> did the for_each_sg cleanup.
    
    Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/wd7000.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 30be765..d6fd425 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1091,6 +1091,7 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
        unchar *cdb = (unchar *) SCpnt->cmnd;
        unchar idlun;
        short cdblen;
+       int nseg;
        Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
 
        cdblen = SCpnt->cmd_len;
@@ -1106,28 +1107,29 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
        SCpnt->host_scribble = (unchar *) scb;
        scb->host = host;
 
-       if (SCpnt->use_sg) {
-               struct scatterlist *sg = (struct scatterlist *) 
SCpnt->request_buffer;
+       nseg = scsi_sg_count(SCpnt);
+       if (nseg) {
+               struct scatterlist *sg;
                unsigned i;
 
                if (SCpnt->device->host->sg_tablesize == SG_NONE) {
                        panic("wd7000_queuecommand: scatter/gather not 
supported.\n");
                }
-               dprintk("Using scatter/gather with %d elements.\n", 
SCpnt->use_sg);
+               dprintk("Using scatter/gather with %d elements.\n", nseg);
 
                sgb = scb->sgb;
                scb->op = 1;
                any2scsi(scb->dataptr, (int) sgb);
-               any2scsi(scb->maxlen, SCpnt->use_sg * sizeof(Sgb));
+               any2scsi(scb->maxlen, nseg * sizeof(Sgb));
 
-               for (i = 0; i < SCpnt->use_sg; i++) {
-                       any2scsi(sgb[i].ptr, isa_page_to_bus(sg[i].page) + 
sg[i].offset);
-                       any2scsi(sgb[i].len, sg[i].length);
+               scsi_for_each_sg(SCpnt, sg, nseg, i) {
+                       any2scsi(sgb[i].ptr, isa_page_to_bus(sg->page) + 
sg->offset);
+                       any2scsi(sgb[i].len, sg->length);
                }
        } else {
                scb->op = 0;
-               any2scsi(scb->dataptr, isa_virt_to_bus(SCpnt->request_buffer));
-               any2scsi(scb->maxlen, SCpnt->request_bufflen);
+               any2scsi(scb->dataptr, isa_virt_to_bus(scsi_sglist(SCpnt)));
+               any2scsi(scb->maxlen, scsi_bufflen(SCpnt));
        }
 
        /* FIXME: drop lock and yield here ? */
-
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