aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-12-02 01:32:08 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:21 -0500
commite2bac7c55e43c9018f2f4daf15437e836b26e709 (patch)
treef2a7ec709b09a529bdf7eaa31fd138bb045a4af4
parente5a7efeffdcc3062ade5208d16c278d8d484f82a (diff)
[SCSI] iscsi_tcp: remove unused r2t handling
libiscsi's iscsi_prep_data_out_pdu now handles what iscsi_tcp's helpers were so we can remove iscsi_tcp's helpers. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/iscsi_tcp.c91
1 files changed, 0 insertions, 91 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 97bad5ce5834..e6ae4e648343 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -554,48 +554,6 @@ iscsi_data_in(struct iscsi_conn *conn, struct iscsi_task *task)
554} 554}
555 555
556/** 556/**
557 * iscsi_solicit_data_init - initialize first Data-Out
558 * @conn: iscsi connection
559 * @task: scsi command task
560 * @r2t: R2T info
561 *
562 * Notes:
563 * Initialize first Data-Out within this R2T sequence and finds
564 * proper data_offset within this SCSI command.
565 *
566 * This function is called with connection lock taken.
567 **/
568static void
569iscsi_solicit_data_init(struct iscsi_conn *conn, struct iscsi_task *task,
570 struct iscsi_r2t_info *r2t)
571{
572 struct iscsi_data *hdr;
573
574 hdr = &r2t->dtask.hdr;
575 memset(hdr, 0, sizeof(struct iscsi_data));
576 hdr->ttt = r2t->ttt;
577 hdr->datasn = cpu_to_be32(r2t->solicit_datasn);
578 r2t->solicit_datasn++;
579 hdr->opcode = ISCSI_OP_SCSI_DATA_OUT;
580 memcpy(hdr->lun, task->hdr->lun, sizeof(hdr->lun));
581 hdr->itt = task->hdr->itt;
582 hdr->exp_statsn = r2t->exp_statsn;
583 hdr->offset = cpu_to_be32(r2t->data_offset);
584 if (r2t->data_length > conn->max_xmit_dlength) {
585 hton24(hdr->dlength, conn->max_xmit_dlength);
586 r2t->data_count = conn->max_xmit_dlength;
587 hdr->flags = 0;
588 } else {
589 hton24(hdr->dlength, r2t->data_length);
590 r2t->data_count = r2t->data_length;
591 hdr->flags = ISCSI_FLAG_CMD_FINAL;
592 }
593 conn->dataout_pdus_cnt++;
594
595 r2t->sent = 0;
596}
597
598/**
599 * iscsi_r2t_rsp - iSCSI R2T Response processing 557 * iscsi_r2t_rsp - iSCSI R2T Response processing
600 * @conn: iscsi connection 558 * @conn: iscsi connection
601 * @task: scsi command task 559 * @task: scsi command task
@@ -1311,55 +1269,6 @@ iscsi_tcp_send_linear_data_prepare(struct iscsi_conn *conn, void *data,
1311 data, len, NULL, tx_hash); 1269 data, len, NULL, tx_hash);
1312} 1270}
1313 1271
1314/**
1315 * iscsi_solicit_data_cont - initialize next Data-Out
1316 * @conn: iscsi connection
1317 * @task: scsi command task
1318 * @r2t: R2T info
1319 * @left: bytes left to transfer
1320 *
1321 * Notes:
1322 * Initialize next Data-Out within this R2T sequence and continue
1323 * to process next Scatter-Gather element(if any) of this SCSI command.
1324 *
1325 * Called under connection lock.
1326 **/
1327static int
1328iscsi_solicit_data_cont(struct iscsi_conn *conn, struct iscsi_task *task,
1329 struct iscsi_r2t_info *r2t)
1330{
1331 struct iscsi_data *hdr;
1332 int new_offset, left;
1333
1334 BUG_ON(r2t->data_length - r2t->sent < 0);
1335 left = r2t->data_length - r2t->sent;
1336 if (left == 0)
1337 return 0;
1338
1339 hdr = &r2t->dtask.hdr;
1340 memset(hdr, 0, sizeof(struct iscsi_data));
1341 hdr->ttt = r2t->ttt;
1342 hdr->datasn = cpu_to_be32(r2t->solicit_datasn);
1343 r2t->solicit_datasn++;
1344 hdr->opcode = ISCSI_OP_SCSI_DATA_OUT;
1345 memcpy(hdr->lun, task->hdr->lun, sizeof(hdr->lun));
1346 hdr->itt = task->hdr->itt;
1347 hdr->exp_statsn = r2t->exp_statsn;
1348 new_offset = r2t->data_offset + r2t->sent;
1349 hdr->offset = cpu_to_be32(new_offset);
1350 if (left > conn->max_xmit_dlength) {
1351 hton24(hdr->dlength, conn->max_xmit_dlength);
1352 r2t->data_count = conn->max_xmit_dlength;
1353 } else {
1354 hton24(hdr->dlength, left);
1355 r2t->data_count = left;
1356 hdr->flags = ISCSI_FLAG_CMD_FINAL;
1357 }
1358
1359 conn->dataout_pdus_cnt++;
1360 return 1;
1361}
1362
1363static int iscsi_tcp_pdu_init(struct iscsi_task *task, 1272static int iscsi_tcp_pdu_init(struct iscsi_task *task,
1364 unsigned int offset, unsigned int count) 1273 unsigned int offset, unsigned int count)
1365{ 1274{