[PATCH v2 7/9] make seq_file_cache statically allocated
From: Al Viro
Date: Thu Jun 11 2026 - 13:20:29 EST
Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
fs/seq_file.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 4745db2a34d1..7cb40ae83f9b 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -20,11 +20,13 @@
#include <linux/printk.h>
#include <linux/string_helpers.h>
#include <linux/uio.h>
+#include <linux/slab-static.h>
#include <linux/uaccess.h>
#include <asm/page.h>
-static struct kmem_cache *seq_file_cache __ro_after_init;
+static struct kmem_cache_opaque __seq_file_cache;
+#define seq_file_cache to_kmem_cache(&__seq_file_cache)
static void seq_set_overflow(struct seq_file *m)
{
@@ -1140,5 +1142,5 @@ EXPORT_SYMBOL(seq_hlist_next_percpu);
void __init seq_file_init(void)
{
- seq_file_cache = KMEM_CACHE(seq_file, SLAB_ACCOUNT|SLAB_PANIC);
+ KMEM_CACHE_SETUP(seq_file_cache, seq_file, SLAB_ACCOUNT|SLAB_PANIC);
}
--
2.47.3