Skip to content

Commit c09b981

Browse files
committed
panic: Move panic ctl tables into panic.c
Move panic, panic_on_oops, panic_print, panic_on_warn into kerne/panic.c. This is part of a greater effort to move ctl tables into their respective subsystems which will reduce the merge conflicts in kernel/sysctl.c. Signed-off-by: Joel Granados <joel.granados@kernel.org>
1 parent 0af2f6b commit c09b981

2 files changed

Lines changed: 30 additions & 31 deletions

File tree

kernel/panic.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,36 @@ static const struct ctl_table kern_panic_table[] = {
9696
.extra2 = SYSCTL_ONE,
9797
},
9898
#endif
99+
{
100+
.procname = "panic",
101+
.data = &panic_timeout,
102+
.maxlen = sizeof(int),
103+
.mode = 0644,
104+
.proc_handler = proc_dointvec,
105+
},
106+
{
107+
.procname = "panic_on_oops",
108+
.data = &panic_on_oops,
109+
.maxlen = sizeof(int),
110+
.mode = 0644,
111+
.proc_handler = proc_dointvec,
112+
},
113+
{
114+
.procname = "panic_print",
115+
.data = &panic_print,
116+
.maxlen = sizeof(unsigned long),
117+
.mode = 0644,
118+
.proc_handler = proc_doulongvec_minmax,
119+
},
120+
{
121+
.procname = "panic_on_warn",
122+
.data = &panic_on_warn,
123+
.maxlen = sizeof(int),
124+
.mode = 0644,
125+
.proc_handler = proc_dointvec_minmax,
126+
.extra1 = SYSCTL_ZERO,
127+
.extra2 = SYSCTL_ONE,
128+
},
99129
{
100130
.procname = "warn_limit",
101131
.data = &warn_limit,

kernel/sysctl.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <linux/sysctl.h>
2424
#include <linux/bitmap.h>
2525
#include <linux/signal.h>
26-
#include <linux/panic.h>
2726
#include <linux/printk.h>
2827
#include <linux/proc_fs.h>
2928
#include <linux/security.h>
@@ -1588,13 +1587,6 @@ int proc_do_static_key(const struct ctl_table *table, int write,
15881587
}
15891588

15901589
static const struct ctl_table kern_table[] = {
1591-
{
1592-
.procname = "panic",
1593-
.data = &panic_timeout,
1594-
.maxlen = sizeof(int),
1595-
.mode = 0644,
1596-
.proc_handler = proc_dointvec,
1597-
},
15981590
#ifdef CONFIG_PROC_SYSCTL
15991591
{
16001592
.procname = "tainted",
@@ -1772,20 +1764,6 @@ static const struct ctl_table kern_table[] = {
17721764
.extra1 = SYSCTL_ZERO,
17731765
.extra2 = SYSCTL_MAXOLDUID,
17741766
},
1775-
{
1776-
.procname = "panic_on_oops",
1777-
.data = &panic_on_oops,
1778-
.maxlen = sizeof(int),
1779-
.mode = 0644,
1780-
.proc_handler = proc_dointvec,
1781-
},
1782-
{
1783-
.procname = "panic_print",
1784-
.data = &panic_print,
1785-
.maxlen = sizeof(unsigned long),
1786-
.mode = 0644,
1787-
.proc_handler = proc_doulongvec_minmax,
1788-
},
17891767
{
17901768
.procname = "ngroups_max",
17911769
.data = (void *)&ngroups_max,
@@ -1837,15 +1815,6 @@ static const struct ctl_table kern_table[] = {
18371815
.proc_handler = proc_dointvec,
18381816
},
18391817
#endif
1840-
{
1841-
.procname = "panic_on_warn",
1842-
.data = &panic_on_warn,
1843-
.maxlen = sizeof(int),
1844-
.mode = 0644,
1845-
.proc_handler = proc_dointvec_minmax,
1846-
.extra1 = SYSCTL_ZERO,
1847-
.extra2 = SYSCTL_ONE,
1848-
},
18491818
#ifdef CONFIG_TREE_RCU
18501819
{
18511820
.procname = "panic_on_rcu_stall",

0 commit comments

Comments
 (0)