add __ro_after_init to slab_nomerge and slab_state

This was extracted from the PaX patch where it's part of the KERNEXEC
feature as __read_only.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
This commit is contained in:
Daniel Micay 2017-05-03 11:35:35 -04:00 committed by Kreciorek
parent 2080fd3f3a
commit a96370e583

View file

@ -33,7 +33,7 @@
#include "slab.h" #include "slab.h"
enum slab_state slab_state; enum slab_state slab_state __ro_after_init;
LIST_HEAD(slab_caches); LIST_HEAD(slab_caches);
DEFINE_MUTEX(slab_mutex); DEFINE_MUTEX(slab_mutex);
struct kmem_cache *kmem_cache __ro_after_init; struct kmem_cache *kmem_cache __ro_after_init;
@ -64,7 +64,7 @@ static DECLARE_WORK(slab_caches_to_rcu_destroy_work,
/* /*
* Merge control. If this is set then no merging of slab caches will occur. * Merge control. If this is set then no merging of slab caches will occur.
*/ */
static bool slab_nomerge = !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT); static bool slab_nomerge __ro_after_init = !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT);
static int __init setup_slab_nomerge(char *str) static int __init setup_slab_nomerge(char *str)
{ {