From patchwork Tue Mar 26 07:29:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13603631 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3C3F1272A8; Tue, 26 Mar 2024 07:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711437793; cv=none; b=bFHxPAn3ZB3xvDuzXj8JZRILLTyRREnGkrddhB9uUCyvyrnctSHHLmHcE4jAkEftywzNgPTeoFQh3Zkmb64n2i9CmIWzcexvGxAz7yIegam9a/m/7qUv7L7JnWlc8iKJKLHXFZNJ8sBB7ufm+uE0nARyoknZqg79B7dShji9eT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711437793; c=relaxed/simple; bh=gVdqo+muMxJNWsSySfdIfRgy5LgJ/5g5dMiae7rkDRM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=f2u8Q3DDU9LEbF0zWywyantk89cFfdxkdiMBh9c5gEBrENy2dK5pQ6ojQgp6r1c7QvHcQvQzEOhSfh5OKxPKe5zzN8/nhWTONYHqXYf7pb2QoPThy18+ZfI//gWTYpxkfyjRssuWt1bqGnUF/Cdscl15IZf176iS9+jrVfn4ddI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4V3h855hKhz1wnGj; Tue, 26 Mar 2024 15:22:13 +0800 (CST) Received: from dggpeml500026.china.huawei.com (unknown [7.185.36.106]) by mail.maildlp.com (Postfix) with ESMTPS id 9A792140120; Tue, 26 Mar 2024 15:23:02 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 26 Mar 2024 15:23:01 +0800 From: Zhengchao Shao To: , , , , , CC: , , , , , , , Subject: [PATCH net-next,RESEND] net/smc: make smc_hash_sk/smc_unhash_sk static Date: Tue, 26 Mar 2024 15:29:52 +0800 Message-ID: <20240326072952.2717904-1-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500026.china.huawei.com (7.185.36.106) X-Patchwork-Delegate: kuba@kernel.org smc_hash_sk and smc_unhash_sk are only used in af_smc.c, so make them static and remove the output symbol. They can be called under the path .prot->hash()/unhash(). Signed-off-by: Zhengchao Shao Reviewed-by: Wen Gu Reviewed-by: Simon Horman --- include/net/smc.h | 3 --- net/smc/af_smc.c | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/net/smc.h b/include/net/smc.h index c9dcb30e3fd9..10684d0a33df 100644 --- a/include/net/smc.h +++ b/include/net/smc.h @@ -26,9 +26,6 @@ struct smc_hashinfo { struct hlist_head ht; }; -int smc_hash_sk(struct sock *sk); -void smc_unhash_sk(struct sock *sk); - /* SMCD/ISM device driver interface */ struct smcd_dmb { u64 dmb_tok; diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 4b52b3b159c0..e8dcd28a554c 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -177,7 +177,7 @@ static struct smc_hashinfo smc_v6_hashinfo = { .lock = __RW_LOCK_UNLOCKED(smc_v6_hashinfo.lock), }; -int smc_hash_sk(struct sock *sk) +static int smc_hash_sk(struct sock *sk) { struct smc_hashinfo *h = sk->sk_prot->h.smc_hash; struct hlist_head *head; @@ -191,9 +191,8 @@ int smc_hash_sk(struct sock *sk) return 0; } -EXPORT_SYMBOL_GPL(smc_hash_sk); -void smc_unhash_sk(struct sock *sk) +static void smc_unhash_sk(struct sock *sk) { struct smc_hashinfo *h = sk->sk_prot->h.smc_hash; @@ -202,7 +201,6 @@ void smc_unhash_sk(struct sock *sk) sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); write_unlock_bh(&h->lock); } -EXPORT_SYMBOL_GPL(smc_unhash_sk); /* This will be called before user really release sock_lock. So do the * work which we didn't do because of user hold the sock_lock in the