Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / kernel / vserver / sysctl.c
index 298c62f..d233b1f 100644 (file)
@@ -1,21 +1,20 @@
 /*
- *  linux/kernel/sysctl.c
+ *  kernel/vserver/sysctl.c
  *
  *  Virtual Context Support
  *
- *  Copyright (C) 2004  Herbert Pötzl
+ *  Copyright (C) 2004-2005  Herbert Pötzl
  *
  *  V0.01  basic structure
  *
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
-#include <linux/vserver.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/ctype.h>
 #include <linux/sysctl.h>
+#include <linux/parser.h>
 #include <linux/fs.h>
 
 #include <asm/uaccess.h>
 #define CTL_VSERVER    4242    /* unused? */
 
 enum {
-        CTL_DEBUG_SWITCH = 1,
-        CTL_DEBUG_XID,
-        CTL_DEBUG_NID,
-        CTL_DEBUG_NET,
-        CTL_DEBUG_LIMIT,
-        CTL_DEBUG_DLIM,
-        CTL_DEBUG_CVIRT,
+       CTL_DEBUG_ERROR = 0,
+       CTL_DEBUG_SWITCH = 1,
+       CTL_DEBUG_XID,
+       CTL_DEBUG_NID,
+       CTL_DEBUG_NET,
+       CTL_DEBUG_LIMIT,
+       CTL_DEBUG_CRES,
+       CTL_DEBUG_DLIM,
+       CTL_DEBUG_CVIRT,
+       CTL_DEBUG_MISC,
 };
 
 
@@ -40,8 +42,10 @@ unsigned int vx_debug_xid = 0;
 unsigned int vx_debug_nid = 0;
 unsigned int vx_debug_net = 0;
 unsigned int vx_debug_limit = 0;
+unsigned int vx_debug_cres = 0;
 unsigned int vx_debug_dlim = 0;
 unsigned int vx_debug_cvirt = 0;
+unsigned int vx_debug_misc = 0;
 
 
 static struct ctl_table_header *vserver_table_header;
@@ -52,12 +56,8 @@ void vserver_register_sysctl(void)
 {
        if (!vserver_table_header) {
                vserver_table_header = register_sysctl_table(vserver_table, 1);
-#ifdef CONFIG_PROC_FS
-//             if (vserver_table[0].de)
-//                     vserver_table[0].de->owner = THIS_MODULE;
-#endif
        }
-                       
+
 }
 
 void vserver_unregister_sysctl(void)
@@ -125,79 +125,103 @@ done:
        *ppos += *lenp;
        return 0;
 }
-       
+
 
 
 static ctl_table debug_table[] = {
-        {
-                .ctl_name       = CTL_DEBUG_SWITCH,
-                .procname       = "debug_switch",
-                .data           = &vx_debug_switch,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        {
-                .ctl_name       = CTL_DEBUG_XID,
-                .procname       = "debug_xid",
-                .data           = &vx_debug_xid,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        {
-                .ctl_name       = CTL_DEBUG_NID,
-                .procname       = "debug_nid",
-                .data           = &vx_debug_nid,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        {
-                .ctl_name       = CTL_DEBUG_NET,
-                .procname       = "debug_net",
-                .data           = &vx_debug_net,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        {
-                .ctl_name       = CTL_DEBUG_LIMIT,
-                .procname       = "debug_limit",
-                .data           = &vx_debug_limit,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        {
-                .ctl_name       = CTL_DEBUG_DLIM,
-                .procname       = "debug_dlim",
-                .data           = &vx_debug_dlim,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        {
-                .ctl_name       = CTL_DEBUG_CVIRT,
-                .procname       = "debug_cvirt",
-                .data           = &vx_debug_cvirt,
-                .maxlen         = sizeof(int),
-                .mode           = 0644,
-                .proc_handler   = &proc_dodebug
-        },
-        { .ctl_name = 0 }
+       {
+               .ctl_name       = CTL_DEBUG_SWITCH,
+               .procname       = "debug_switch",
+               .data           = &vx_debug_switch,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_XID,
+               .procname       = "debug_xid",
+               .data           = &vx_debug_xid,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_NID,
+               .procname       = "debug_nid",
+               .data           = &vx_debug_nid,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_NET,
+               .procname       = "debug_net",
+               .data           = &vx_debug_net,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_LIMIT,
+               .procname       = "debug_limit",
+               .data           = &vx_debug_limit,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_CRES,
+               .procname       = "debug_cres",
+               .data           = &vx_debug_cres,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_DLIM,
+               .procname       = "debug_dlim",
+               .data           = &vx_debug_dlim,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_CVIRT,
+               .procname       = "debug_cvirt",
+               .data           = &vx_debug_cvirt,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       {
+               .ctl_name       = CTL_DEBUG_MISC,
+               .procname       = "debug_misc",
+               .data           = &vx_debug_misc,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dodebug
+       },
+       { .ctl_name = 0 }
 };
 
 static ctl_table vserver_table[] = {
-        {
-                .ctl_name       = CTL_VSERVER,
-                .procname       = "vserver",
-                .mode           = 0555,
-                .child          = debug_table
-        },
-        { .ctl_name = 0 }
+       {
+               .ctl_name       = CTL_VSERVER,
+               .procname       = "vserver",
+               .mode           = 0555,
+               .child          = debug_table
+       },
+       { .ctl_name = 0 }
 };
 
 
+EXPORT_SYMBOL_GPL(vx_debug_switch);
+EXPORT_SYMBOL_GPL(vx_debug_xid);
+EXPORT_SYMBOL_GPL(vx_debug_nid);
+EXPORT_SYMBOL_GPL(vx_debug_net);
+EXPORT_SYMBOL_GPL(vx_debug_limit);
+EXPORT_SYMBOL_GPL(vx_debug_cres);
 EXPORT_SYMBOL_GPL(vx_debug_dlim);
+EXPORT_SYMBOL_GPL(vx_debug_cvirt);
+EXPORT_SYMBOL_GPL(vx_debug_misc);