summaryrefslogtreecommitdiff
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjguzik@gmail.com>2025-11-05 16:36:22 +0100
committerChristian Brauner <brauner@kernel.org>2025-11-12 12:19:09 +0100
commit21b561dab1406e63740ebe240c7b69f19e1bcf58 (patch)
treec1db81a019173b675e3447edf28f37b23ce0532c /fs/dcache.c
parente41c1f42919b01649ddea25b95eaa72dce2d591a (diff)
fs: hide dentry_cache behind runtime const machinery
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://patch.msgid.link/20251105153622.758836-1-mjguzik@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 035cccbc9276..5c6282b03ba2 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -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);
@@ -3222,9 +3223,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)