[ofa-general] commit bb350d1decd9c48ffaa7f7e263df3056df9f4f21

Michael S. Tsirkin mst at dev.mellanox.co.il
Mon Jul 23 00:57:54 PDT 2007


Hi!
commit bb350d1decd9c48ffaa7f7e263df3056df9f4f21 includes this snippet:

@@ -468,20 +465,8 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
                req->fmr = NULL;
        }

-       /*
-        * This handling of non-SG commands can be killed when the
-        * SCSI midlayer no longer generates non-SG commands.
-        */
-       if (likely(scmnd->use_sg)) {
-               nents = scmnd->use_sg;
-               scat  = scmnd->request_buffer;
-       } else {
-               nents = 1;
-               scat  = &req->fake_sg;
-       }
-
-       ib_dma_unmap_sg(target->srp_host->dev->dev, scat, nents,
-                       scmnd->sc_data_direction);
+       ib_dma_unmap_sg(target->srp_host->dev->dev, scsi_sglist(scmnd),
+                       scsi_sg_count(scmnd), scmnd->sc_data_direction);

Since scsi_sg_count is simply use_sg, and scsi_sglist is simply request_buffer,
why is this the right things to do?
Is there a reason to believe that scsi_sg_count is never 0 here?



-- 
MST



More information about the general mailing list