From patchwork Sat Jan 30 05:37:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 8169611 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3220F9FBE9 for ; Sat, 30 Jan 2016 05:40:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 251D220225 for ; Sat, 30 Jan 2016 05:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 080B220374 for ; Sat, 30 Jan 2016 05:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752572AbcA3FkN (ORCPT ); Sat, 30 Jan 2016 00:40:13 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:33073 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbcA3FkK (ORCPT ); Sat, 30 Jan 2016 00:40:10 -0500 Received: by mail-ob0-f176.google.com with SMTP id is5so80504456obc.0 for ; Fri, 29 Jan 2016 21:40:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daterainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mgEq4MXVGW/a2LKQQYqIQuexCSNV6JZXzfChwiXoYG4=; b=RdFDWDKjjl76hCF15OQW04PtzVv2qm/Drn5sXN6kzuDMjJ1jDKwzlTy/db+uvfNB22 awb4jATHTCwuVtGnFOl11m/632NH3GFHgCjj/2YKlobWbuZv+3UztvFugltCQqaGr7gF QVPdGRSBiGOhwJT+WwifDN8insBB0rh7D/bVGu/zO5U560LGgp2wxlDmiEzelmuHJjhG Lb1gotQDoBwNoNrgg6egP52wrETEnLOqkGARk78ZMd+Q7qC7lAXK2XrPDPni/fwWhdXu Jr2c7PYSoca+1QdP4v/GbY9r+QET36Ey4fv+jLHj+gHDYz2MvyykXNCqU2kEApfsrvnv Zhiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mgEq4MXVGW/a2LKQQYqIQuexCSNV6JZXzfChwiXoYG4=; b=IWj2LVo2ycRW8IgpKpPym5IkiXk2aWWe2cJ2iaUINSJ9/f5qv9fWcU27G9yIbF0tIH gQFJtBjGuwOBS6044uc8H5QFYBfaX9q7o8sk8CwBsxtRKQhkLwsOzGJWW/ezkCWNcHdi CblxUWbPMazf5IIuRFKlC+TVUwbGR8fQWyZNxavbOiaZSizMTE0AR6s0upTgYBwgz97U S1T+OZ6/75NXjThdgHbjy95l+W/pKhTD9TxIcBbQKUVB1IOd49Rm0XXl1asRUGPzG7aN EU/YhmZMLX8lNf318aGb/AH43eq8GUCmTeeCH5EDHE2C3KHhxJxEVoh3Z1ktAhRitrVn 66qg== X-Gm-Message-State: AG10YORDIvMcl/OZx989+kw8Ky8cL8XPDJquzW2OGrLKRCe6EIcyTuVv456/S58k5E/vpw== X-Received: by 10.60.134.73 with SMTP id pi9mr9488089oeb.4.1454132409520; Fri, 29 Jan 2016 21:40:09 -0800 (PST) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by smtp.gmail.com with ESMTPSA id x142sm9372191oix.8.2016.01.29.21.40.08 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jan 2016 21:40:09 -0800 (PST) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-scsi , Quinn Tran , Himanshu Madhani , Sagi Grimberg , Christoph Hellwig , Hannes Reinecke , Andy Grover , Mike Christie , Nicholas Bellinger Subject: [PATCH-v3 5/5] target: Drop legacy se_cmd->task_stop_comp + REQUEST_STOP usage Date: Sat, 30 Jan 2016 05:37:02 +0000 Message-Id: <1454132222-29009-6-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1454132222-29009-1-git-send-email-nab@daterainc.com> References: <1454132222-29009-1-git-send-email-nab@daterainc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicholas Bellinger With CMD_T_FABRIC_STOP + se_cmd->cmd_wait_set usage in place, go ahead and drop left-over CMD_T_REQUEST_STOP checks in target_complete_cmd() and unused target_stop_cmd(). Cc: Quinn Tran Cc: Himanshu Madhani Cc: Sagi Grimberg Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Andy Grover Cc: Mike Christie Signed-off-by: Nicholas Bellinger Reviewed-by: Christoph Hellwig --- drivers/target/target_core_internal.h | 1 - drivers/target/target_core_transport.c | 37 ---------------------------------- include/target/target_core_base.h | 4 ---- 3 files changed, 42 deletions(-) diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h index dae0750c..db4412f 100644 --- a/drivers/target/target_core_internal.h +++ b/drivers/target/target_core_internal.h @@ -141,7 +141,6 @@ void transport_dump_vpd_proto_id(struct t10_vpd *, unsigned char *, int); int transport_dump_vpd_assoc(struct t10_vpd *, unsigned char *, int); int transport_dump_vpd_ident_type(struct t10_vpd *, unsigned char *, int); int transport_dump_vpd_ident(struct t10_vpd *, unsigned char *, int); -bool target_stop_cmd(struct se_cmd *cmd, unsigned long *flags); void transport_clear_lun_ref(struct se_lun *); void transport_send_task_abort(struct se_cmd *); sense_reason_t target_cmd_size_check(struct se_cmd *cmd, unsigned int size); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 36a70e0..463838d 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -693,15 +693,6 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status) } /* - * See if we are waiting to complete for an exception condition. - */ - if (cmd->transport_state & CMD_T_REQUEST_STOP) { - spin_unlock_irqrestore(&cmd->t_state_lock, flags); - complete(&cmd->task_stop_comp); - return; - } - - /* * Check for case where an explicit ABORT_TASK has been received * and transport_wait_for_tasks() will be waiting for completion.. */ @@ -1202,7 +1193,6 @@ void transport_init_se_cmd( INIT_LIST_HEAD(&cmd->state_list); init_completion(&cmd->t_transport_stop_comp); init_completion(&cmd->cmd_wait_comp); - init_completion(&cmd->task_stop_comp); spin_lock_init(&cmd->t_state_lock); kref_init(&cmd->cmd_kref); cmd->transport_state = CMD_T_DEV_ACTIVE; @@ -1634,33 +1624,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, EXPORT_SYMBOL(target_submit_tmr); /* - * If the cmd is active, request it to be stopped and sleep until it - * has completed. - */ -bool target_stop_cmd(struct se_cmd *cmd, unsigned long *flags) - __releases(&cmd->t_state_lock) - __acquires(&cmd->t_state_lock) -{ - bool was_active = false; - - if (cmd->transport_state & CMD_T_BUSY) { - cmd->transport_state |= CMD_T_REQUEST_STOP; - spin_unlock_irqrestore(&cmd->t_state_lock, *flags); - - pr_debug("cmd %p waiting to complete\n", cmd); - wait_for_completion(&cmd->task_stop_comp); - pr_debug("cmd %p stopped successfully\n", cmd); - - spin_lock_irqsave(&cmd->t_state_lock, *flags); - cmd->transport_state &= ~CMD_T_REQUEST_STOP; - cmd->transport_state &= ~CMD_T_BUSY; - was_active = true; - } - - return was_active; -} - -/* * Handle SAM-esque emulation for generic transport request failures. */ void transport_generic_request_failure(struct se_cmd *cmd, diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1579539e..d71a3ea 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -491,7 +491,6 @@ struct se_cmd { #define CMD_T_SENT (1 << 4) #define CMD_T_STOP (1 << 5) #define CMD_T_DEV_ACTIVE (1 << 7) -#define CMD_T_REQUEST_STOP (1 << 8) #define CMD_T_BUSY (1 << 9) #define CMD_T_TAS (1 << 10) #define CMD_T_FABRIC_STOP (1 << 11) @@ -514,9 +513,6 @@ struct se_cmd { struct list_head state_list; - /* old task stop completion, consider merging with some of the above */ - struct completion task_stop_comp; - /* backend private data */ void *priv;