diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:19:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:19:08 -0500 |
commit | 9b73e76f3cf63379dcf45fcd4f112f5812418d0a (patch) | |
tree | 4e6bef87cd0cd6d848fc39a5ae25b981dbbe035b /drivers/scsi/libsrp.c | |
parent | 50d9a126240f9961cfdd063336bbeb91f77a7dce (diff) | |
parent | 23c3e290fb9ce38cabc2822b47583fc8702411bf (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits)
[SCSI] usbstorage: use last_sector_bug flag universally
[SCSI] libsas: abstract STP task status into a function
[SCSI] ultrastor: clean up inline asm warnings
[SCSI] aic7xxx: fix firmware build
[SCSI] aacraid: fib context lock for management ioctls
[SCSI] ch: remove forward declarations
[SCSI] ch: fix device minor number management bug
[SCSI] ch: handle class_device_create failure properly
[SCSI] NCR5380: fix section mismatch
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
[SCSI] IB/iSER: add logical unit reset support
[SCSI] don't use __GFP_DMA for sense buffers if not required
[SCSI] use dynamically allocated sense buffer
[SCSI] scsi.h: add macro for enclosure bit of inquiry data
[SCSI] sd: add fix for devices with last sector access problems
[SCSI] fix pcmcia compile problem
[SCSI] aacraid: add Voodoo Lite class of cards.
[SCSI] aacraid: add new driver features flags
[SCSI] qla2xxx: Update version number to 8.02.00-k7.
[SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
...
Diffstat (limited to 'drivers/scsi/libsrp.c')
-rw-r--r-- | drivers/scsi/libsrp.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c index 2ad0a27dbaab..5cff0204227d 100644 --- a/drivers/scsi/libsrp.c +++ b/drivers/scsi/libsrp.c | |||
@@ -192,18 +192,18 @@ static int srp_direct_data(struct scsi_cmnd *sc, struct srp_direct_buf *md, | |||
192 | 192 | ||
193 | if (dma_map) { | 193 | if (dma_map) { |
194 | iue = (struct iu_entry *) sc->SCp.ptr; | 194 | iue = (struct iu_entry *) sc->SCp.ptr; |
195 | sg = sc->request_buffer; | 195 | sg = scsi_sglist(sc); |
196 | 196 | ||
197 | dprintk("%p %u %u %d\n", iue, sc->request_bufflen, | 197 | dprintk("%p %u %u %d\n", iue, scsi_bufflen(sc), |
198 | md->len, sc->use_sg); | 198 | md->len, scsi_sg_count(sc)); |
199 | 199 | ||
200 | nsg = dma_map_sg(iue->target->dev, sg, sc->use_sg, | 200 | nsg = dma_map_sg(iue->target->dev, sg, scsi_sg_count(sc), |
201 | DMA_BIDIRECTIONAL); | 201 | DMA_BIDIRECTIONAL); |
202 | if (!nsg) { | 202 | if (!nsg) { |
203 | printk("fail to map %p %d\n", iue, sc->use_sg); | 203 | printk("fail to map %p %d\n", iue, scsi_sg_count(sc)); |
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | len = min(sc->request_bufflen, md->len); | 206 | len = min(scsi_bufflen(sc), md->len); |
207 | } else | 207 | } else |
208 | len = md->len; | 208 | len = md->len; |
209 | 209 | ||
@@ -229,10 +229,10 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd, | |||
229 | 229 | ||
230 | if (dma_map || ext_desc) { | 230 | if (dma_map || ext_desc) { |
231 | iue = (struct iu_entry *) sc->SCp.ptr; | 231 | iue = (struct iu_entry *) sc->SCp.ptr; |
232 | sg = sc->request_buffer; | 232 | sg = scsi_sglist(sc); |
233 | 233 | ||
234 | dprintk("%p %u %u %d %d\n", | 234 | dprintk("%p %u %u %d %d\n", |
235 | iue, sc->request_bufflen, id->len, | 235 | iue, scsi_bufflen(sc), id->len, |
236 | cmd->data_in_desc_cnt, cmd->data_out_desc_cnt); | 236 | cmd->data_in_desc_cnt, cmd->data_out_desc_cnt); |
237 | } | 237 | } |
238 | 238 | ||
@@ -268,13 +268,14 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd, | |||
268 | 268 | ||
269 | rdma: | 269 | rdma: |
270 | if (dma_map) { | 270 | if (dma_map) { |
271 | nsg = dma_map_sg(iue->target->dev, sg, sc->use_sg, DMA_BIDIRECTIONAL); | 271 | nsg = dma_map_sg(iue->target->dev, sg, scsi_sg_count(sc), |
272 | DMA_BIDIRECTIONAL); | ||
272 | if (!nsg) { | 273 | if (!nsg) { |
273 | eprintk("fail to map %p %d\n", iue, sc->use_sg); | 274 | eprintk("fail to map %p %d\n", iue, scsi_sg_count(sc)); |
274 | err = -EIO; | 275 | err = -EIO; |
275 | goto free_mem; | 276 | goto free_mem; |
276 | } | 277 | } |
277 | len = min(sc->request_bufflen, id->len); | 278 | len = min(scsi_bufflen(sc), id->len); |
278 | } else | 279 | } else |
279 | len = id->len; | 280 | len = id->len; |
280 | 281 | ||