summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_tgt_lib.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2007-10-25 01:21:30 +0900
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 18:22:30 -0600
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 a91761c3645..deea3cd5bf4 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)
scsi_tgt_uspace_send_status(cmd, tcmd->itn_id, tcmd->tag);
- if (cmd->request_buffer)
+ if (scsi_sglist(cmd))
scsi_free_sgtable(cmd);
queue_work(scsi_tgtd, &tcmd->work);
@@ -365,14 +365,15 @@ static int scsi_tgt_init_cmd(struct scsi_cmnd *cmd, gfp_t gfp_mask)
cmd->request_bufflen = rq->data_len;
- dprintk("cmd %p cnt %d %lu\n", cmd, cmd->use_sg, rq_data_dir(rq));
- count = blk_rq_map_sg(rq->q, rq, cmd->request_buffer);
- if (likely(count <= cmd->use_sg)) {
+ dprintk("cmd %p cnt %d %lu\n", cmd, scsi_sg_count(cmd),
+ rq_data_dir(rq));
+ count = blk_rq_map_sg(rq->q, rq, scsi_sglist(cmd));
+ if (likely(count <= scsi_sg_count(cmd))) {
cmd->use_sg = count;
return 0;
}
- eprintk("cmd %p cnt %d\n", cmd, cmd->use_sg);
+ eprintk("cmd %p cnt %d\n", cmd, scsi_sg_count(cmd));
scsi_free_sgtable(cmd);
return -EINVAL;
}