Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3541614pxj; Mon, 24 May 2021 09:01:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykZG3i1k0hIWTqfumI3q1B1ml9bkwNlJFFoePYvAfu9WKaaZhP2YApgIpEYIiSS+JdgRGT X-Received: by 2002:a05:6e02:1b83:: with SMTP id h3mr14018527ili.199.1621872061392; Mon, 24 May 2021 09:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872061; cv=none; d=google.com; s=arc-20160816; b=oL/A+Yg0O8D7jaHtN0OjkX5g7unS6nqr0KTVozJfXoYZafxSPkl+5yhyqIbSR5xy0h 9cmrvuqCd5wlIN53y99KaJOvkGzHJO1u05uw5cR0sa/qLE7MA6gqiaT3JlJ/OJN70g+E DNEfWvqSwJuRLTA7WeBQpASt4xWhFINbPrIc/vImzQ8FuE44Kbq5umZeiDqJSiEgQEzZ TO6of/sumDK1fomuYPbbLHnxH/ojM+ng1XFDKhtjg0bgp9x4Yy2or1LDu69QVGcNm6u/ eocUO6iSHgC+2HxpytkWE/DmkI24XuuRWuIlLkSRVl4IMo4Y9ZI26lO7mPP+doKNr0py g8kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZHBypTxu0WXbfkT75K2BNhKV5/YAIvpxRlF/HzLkL8A=; b=VUhpgVkzNEckTaq3l5JopObbUWIPjSr9+z0VaBaF05iFSp3YzFMKCSvwB3dWXaGcy0 gtkkBPcNWOhGKAGSe1ekmNajRpwD68OYQzb0pNGWFmxuRU5/pXIhfv7HhmCecS1StIWq 72ofA9VTqsJrf/oRSsk6qC+bGl5qTB2PhuC4NOwjxg6+ihbEEPazPqRJRTzVKQ58/yfX f1DHd6VCOBOFcZx1MeQnygJ3lghiwYnGjFof0uRVGHGG2u5iDuFvcMWuSy0cDLCzyOzc Ts/T46aKlvEF48WXw5v8OLdvm225YW9rUnnm6G58FowRJKvrvM24+Gxt/qGDlG8L9E/6 0FFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J8Yjm9Hl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si15772164iln.109.2021.05.24.09.00.47; Mon, 24 May 2021 09:01:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J8Yjm9Hl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235855AbhEXQB0 (ORCPT + 99 others); Mon, 24 May 2021 12:01:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:38718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234418AbhEXPwQ (ORCPT ); Mon, 24 May 2021 11:52:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B0D2613F3; Mon, 24 May 2021 15:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870740; bh=LEkjlQhBJKYdOwVtxAHgm3u6ALPjzQ7XpA6VTqnK/iA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J8Yjm9HlkNr2DXMNpJpjxsLZ3FLB+vzzPJfnTjWovORK2xy0Q9owSzQDlWJ5pTZuq ZYjjAOAOf79SdConXuB8DB1aH4sOXZUBngeNOoc8qQQE/chScMcjatZNMM8jKP2wnK gWSY4fHpfvj4RZ/UAdsFFqCUc1KU1YZZZURPb5eA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 013/104] nvmet: remove unused ctrl->cqs Date: Mon, 24 May 2021 17:25:08 +0200 Message-Id: <20210524152333.269792078@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amit [ Upstream commit 6d65aeab7bf6e83e75f53cfdbdb84603e52e1182 ] remove unused cqs from nvmet_ctrl struct this will reduce the allocated memory. Signed-off-by: Amit Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/target/core.c | 15 ++------------- drivers/nvme/target/nvmet.h | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 1e79d33c1df7..870d06cfd815 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -757,8 +757,6 @@ void nvmet_cq_setup(struct nvmet_ctrl *ctrl, struct nvmet_cq *cq, { cq->qid = qid; cq->size = size; - - ctrl->cqs[qid] = cq; } void nvmet_sq_setup(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq, @@ -1355,20 +1353,14 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn, if (!ctrl->changed_ns_list) goto out_free_ctrl; - ctrl->cqs = kcalloc(subsys->max_qid + 1, - sizeof(struct nvmet_cq *), - GFP_KERNEL); - if (!ctrl->cqs) - goto out_free_changed_ns_list; - ctrl->sqs = kcalloc(subsys->max_qid + 1, sizeof(struct nvmet_sq *), GFP_KERNEL); if (!ctrl->sqs) - goto out_free_cqs; + goto out_free_changed_ns_list; if (subsys->cntlid_min > subsys->cntlid_max) - goto out_free_cqs; + goto out_free_changed_ns_list; ret = ida_simple_get(&cntlid_ida, subsys->cntlid_min, subsys->cntlid_max, @@ -1406,8 +1398,6 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn, out_free_sqs: kfree(ctrl->sqs); -out_free_cqs: - kfree(ctrl->cqs); out_free_changed_ns_list: kfree(ctrl->changed_ns_list); out_free_ctrl: @@ -1437,7 +1427,6 @@ static void nvmet_ctrl_free(struct kref *ref) nvmet_async_events_free(ctrl); kfree(ctrl->sqs); - kfree(ctrl->cqs); kfree(ctrl->changed_ns_list); kfree(ctrl); diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index bc91336080e0..ea96487b5424 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -164,7 +164,6 @@ static inline struct nvmet_port *ana_groups_to_port( struct nvmet_ctrl { struct nvmet_subsys *subsys; - struct nvmet_cq **cqs; struct nvmet_sq **sqs; bool cmd_seen; -- 2.30.2