aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_xcopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/target_core_xcopy.c')
-rw-r--r--drivers/target/target_core_xcopy.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
index 8fd680ac941b..4515f52546f8 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -25,14 +25,12 @@
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/configfs.h> 27#include <linux/configfs.h>
28#include <scsi/scsi.h> 28#include <scsi/scsi_proto.h>
29#include <scsi/scsi_cmnd.h>
30#include <asm/unaligned.h> 29#include <asm/unaligned.h>
31 30
32#include <target/target_core_base.h> 31#include <target/target_core_base.h>
33#include <target/target_core_backend.h> 32#include <target/target_core_backend.h>
34#include <target/target_core_fabric.h> 33#include <target/target_core_fabric.h>
35#include <target/target_core_configfs.h>
36 34
37#include "target_core_internal.h" 35#include "target_core_internal.h"
38#include "target_core_pr.h" 36#include "target_core_pr.h"
@@ -349,8 +347,7 @@ struct xcopy_pt_cmd {
349 unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER]; 347 unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER];
350}; 348};
351 349
352static struct se_port xcopy_pt_port; 350struct se_portal_group xcopy_pt_tpg;
353static struct se_portal_group xcopy_pt_tpg;
354static struct se_session xcopy_pt_sess; 351static struct se_session xcopy_pt_sess;
355static struct se_node_acl xcopy_pt_nacl; 352static struct se_node_acl xcopy_pt_nacl;
356 353
@@ -359,11 +356,6 @@ static char *xcopy_pt_get_fabric_name(void)
359 return "xcopy-pt"; 356 return "xcopy-pt";
360} 357}
361 358
362static u32 xcopy_pt_get_tag(struct se_cmd *se_cmd)
363{
364 return 0;
365}
366
367static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) 359static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd)
368{ 360{
369 return 0; 361 return 0;
@@ -424,7 +416,6 @@ static int xcopy_pt_queue_status(struct se_cmd *se_cmd)
424 416
425static const struct target_core_fabric_ops xcopy_pt_tfo = { 417static const struct target_core_fabric_ops xcopy_pt_tfo = {
426 .get_fabric_name = xcopy_pt_get_fabric_name, 418 .get_fabric_name = xcopy_pt_get_fabric_name,
427 .get_task_tag = xcopy_pt_get_tag,
428 .get_cmd_state = xcopy_pt_get_cmd_state, 419 .get_cmd_state = xcopy_pt_get_cmd_state,
429 .release_cmd = xcopy_pt_release_cmd, 420 .release_cmd = xcopy_pt_release_cmd,
430 .check_stop_free = xcopy_pt_check_stop_free, 421 .check_stop_free = xcopy_pt_check_stop_free,
@@ -446,17 +437,11 @@ int target_xcopy_setup_pt(void)
446 return -ENOMEM; 437 return -ENOMEM;
447 } 438 }
448 439
449 memset(&xcopy_pt_port, 0, sizeof(struct se_port));
450 INIT_LIST_HEAD(&xcopy_pt_port.sep_alua_list);
451 INIT_LIST_HEAD(&xcopy_pt_port.sep_list);
452 mutex_init(&xcopy_pt_port.sep_tg_pt_md_mutex);
453
454 memset(&xcopy_pt_tpg, 0, sizeof(struct se_portal_group)); 440 memset(&xcopy_pt_tpg, 0, sizeof(struct se_portal_group));
455 INIT_LIST_HEAD(&xcopy_pt_tpg.se_tpg_node); 441 INIT_LIST_HEAD(&xcopy_pt_tpg.se_tpg_node);
456 INIT_LIST_HEAD(&xcopy_pt_tpg.acl_node_list); 442 INIT_LIST_HEAD(&xcopy_pt_tpg.acl_node_list);
457 INIT_LIST_HEAD(&xcopy_pt_tpg.tpg_sess_list); 443 INIT_LIST_HEAD(&xcopy_pt_tpg.tpg_sess_list);
458 444
459 xcopy_pt_port.sep_tpg = &xcopy_pt_tpg;
460 xcopy_pt_tpg.se_tpg_tfo = &xcopy_pt_tfo; 445 xcopy_pt_tpg.se_tpg_tfo = &xcopy_pt_tfo;
461 446
462 memset(&xcopy_pt_nacl, 0, sizeof(struct se_node_acl)); 447 memset(&xcopy_pt_nacl, 0, sizeof(struct se_node_acl));
@@ -497,10 +482,6 @@ static void target_xcopy_setup_pt_port(
497 */ 482 */
498 if (remote_port) { 483 if (remote_port) {
499 xpt_cmd->remote_port = remote_port; 484 xpt_cmd->remote_port = remote_port;
500 pt_cmd->se_lun->lun_sep = &xcopy_pt_port;
501 pr_debug("Setup emulated remote DEST xcopy_pt_port: %p to"
502 " cmd->se_lun->lun_sep for X-COPY data PUSH\n",
503 pt_cmd->se_lun->lun_sep);
504 } else { 485 } else {
505 pt_cmd->se_lun = ec_cmd->se_lun; 486 pt_cmd->se_lun = ec_cmd->se_lun;
506 pt_cmd->se_dev = ec_cmd->se_dev; 487 pt_cmd->se_dev = ec_cmd->se_dev;
@@ -520,10 +501,6 @@ static void target_xcopy_setup_pt_port(
520 */ 501 */
521 if (remote_port) { 502 if (remote_port) {
522 xpt_cmd->remote_port = remote_port; 503 xpt_cmd->remote_port = remote_port;
523 pt_cmd->se_lun->lun_sep = &xcopy_pt_port;
524 pr_debug("Setup emulated remote SRC xcopy_pt_port: %p to"
525 " cmd->se_lun->lun_sep for X-COPY data PULL\n",
526 pt_cmd->se_lun->lun_sep);
527 } else { 504 } else {
528 pt_cmd->se_lun = ec_cmd->se_lun; 505 pt_cmd->se_lun = ec_cmd->se_lun;
529 pt_cmd->se_dev = ec_cmd->se_dev; 506 pt_cmd->se_dev = ec_cmd->se_dev;
@@ -575,6 +552,7 @@ static int target_xcopy_setup_pt_cmd(
575 xpt_cmd->xcopy_op = xop; 552 xpt_cmd->xcopy_op = xop;
576 target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port); 553 target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port);
577 554
555 cmd->tag = 0;
578 sense_rc = target_setup_cmd_from_cdb(cmd, cdb); 556 sense_rc = target_setup_cmd_from_cdb(cmd, cdb);
579 if (sense_rc) { 557 if (sense_rc) {
580 ret = -EINVAL; 558 ret = -EINVAL;