aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_tgt_lib.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2007-10-24 12:21:30 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:30 -0500
commitf10ab66fa564fd624b04fe207ccae206df85efbf (patch)
tree02d74570656d5be2a799c17576ee50d00221664b /drivers/scsi/scsi_tgt_lib.c
parent1237c98db2aa94b42dbb9fb1df062b7d3733dc83 (diff)
[SCSI] tgt: convert to use the data buffer accessors
- convert to use the new accessors for the sg lists and the parameters. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_tgt_lib.c')
-rw-r--r--drivers/scsi/scsi_tgt_lib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index a91761c3645f..deea3cd5bf49 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -331,7 +331,7 @@ static void scsi_tgt_cmd_done(struct scsi_cmnd *cmd)
331 331
332 scsi_tgt_uspace_send_status(cmd, tcmd->itn_id, tcmd->tag); 332 scsi_tgt_uspace_send_status(cmd, tcmd->itn_id, tcmd->tag);
333 333
334 if (cmd->request_buffer) 334 if (scsi_sglist(cmd))
335 scsi_free_sgtable(cmd); 335 scsi_free_sgtable(cmd);
336 336
337 queue_work(scsi_tgtd, &tcmd->work); 337 queue_work(scsi_tgtd, &tcmd->work);
@@ -365,14 +365,15 @@ static int scsi_tgt_init_cmd(struct scsi_cmnd *cmd, gfp_t gfp_mask)
365 365
366 cmd->request_bufflen = rq->data_len; 366 cmd->request_bufflen = rq->data_len;
367 367
368 dprintk("cmd %p cnt %d %lu\n", cmd, cmd->use_sg, rq_data_dir(rq)); 368 dprintk("cmd %p cnt %d %lu\n", cmd, scsi_sg_count(cmd),
369 count = blk_rq_map_sg(rq->q, rq, cmd->request_buffer); 369 rq_data_dir(rq));
370 if (likely(count <= cmd->use_sg)) { 370 count = blk_rq_map_sg(rq->q, rq, scsi_sglist(cmd));
371 if (likely(count <= scsi_sg_count(cmd))) {
371 cmd->use_sg = count; 372 cmd->use_sg = count;
372 return 0; 373 return 0;
373 } 374 }
374 375
375 eprintk("cmd %p cnt %d\n", cmd, cmd->use_sg); 376 eprintk("cmd %p cnt %d\n", cmd, scsi_sg_count(cmd));
376 scsi_free_sgtable(cmd); 377 scsi_free_sgtable(cmd);
377 return -EINVAL; 378 return -EINVAL;
378} 379}