summaryrefslogtreecommitdiffstats
path: root/kernel/kexec_core.c
diff options
context:
space:
mode:
authoryingelin <yingelin@huawei.com>2022-04-24 10:57:40 +0800
committerLuis Chamberlain <mcgrof@kernel.org>2022-04-25 14:01:11 -0700
commita467257ffe4bdb13eacddec0137013f6a1140b81 (patch)
treefec7a62a5feb3262dd99dbc5c8fbf65198e784be /kernel/kexec_core.c
parentacd0b04ecc795e97b7878dccc5cb4d3d627a4c27 (diff)
downloadlinux-a467257ffe4bdb13eacddec0137013f6a1140b81.tar.gz
linux-a467257ffe4bdb13eacddec0137013f6a1140b81.tar.bz2
linux-a467257ffe4bdb13eacddec0137013f6a1140b81.zip
kernel/kexec_core: move kexec_core sysctls into its own file
This move the kernel/kexec_core.c respective sysctls to its own file. kernel/sysctl.c has grown to an insane mess, We move sysctls to places where features actually belong to improve the readability and reduce merge conflicts. At the same time, the proc-sysctl maintainers can easily care about the core logic other than the sysctl knobs added for some feature. We already moved all filesystem sysctls out. This patch is part of the effort to move kexec related sysctls out. Signed-off-by: yingelin <yingelin@huawei.com> Acked-by: Baoquan He <bhe@redhat.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/kexec_core.c')
-rw-r--r--kernel/kexec_core.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 68480f731192..a0456baf52cc 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -936,6 +936,28 @@ int kimage_load_segment(struct kimage *image,
struct kimage *kexec_image;
struct kimage *kexec_crash_image;
int kexec_load_disabled;
+#ifdef CONFIG_SYSCTL
+static struct ctl_table kexec_core_sysctls[] = {
+ {
+ .procname = "kexec_load_disabled",
+ .data = &kexec_load_disabled,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ /* only handle a transition from default "0" to "1" */
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = SYSCTL_ONE,
+ .extra2 = SYSCTL_ONE,
+ },
+ { }
+};
+
+static int __init kexec_core_sysctl_init(void)
+{
+ register_sysctl_init("kernel", kexec_core_sysctls);
+ return 0;
+}
+late_initcall(kexec_core_sysctl_init);
+#endif
/*
* No panic_cpu check version of crash_kexec(). This function is called