fs: hide dentry_cache behind runtime const machinery
Subsystems (2)
PATCH 1/1 fs: hide dentry_cache behind runtime const machinery
Signed-off-by Mateusz Guzik <[email protected]>
--- fs/dcache.c | 6 ++++-- include/asm-generic/vmlinux.lds.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-)
fs/dcache.c +4 -2
@@ -86,7 +86,8 @@ __cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);EXPORT_SYMBOL (rename_lock); -static struct kmem_cache *dentry_cache__ro_after_init ; +static struct kmem_cache *__dentry_cache__ro_after_init ; +#define dentry_cache runtime_const_ptr(__dentry_cache)const struct qstr empty_name =QSTR_INIT ("" ,0 );EXPORT_SYMBOL (empty_name);
@@ -3216,9 +3217,10 @@ static void __init dcache_init(void)* but it is probably not worth it because of the cache nature * of the dcache. */ - dentry_cache =KMEM_CACHE_USERCOPY (dentry, + __dentry_cache =KMEM_CACHE_USERCOPY (dentry,SLAB_RECLAIM_ACCOUNT |SLAB_PANIC |SLAB_ACCOUNT , d_shortname.string); +runtime_const_init (ptr, __dentry_cache);/* Hash may have been set up in dcache_init_early */ if (!hashdist)
include/asm-generic/vmlinux.lds.h +2 -1
@@ -955,7 +955,8 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)#define RUNTIME_CONST_VARIABLES \ RUNTIME_CONST(shift, d_hash_shift) \ - RUNTIME_CONST(ptr, dentry_hashtable) + RUNTIME_CONST(ptr, dentry_hashtable) \ + RUNTIME_CONST(ptr, __dentry_cache)/* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */ #define KUNIT_TABLE () \
Signature · 1 line
2.48.1
Quoted 1 line · Mateusz Guzik
Applied to the vfs-6.19.misc branch of the vfs/vfs.git tree. Patches in the vfs-6.19.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-6.19.misc
[1/1] fs: hide dentry_cache behind runtime const machinery
https://git.kernel.org/vfs/vfs/c/15e78f24ccf0