From patchwork Tue May 26 06:25:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 6478141 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 142309F38C for ; Tue, 26 May 2015 06:51:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24BE6203C3 for ; Tue, 26 May 2015 06:51:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A8AC203B8 for ; Tue, 26 May 2015 06:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751478AbbEZGvG (ORCPT ); Tue, 26 May 2015 02:51:06 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:33858 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbbEZGvC (ORCPT ); Tue, 26 May 2015 02:51:02 -0400 Received: by obew15 with SMTP id w15so5818269obe.1 for ; Mon, 25 May 2015 23:51:01 -0700 (PDT) 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=D32xS52LB1ab7x2BZeCaHO1+yIalDmTfrzjma1Wa0Xk=; b=nKZR1fFHo7f+/vrsn9ennhDsNF7EXIt9OEzWrtJUvzCx2MVO6ly+TiuwzqyBnFOJbj Ag+zPU7ceY/0jww1mRbe2l9OfvtwYwUyaK7gtNpE0kMp3GONEYulRIdGSnE/Baq6doV9 ibpGhOEdg5mMdOhEi7Wpnj5VN7ma9gQEJecHAQGmKSGFquq8JeJzz2xDmGkyJ3Hv8ayl +UxOY+yEjs8maDiJvPHnC74nmj38bqoqpRoV1/NqIs6ynUxtDTnkAIbE2a37wXXsKRTX 2Is0oPRxchOzTC1Y4H9j4PyB1gK7ylOZClcCmsnWkTCceChqxU8dO/vhcHrvSlX4ZgH2 RlcA== X-Gm-Message-State: ALoCoQkBadHZHCyLl/yj4qeFkDfLau2XQBAOoRnrXUQ8l2xIlYs2sziFck6vhIDlib1BuwkJ4f8f X-Received: by 10.202.93.4 with SMTP id r4mr19626049oib.92.1432621709694; Mon, 25 May 2015 23:28:29 -0700 (PDT) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by mx.google.com with ESMTPSA id x77sm4802314oix.24.2015.05.25.23.28.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 May 2015 23:28:29 -0700 (PDT) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-scsi , linux-kernel , Christoph Hellwig , Hannes Reinecke , Sagi Grimberg , "Paul E. McKenney" , Nicholas Bellinger Subject: [PATCH-v3 10/10] target: Drop left-over se_lun->lun_status Date: Tue, 26 May 2015 06:25:30 +0000 Message-Id: <1432621530-24171-11-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1432621530-24171-1-git-send-email-nab@daterainc.com> References: <1432621530-24171-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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Now that se_portal_group->tpg_lun_hlist is a RCU protected hlist, go ahead and drop the left-over lun->lun_status usage. Reported-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_tpg.c | 6 ------ include/target/target_core_base.h | 8 -------- 2 files changed, 14 deletions(-) diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index f66c208..91f8ddb 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -98,8 +98,6 @@ void core_tpg_add_node_to_devs( mutex_lock(&tpg->tpg_lun_mutex); hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) { - if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) - continue; if (lun_orig && lun != lun_orig) continue; @@ -495,7 +493,6 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) int ret; lun->unpacked_lun = 0; - lun->lun_status = TRANSPORT_LUN_STATUS_FREE; atomic_set(&lun->lun_acl_count, 0); init_completion(&lun->lun_shutdown_comp); spin_lock_init(&lun->lun_sep_lock); @@ -608,7 +605,6 @@ struct se_lun *core_tpg_alloc_lun( } lun->unpacked_lun = unpacked_lun; lun->lun_link_magic = SE_LUN_LINK_MAGIC; - lun->lun_status = TRANSPORT_LUN_STATUS_FREE; atomic_set(&lun->lun_acl_count, 0); init_completion(&lun->lun_shutdown_comp); spin_lock_init(&lun->lun_sep_lock); @@ -638,7 +634,6 @@ int core_tpg_add_lun( mutex_lock(&tpg->tpg_lun_mutex); lun->lun_access = lun_access; - lun->lun_status = TRANSPORT_LUN_STATUS_ACTIVE; if (!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) hlist_add_head_rcu(&lun->link, &tpg->tpg_lun_hlist); mutex_unlock(&tpg->tpg_lun_mutex); @@ -658,7 +653,6 @@ void core_tpg_remove_lun( core_dev_unexport(lun->lun_se_dev, tpg, lun); mutex_lock(&tpg->tpg_lun_mutex); - lun->lun_status = TRANSPORT_LUN_STATUS_FREE; if (!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) hlist_del_rcu(&lun->link); mutex_unlock(&tpg->tpg_lun_mutex); diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 7908d6d..78ed2a8 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -119,12 +119,6 @@ enum hba_flags_table { HBA_FLAGS_PSCSI_MODE = 0x02, }; -/* struct se_lun->lun_status */ -enum transport_lun_status_table { - TRANSPORT_LUN_STATUS_FREE = 0, - TRANSPORT_LUN_STATUS_ACTIVE = 1, -}; - /* Special transport agnostic struct se_cmd->t_states */ enum transport_state_table { TRANSPORT_NO_STATE = 0, @@ -707,8 +701,6 @@ struct se_lun { u16 lun_rtpi; #define SE_LUN_LINK_MAGIC 0xffff7771 u32 lun_link_magic; - /* See transport_lun_status_table */ - enum transport_lun_status_table lun_status; u32 lun_access; u32 lun_flags; u32 unpacked_lun;