]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - kernel/sysctl.c
[PATCH] more kernel-doc cleanups, additions
[linux-3.10.git] / kernel / sysctl.c
index 24a4d12d5aa9b40bc8e2ea57dde06f1075e70135..c4f35f96884df814c665d0287eba465033d9eabe 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/net.h>
 #include <linux/sysrq.h>
 #include <linux/highuid.h>
 #include <linux/writeback.h>
@@ -114,6 +115,7 @@ extern int unaligned_enabled;
 extern int sysctl_ieee_emulation_warnings;
 #endif
 extern int sysctl_userprocess_debug;
+extern int spin_retry;
 #endif
 
 extern int sysctl_hz_timer;
@@ -135,9 +137,6 @@ static struct ctl_table_header root_table_header =
 
 static ctl_table kern_table[];
 static ctl_table vm_table[];
-#ifdef CONFIG_NET
-extern ctl_table net_table[];
-#endif
 static ctl_table proc_table[];
 static ctl_table fs_table[];
 static ctl_table debug_table[];
@@ -146,6 +145,9 @@ extern ctl_table random_table[];
 #ifdef CONFIG_UNIX98_PTYS
 extern ctl_table pty_table[];
 #endif
+#ifdef CONFIG_INOTIFY
+extern ctl_table inotify_table[];
+#endif
 
 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
 int sysctl_legacy_va_layout;
@@ -218,6 +220,7 @@ static ctl_table root_table[] = {
                .mode           = 0555,
                .child          = dev_table,
        },
+
        { .ctl_name = 0 }
 };
 
@@ -643,7 +646,16 @@ static ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-
+#if defined(CONFIG_ARCH_S390)
+       {
+               .ctl_name       = KERN_SPIN_RETRY,
+               .procname       = "spin_retry",
+               .data           = &spin_retry,
+               .maxlen         = sizeof (int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
+#endif
        { .ctl_name = 0 }
 };
 
@@ -940,7 +952,7 @@ static ctl_table fs_table[] = {
                .data           = &aio_nr,
                .maxlen         = sizeof(aio_nr),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &proc_doulongvec_minmax,
        },
        {
                .ctl_name       = FS_AIO_MAX_NR,
@@ -948,8 +960,16 @@ static ctl_table fs_table[] = {
                .data           = &aio_max_nr,
                .maxlen         = sizeof(aio_max_nr),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &proc_doulongvec_minmax,
        },
+#ifdef CONFIG_INOTIFY
+       {
+               .ctl_name       = FS_INOTIFY,
+               .procname       = "inotify",
+               .mode           = 0555,
+               .child          = inotify_table,
+       },
+#endif 
 #endif
        {
                .ctl_name       = KERN_SETUID_DUMPABLE,
@@ -968,7 +988,7 @@ static ctl_table debug_table[] = {
 
 static ctl_table dev_table[] = {
        { .ctl_name = 0 }
-};  
+};
 
 extern void init_irq_proc (void);
 
@@ -1000,8 +1020,7 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol
                int error = parse_table(name, nlen, oldval, oldlenp, 
                                        newval, newlen, head->ctl_table,
                                        &context);
-               if (context)
-                       kfree(context);
+               kfree(context);
                if (error != -ENOTDIR)
                        return error;
                tmp = tmp->next;
@@ -1978,6 +1997,7 @@ int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
  * @filp: the file structure
  * @buffer: the user buffer
  * @lenp: the size of the user buffer
+ * @ppos: pointer to the file position
  *
  * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
  * values from/to the user buffer, treated as an ASCII string.