aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 6b005e4912b5..5abfa1518554 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -44,6 +44,7 @@
44#include <linux/times.h> 44#include <linux/times.h>
45#include <linux/limits.h> 45#include <linux/limits.h>
46#include <linux/dcache.h> 46#include <linux/dcache.h>
47#include <linux/dnotify.h>
47#include <linux/syscalls.h> 48#include <linux/syscalls.h>
48#include <linux/vmstat.h> 49#include <linux/vmstat.h>
49#include <linux/nfs_fs.h> 50#include <linux/nfs_fs.h>
@@ -131,6 +132,9 @@ static int min_percpu_pagelist_fract = 8;
131 132
132static int ngroups_max = NGROUPS_MAX; 133static int ngroups_max = NGROUPS_MAX;
133 134
135#ifdef CONFIG_INOTIFY_USER
136#include <linux/inotify.h>
137#endif
134#ifdef CONFIG_SPARC 138#ifdef CONFIG_SPARC
135#include <asm/system.h> 139#include <asm/system.h>
136#endif 140#endif
@@ -157,8 +161,6 @@ extern int no_unaligned_warning;
157extern int unaligned_dump_stack; 161extern int unaligned_dump_stack;
158#endif 162#endif
159 163
160extern struct ratelimit_state printk_ratelimit_state;
161
162#ifdef CONFIG_PROC_SYSCTL 164#ifdef CONFIG_PROC_SYSCTL
163static int proc_do_cad_pid(struct ctl_table *table, int write, 165static int proc_do_cad_pid(struct ctl_table *table, int write,
164 void __user *buffer, size_t *lenp, loff_t *ppos); 166 void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -207,9 +209,6 @@ static struct ctl_table fs_table[];
207static struct ctl_table debug_table[]; 209static struct ctl_table debug_table[];
208static struct ctl_table dev_table[]; 210static struct ctl_table dev_table[];
209extern struct ctl_table random_table[]; 211extern struct ctl_table random_table[];
210#ifdef CONFIG_INOTIFY_USER
211extern struct ctl_table inotify_table[];
212#endif
213#ifdef CONFIG_EPOLL 212#ifdef CONFIG_EPOLL
214extern struct ctl_table epoll_table[]; 213extern struct ctl_table epoll_table[];
215#endif 214#endif
@@ -703,6 +702,15 @@ static struct ctl_table kern_table[] = {
703 .extra1 = &zero, 702 .extra1 = &zero,
704 .extra2 = &ten_thousand, 703 .extra2 = &ten_thousand,
705 }, 704 },
705 {
706 .procname = "dmesg_restrict",
707 .data = &dmesg_restrict,
708 .maxlen = sizeof(int),
709 .mode = 0644,
710 .proc_handler = proc_dointvec_minmax,
711 .extra1 = &zero,
712 .extra2 = &one,
713 },
706#endif 714#endif
707 { 715 {
708 .procname = "ngroups_max", 716 .procname = "ngroups_max",
@@ -1339,28 +1347,28 @@ static struct ctl_table fs_table[] = {
1339 .data = &inodes_stat, 1347 .data = &inodes_stat,
1340 .maxlen = 2*sizeof(int), 1348 .maxlen = 2*sizeof(int),
1341 .mode = 0444, 1349 .mode = 0444,
1342 .proc_handler = proc_dointvec, 1350 .proc_handler = proc_nr_inodes,
1343 }, 1351 },
1344 { 1352 {
1345 .procname = "inode-state", 1353 .procname = "inode-state",
1346 .data = &inodes_stat, 1354 .data = &inodes_stat,
1347 .maxlen = 7*sizeof(int), 1355 .maxlen = 7*sizeof(int),
1348 .mode = 0444, 1356 .mode = 0444,
1349 .proc_handler = proc_dointvec, 1357 .proc_handler = proc_nr_inodes,
1350 }, 1358 },
1351 { 1359 {
1352 .procname = "file-nr", 1360 .procname = "file-nr",
1353 .data = &files_stat, 1361 .data = &files_stat,
1354 .maxlen = 3*sizeof(int), 1362 .maxlen = sizeof(files_stat),
1355 .mode = 0444, 1363 .mode = 0444,
1356 .proc_handler = proc_nr_files, 1364 .proc_handler = proc_nr_files,
1357 }, 1365 },
1358 { 1366 {
1359 .procname = "file-max", 1367 .procname = "file-max",
1360 .data = &files_stat.max_files, 1368 .data = &files_stat.max_files,
1361 .maxlen = sizeof(int), 1369 .maxlen = sizeof(files_stat.max_files),
1362 .mode = 0644, 1370 .mode = 0644,
1363 .proc_handler = proc_dointvec, 1371 .proc_handler = proc_doulongvec_minmax,
1364 }, 1372 },
1365 { 1373 {
1366 .procname = "nr_open", 1374 .procname = "nr_open",
@@ -1376,7 +1384,7 @@ static struct ctl_table fs_table[] = {
1376 .data = &dentry_stat, 1384 .data = &dentry_stat,
1377 .maxlen = 6*sizeof(int), 1385 .maxlen = 6*sizeof(int),
1378 .mode = 0444, 1386 .mode = 0444,
1379 .proc_handler = proc_dointvec, 1387 .proc_handler = proc_nr_dentry,
1380 }, 1388 },
1381 { 1389 {
1382 .procname = "overflowuid", 1390 .procname = "overflowuid",
@@ -1712,10 +1720,7 @@ static __init int sysctl_init(void)
1712{ 1720{
1713 sysctl_set_parent(NULL, root_table); 1721 sysctl_set_parent(NULL, root_table);
1714#ifdef CONFIG_SYSCTL_SYSCALL_CHECK 1722#ifdef CONFIG_SYSCTL_SYSCALL_CHECK
1715 { 1723 sysctl_check_table(current->nsproxy, root_table);
1716 int err;
1717 err = sysctl_check_table(current->nsproxy, root_table);
1718 }
1719#endif 1724#endif
1720 return 0; 1725 return 0;
1721} 1726}
@@ -2487,7 +2492,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
2487 kbuf[left] = 0; 2492 kbuf[left] = 0;
2488 } 2493 }
2489 2494
2490 for (; left && vleft--; i++, min++, max++, first=0) { 2495 for (; left && vleft--; i++, first = 0) {
2491 unsigned long val; 2496 unsigned long val;
2492 2497
2493 if (write) { 2498 if (write) {