xfrm: mark kmem_caches as __ro_after_init
Subsystems (3)
PATCH 1/1 xfrm: mark kmem_caches as __ro_after_init
Kmem caches aren't relocated once set up.
Signed-off-by Alexey Dobriyan <[email protected]>
---
net/xfrm/xfrm_input.c | 3 ++- net/xfrm/xfrm_policy.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
net/xfrm/xfrm_input.c +2 -1
@@ -9,6 +9,7 @@*/ #include <linux/bottom_half.h> +#include <linux/cache.h> #include <linux/interrupt.h> #include <linux/slab.h> #include <linux/module.h>
@@ -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 ];
net/xfrm/xfrm_policy.c +1 -1
@@ -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);
Quoted 3 lines · Alexey Dobriyan
Kmem caches aren't relocated once set up.
Signed-off-by Alexey Dobriyan <[email protected]>
Applied to ipsec-next, thanks a lot!