aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-04-07 13:11:17 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-04-08 02:28:00 -0400
commit2c336e3a2e1728d9b3116422655832184dc7046c (patch)
treef05ba57e8b97922c352d2007e077b679a847d223
parentc3d0a7c21db219ef87679c2a667aba9f138524db (diff)
target: simplify target_xcopy_init_pt_lun
Drop unused argument & return value and consolidate a duplicate assignment. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_xcopy.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
index b09b40e058a0..8585acba6fc9 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -540,33 +540,22 @@ static void target_xcopy_setup_pt_port(
540 } 540 }
541} 541}
542 542
543static int target_xcopy_init_pt_lun( 543static void target_xcopy_init_pt_lun(struct se_device *se_dev,
544 struct xcopy_pt_cmd *xpt_cmd, 544 struct se_cmd *pt_cmd, bool remote_port)
545 struct xcopy_op *xop,
546 struct se_device *se_dev,
547 struct se_cmd *pt_cmd,
548 bool remote_port)
549{ 545{
550 /* 546 /*
551 * Don't allocate + init an pt_cmd->se_lun if honoring local port for 547 * Don't allocate + init an pt_cmd->se_lun if honoring local port for
552 * reservations. The pt_cmd->se_lun pointer will be setup from within 548 * reservations. The pt_cmd->se_lun pointer will be setup from within
553 * target_xcopy_setup_pt_port() 549 * target_xcopy_setup_pt_port()
554 */ 550 */
555 if (!remote_port) { 551 if (remote_port) {
556 pt_cmd->se_cmd_flags |= SCF_SE_LUN_CMD; 552 pr_debug("Setup emulated se_dev: %p from se_dev\n",
557 return 0; 553 pt_cmd->se_dev);
554 pt_cmd->se_lun = &se_dev->xcopy_lun;
555 pt_cmd->se_dev = se_dev;
558 } 556 }
559 557
560 pt_cmd->se_lun = &se_dev->xcopy_lun;
561 pt_cmd->se_dev = se_dev;
562
563 pr_debug("Setup emulated se_dev: %p from se_dev\n", pt_cmd->se_dev);
564 pt_cmd->se_cmd_flags |= SCF_SE_LUN_CMD; 558 pt_cmd->se_cmd_flags |= SCF_SE_LUN_CMD;
565
566 pr_debug("Setup emulated se_dev: %p to pt_cmd->se_lun->lun_se_dev\n",
567 pt_cmd->se_lun->lun_se_dev);
568
569 return 0;
570} 559}
571 560
572static int target_xcopy_setup_pt_cmd( 561static int target_xcopy_setup_pt_cmd(
@@ -584,11 +573,8 @@ static int target_xcopy_setup_pt_cmd(
584 * Setup LUN+port to honor reservations based upon xop->op_origin for 573 * Setup LUN+port to honor reservations based upon xop->op_origin for
585 * X-COPY PUSH or X-COPY PULL based upon where the CDB was received. 574 * X-COPY PUSH or X-COPY PULL based upon where the CDB was received.
586 */ 575 */
587 rc = target_xcopy_init_pt_lun(xpt_cmd, xop, se_dev, cmd, remote_port); 576 target_xcopy_init_pt_lun(se_dev, cmd, remote_port);
588 if (rc < 0) { 577
589 ret = rc;
590 goto out;
591 }
592 xpt_cmd->xcopy_op = xop; 578 xpt_cmd->xcopy_op = xop;
593 target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port); 579 target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port);
594 580