From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:41572 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbeBXSVl (ORCPT ); Sat, 24 Feb 2018 13:21:41 -0500 Received: by mail-wr0-f194.google.com with SMTP id f14so17164230wre.8 for ; Sat, 24 Feb 2018 10:21:41 -0800 (PST) Date: Sat, 24 Feb 2018 21:21:38 +0300 From: Alexey Dobriyan To: steffen.klassert@secunet.com Cc: herbert@gondor.apana.org.au, davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH] xfrm: mark kmem_caches as __ro_after_init Message-ID: <20180224182138.GB18400@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-ID: Kmem caches aren't relocated once set up. Signed-off-by: Alexey Dobriyan --- net/xfrm/xfrm_input.c | 3 ++- net/xfrm/xfrm_policy.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -9,6 +9,7 @@ */ #include +#include #include #include #include @@ -31,7 +32,7 @@ struct xfrm_trans_cb { #define XFRM_TRANS_SKB_CB(__skb) ((struct xfrm_trans_cb *)&((__skb)->cb[0])) -static struct kmem_cache *secpath_cachep __read_mostly; +static struct kmem_cache *secpath_cachep __ro_after_init; static DEFINE_SPINLOCK(xfrm_input_afinfo_lock); static struct xfrm_input_afinfo const __rcu *xfrm_input_afinfo[AF_INET6 + 1]; --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -51,7 +51,7 @@ static DEFINE_SPINLOCK(xfrm_policy_afinfo_lock); static struct xfrm_policy_afinfo const __rcu *xfrm_policy_afinfo[AF_INET6 + 1] __read_mostly; -static struct kmem_cache *xfrm_dst_cache __read_mostly; +static struct kmem_cache *xfrm_dst_cache __ro_after_init; static __read_mostly seqcount_t xfrm_policy_hash_generation; static void xfrm_init_pmtu(struct xfrm_dst **bundle, int nr);