diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2018-02-24 13:21:38 -0500 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2018-02-27 04:46:01 -0500 |
commit | f8c3d0dda4b09e05ad8781764cbe153815c1bf23 (patch) | |
tree | 29e6365cc83390b6025d101d3edd4eed2c5fa591 | |
parent | 60aa80460da115216070082b4ab686b9e37c86ef (diff) |
xfrm: mark kmem_caches as __ro_after_init
Kmem caches aren't relocated once set up.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | net/xfrm/xfrm_input.c | 3 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 1472c0857975..44fc54dc013c 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bottom_half.h> | 11 | #include <linux/bottom_half.h> |
12 | #include <linux/cache.h> | ||
12 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
13 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
@@ -31,7 +32,7 @@ struct xfrm_trans_cb { | |||
31 | 32 | ||
32 | #define XFRM_TRANS_SKB_CB(__skb) ((struct xfrm_trans_cb *)&((__skb)->cb[0])) | 33 | #define XFRM_TRANS_SKB_CB(__skb) ((struct xfrm_trans_cb *)&((__skb)->cb[0])) |
33 | 34 | ||
34 | static struct kmem_cache *secpath_cachep __read_mostly; | 35 | static struct kmem_cache *secpath_cachep __ro_after_init; |
35 | 36 | ||
36 | static DEFINE_SPINLOCK(xfrm_input_afinfo_lock); | 37 | static DEFINE_SPINLOCK(xfrm_input_afinfo_lock); |
37 | static struct xfrm_input_afinfo const __rcu *xfrm_input_afinfo[AF_INET6 + 1]; | 38 | static struct xfrm_input_afinfo const __rcu *xfrm_input_afinfo[AF_INET6 + 1]; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 7a23078132cf..12bd415d349e 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -51,7 +51,7 @@ static DEFINE_SPINLOCK(xfrm_policy_afinfo_lock); | |||
51 | static struct xfrm_policy_afinfo const __rcu *xfrm_policy_afinfo[AF_INET6 + 1] | 51 | static struct xfrm_policy_afinfo const __rcu *xfrm_policy_afinfo[AF_INET6 + 1] |
52 | __read_mostly; | 52 | __read_mostly; |
53 | 53 | ||
54 | static struct kmem_cache *xfrm_dst_cache __read_mostly; | 54 | static struct kmem_cache *xfrm_dst_cache __ro_after_init; |
55 | static __read_mostly seqcount_t xfrm_policy_hash_generation; | 55 | static __read_mostly seqcount_t xfrm_policy_hash_generation; |
56 | 56 | ||
57 | static void xfrm_init_pmtu(struct xfrm_dst **bundle, int nr); | 57 | static void xfrm_init_pmtu(struct xfrm_dst **bundle, int nr); |