Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: hide names_cache behind runtime const machinery

s/names_cachep/names_cache/ for consistency with dentry cache.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Mateusz Guzik and committed by
Al Viro
7ca83f8e 8c888b31

+12 -7
+10 -6
fs/namei.c
··· 41 41 #include <linux/init_task.h> 42 42 #include <linux/uaccess.h> 43 43 44 + #include <asm/runtime-const.h> 45 + 44 46 #include "internal.h" 45 47 #include "mount.h" 46 48 ··· 126 124 */ 127 125 128 126 /* SLAB cache for struct filename instances */ 129 - static struct kmem_cache *names_cachep __ro_after_init; 127 + static struct kmem_cache *__names_cache __ro_after_init; 128 + #define names_cache runtime_const_ptr(__names_cache) 130 129 131 130 void __init filename_init(void) 132 131 { 133 - names_cachep = kmem_cache_create_usercopy("names_cache", sizeof(struct filename), 0, 134 - SLAB_HWCACHE_ALIGN|SLAB_PANIC, offsetof(struct filename, iname), 135 - EMBEDDED_NAME_MAX, NULL); 132 + __names_cache = kmem_cache_create_usercopy("names_cache", sizeof(struct filename), 0, 133 + SLAB_HWCACHE_ALIGN|SLAB_PANIC, offsetof(struct filename, iname), 134 + EMBEDDED_NAME_MAX, NULL); 135 + runtime_const_init(ptr, __names_cache); 136 136 } 137 137 138 138 static inline struct filename *alloc_filename(void) 139 139 { 140 - return kmem_cache_alloc(names_cachep, GFP_KERNEL); 140 + return kmem_cache_alloc(names_cache, GFP_KERNEL); 141 141 } 142 142 143 143 static inline void free_filename(struct filename *p) 144 144 { 145 - kmem_cache_free(names_cachep, p); 145 + kmem_cache_free(names_cache, p); 146 146 } 147 147 148 148 static inline void initname(struct filename *name)
+2 -1
include/asm-generic/vmlinux.lds.h
··· 972 972 #define RUNTIME_CONST_VARIABLES \ 973 973 RUNTIME_CONST(shift, d_hash_shift) \ 974 974 RUNTIME_CONST(ptr, dentry_hashtable) \ 975 - RUNTIME_CONST(ptr, __dentry_cache) 975 + RUNTIME_CONST(ptr, __dentry_cache) \ 976 + RUNTIME_CONST(ptr, __names_cache) 976 977 977 978 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */ 978 979 #define KUNIT_TABLE() \