From patchwork Tue Apr 2 19:58:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10882273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F1C4139A for ; Tue, 2 Apr 2019 19:58:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE08A28684 for ; Tue, 2 Apr 2019 19:58:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2261288D3; Tue, 2 Apr 2019 19:58:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8240628684 for ; Tue, 2 Apr 2019 19:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbfDBT6e (ORCPT ); Tue, 2 Apr 2019 15:58:34 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:40229 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfDBT6e (ORCPT ); Tue, 2 Apr 2019 15:58:34 -0400 Received: by mail-pf1-f193.google.com with SMTP id c207so6905040pfc.7 for ; Tue, 02 Apr 2019 12:58:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hBdkMvkWPMw9/dUvhoDzAModGoXJep4CKFG3+lUxvEw=; b=WPXapofJhdnTZAI6kvwoXSgbf3yW0hsj0clxnqmeig5to4/U0lY+lNTeLk1q192CBL diEjQHRhPWFh4AVwNHFZ068C9L3CfjzwGizBve7EFbXYrckMBY8kBSh4+tGkuerxm8ts mm2hCmGQBY4n7byn5ALQvobqN7VNuxQY2sRjFtmJuolJpFoYICBa7PUuQFNQNSMxv7YF bGfZLEJJLapbjgJTJbRvlcw8PcTeRfTJ81oHb1kRue4GBoTAe2RFxRB70Gx9KTrkfKB1 UIoY1n9NXQHduOoCdAanOk4haFlrHrD2z//C84Hnje+6ko1WJXPcDUweFMUTXK46+BqC 1lfQ== X-Gm-Message-State: APjAAAXLUxsgdn2xH++Ao56k8fXUzHxg7wxaKOHb4GzdLUaAar7UoElr L1CQBYsERlpPo/Qld8Gu80I= X-Google-Smtp-Source: APXvYqxYiLTdmtcGi1+kmRlr867cwcMDP1lWp2P+OEWIB8wRx3z5Pw9fuDvdVMQFAX9h7S0MVsDb8A== X-Received: by 2002:a63:e045:: with SMTP id n5mr27932816pgj.230.1554235112996; Tue, 02 Apr 2019 12:58:32 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id o5sm49055490pfa.135.2019.04.02.12.58.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 12:58:32 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: Mike Christie , Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Mike Christie , Hannes Reinecke , Nicholas Bellinger Subject: [PATCH 05/11] target/core: Simplify LUN initialization in XCOPY implementation Date: Tue, 2 Apr 2019 12:58:09 -0700 Message-Id: <20190402195815.254796-6-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190402195815.254796-1-bvanassche@acm.org> References: <20190402195815.254796-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Other than removing a few pr_debug() statements, this patch does not change any functionality. Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Nicholas Bellinger Signed-off-by: Bart Van Assche --- drivers/target/target_core_xcopy.c | 43 +++--------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index d97be766e4ac..39f4490a3ebe 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -513,53 +513,16 @@ static void target_xcopy_setup_pt_port( struct se_cmd *ec_cmd = xop->xop_se_cmd; struct se_cmd *pt_cmd = &xpt_cmd->se_cmd; - if (xop->op_origin == XCOL_SOURCE_RECV_OP) { - /* - * Honor destination port reservations for X-COPY PUSH emulation - * when CDB is received on local source port, and READs blocks to - * WRITE on remote destination port. - */ - if (!remote_port) { - pt_cmd->se_lun = ec_cmd->se_lun; - pt_cmd->se_dev = ec_cmd->se_dev; - - pr_debug("Honoring local SRC port from ec_cmd->se_dev:" - " %p\n", pt_cmd->se_dev); - pt_cmd->se_lun = ec_cmd->se_lun; - pr_debug("Honoring local SRC port from ec_cmd->se_lun: %p\n", - pt_cmd->se_lun); - } - } else { - /* - * Honor source port reservation for X-COPY PULL emulation - * when CDB is received on local desintation port, and READs - * blocks from the remote source port to WRITE on local - * destination port. - */ - if (!remote_port) { - pt_cmd->se_lun = ec_cmd->se_lun; - pt_cmd->se_dev = ec_cmd->se_dev; - - pr_debug("Honoring local DST port from ec_cmd->se_dev:" - " %p\n", pt_cmd->se_dev); - pt_cmd->se_lun = ec_cmd->se_lun; - pr_debug("Honoring local DST port from ec_cmd->se_lun: %p\n", - pt_cmd->se_lun); - } + if (!remote_port) { + pt_cmd->se_lun = ec_cmd->se_lun; + pt_cmd->se_dev = ec_cmd->se_dev; } } static void target_xcopy_init_pt_lun(struct se_device *se_dev, struct se_cmd *pt_cmd, bool remote_port) { - /* - * Don't allocate + init an pt_cmd->se_lun if honoring local port for - * reservations. The pt_cmd->se_lun pointer will be setup from within - * target_xcopy_setup_pt_port() - */ if (remote_port) { - pr_debug("Setup emulated se_dev: %p from se_dev\n", - pt_cmd->se_dev); pt_cmd->se_lun = &se_dev->xcopy_lun; pt_cmd->se_dev = se_dev; }