target: remove the task_sg_bidi field se_task and pSCSI BIDI support

This field is never used given that BIDI handling happens at the
command and not the task level.  Remove it and the dead code in
pscsi that tries to work on it.

It also prevents pSCSI passthrough for the two currently enabled BIDI
commands now that task->task_sg_bidi support has been removed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 936b9fe..dad671d 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -1095,32 +1095,6 @@
 			pr_err("pSCSI: blk_make_request() failed\n");
 			goto fail;
 		}
-
-		if (task->task_sg_bidi) {
-			/*
-			 * If present, set up the extra BIDI-COMMAND SCSI READ
-			 * struct request and payload.
-			 */
-			ret = pscsi_map_sg(task, task->task_sg_bidi, &hbio);
-			if (ret < 0) {
-				/* XXX: free the main request? */
-				return PYX_TRANSPORT_LU_COMM_FAILURE;
-			}
-
-			/*
-			 * Setup the secondary pt->pscsi_req->next_rq used for the extra
-			 * BIDI READ payload.
-			 */
-			req->next_rq = blk_make_request(pdv->pdv_sd->request_queue,
-							hbio, GFP_KERNEL);
-			if (!req) {
-				pr_err("pSCSI: blk_make_request() failed for BIDI\n");
-				/* XXX: free the main request? */
-				goto fail;
-			}
-
-			req->next_rq->cmd_type = REQ_TYPE_BLOCK_PC;
-		}
 	}
 
 	req->cmd_type = REQ_TYPE_BLOCK_PC;
@@ -1240,12 +1214,6 @@
 	pt->pscsi_resid = req->resid_len;
 
 	pscsi_process_SAM_status(task, pt);
-	/*
-	 * Release BIDI-READ if present
-	 */
-	if (req->next_rq != NULL)
-		__blk_put_request(req->q, req->next_rq);
-
 	__blk_put_request(req->q, req);
 }
 
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 06305be..624d86e 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2871,13 +2871,10 @@
 		size = transport_get_size(sectors, cdb, cmd);
 		cmd->t_task_lba = transport_lba_32(cdb);
 		cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB;
-		passthrough = (dev->transport->transport_type ==
-				TRANSPORT_PLUGIN_PHBA_PDEV);
-		/*
-		 * Skip the remaining assignments for TCM/PSCSI passthrough
-		 */
-		if (passthrough)
-			break;
+
+		if (dev->transport->transport_type ==
+				TRANSPORT_PLUGIN_PHBA_PDEV)
+			goto out_unsupported_cdb;
 		/*
 		 * Setup BIDI XOR callback to be run after I/O completion.
 		 */
@@ -2906,12 +2903,8 @@
 			cmd->t_task_lba = transport_lba_64_ext(cdb);
 			cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB;
 
-			/*
-			 * Skip the remaining assignments for TCM/PSCSI passthrough
-			 */
 			if (passthrough)
-				break;
-
+				goto out_unsupported_cdb;
 			/*
 			 * Setup BIDI XOR callback to be run during after I/O
 			 * completion.
@@ -3562,7 +3555,6 @@
 		 */
 		del_timer_sync(&task->task_timer);
 
-		kfree(task->task_sg_bidi);
 		kfree(task->task_sg);
 
 		list_del(&task->t_list);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 8e2c83d..132266b 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -397,7 +397,6 @@
 	u32			task_size;
 	struct se_cmd		*task_se_cmd;
 	struct scatterlist	*task_sg;
-	struct scatterlist	*task_sg_bidi;
 	u32			task_sg_nents;
 	u16			task_flags;
 	u8			task_sense;