]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/sysctl_check.c
x86: fix: s2ram + P4 + tsc = annoyance
[linux-2.6-omap-h63xx.git] / kernel / sysctl_check.c
index 5a2f2b2bf888de50e6ee3780d9a2b4cd991ee52a..c3206fa50048b8333be64be54a3a52acf8d39bcb 100644 (file)
@@ -1,6 +1,5 @@
 #include <linux/stat.h>
 #include <linux/sysctl.h>
-#include "../arch/s390/appldata/appldata.h"
 #include "../fs/xfs/linux-2.6/xfs_sysctl.h"
 #include <linux/sunrpc/debug.h>
 #include <linux/string.h>
@@ -96,7 +95,7 @@ static struct trans_ctl_table trans_kern_table[] = {
 
        { KERN_PTY,                     "pty",          trans_pty_table },
        { KERN_NGROUPS_MAX,             "ngroups_max" },
-       { KERN_SPARC_SCONS_PWROFF,      "scons_poweroff" },
+       { KERN_SPARC_SCONS_PWROFF,      "scons-poweroff" },
        { KERN_HZ_TIMER,                "hz_timer" },
        { KERN_UNKNOWN_NMI_PANIC,       "unknown_nmi_panic" },
        { KERN_BOOTLOADER_TYPE,         "bootloader_type" },
@@ -140,9 +139,6 @@ static struct trans_ctl_table trans_vm_table[] = {
        { VM_PANIC_ON_OOM,              "panic_on_oom" },
        { VM_VDSO_ENABLED,              "vdso_enabled" },
        { VM_MIN_SLAB,                  "min_slab_ratio" },
-       { VM_CMM_PAGES,                 "cmm_pages" },
-       { VM_CMM_TIMED_PAGES,           "cmm_timed_pages" },
-       { VM_CMM_TIMEOUT,               "cmm_timeout" },
 
        {}
 };
@@ -237,36 +233,6 @@ static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
        {}
 };
 
-
-static struct trans_ctl_table trans_net_ipv4_vs_table[] = {
-       { NET_IPV4_VS_AMEMTHRESH,       "amemthresh" },
-       { NET_IPV4_VS_DEBUG_LEVEL,      "debug_level" },
-       { NET_IPV4_VS_AMDROPRATE,       "am_droprate" },
-       { NET_IPV4_VS_DROP_ENTRY,       "drop_entry" },
-       { NET_IPV4_VS_DROP_PACKET,      "drop_packet" },
-       { NET_IPV4_VS_SECURE_TCP,       "secure_tcp" },
-       { NET_IPV4_VS_TO_ES,            "timeout_established" },
-       { NET_IPV4_VS_TO_SS,            "timeout_synsent" },
-       { NET_IPV4_VS_TO_SR,            "timeout_synrecv" },
-       { NET_IPV4_VS_TO_FW,            "timeout_finwait" },
-       { NET_IPV4_VS_TO_TW,            "timeout_timewait" },
-       { NET_IPV4_VS_TO_CL,            "timeout_close" },
-       { NET_IPV4_VS_TO_CW,            "timeout_closewait" },
-       { NET_IPV4_VS_TO_LA,            "timeout_lastack" },
-       { NET_IPV4_VS_TO_LI,            "timeout_listen" },
-       { NET_IPV4_VS_TO_SA,            "timeout_synack" },
-       { NET_IPV4_VS_TO_UDP,           "timeout_udp" },
-       { NET_IPV4_VS_TO_ICMP,          "timeout_icmp" },
-       { NET_IPV4_VS_CACHE_BYPASS,     "cache_bypass" },
-       { NET_IPV4_VS_EXPIRE_NODEST_CONN,       "expire_nodest_conn" },
-       { NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,        "expire_quiescent_template" },
-       { NET_IPV4_VS_SYNC_THRESHOLD,           "sync_threshold" },
-       { NET_IPV4_VS_NAT_ICMP_SEND,    "nat_icmp_send" },
-       { NET_IPV4_VS_LBLC_EXPIRE,              "lblc_expiration" },
-       { NET_IPV4_VS_LBLCR_EXPIRE,             "lblcr_expiration" },
-       {}
-};
-
 static struct trans_ctl_table trans_net_neigh_vars_table[] = {
        { NET_NEIGH_MCAST_SOLICIT,      "mcast_solicit" },
        { NET_NEIGH_UCAST_SOLICIT,      "ucast_solicit" },
@@ -341,7 +307,6 @@ static struct trans_ctl_table trans_net_ipv4_table[] = {
        { NET_IPV4_ROUTE,               "route",        trans_net_ipv4_route_table },
        /* NET_IPV4_FIB_HASH unused */
        { NET_IPV4_NETFILTER,           "netfilter",    trans_net_ipv4_netfilter_table },
-       { NET_IPV4_VS,                  "vs",           trans_net_ipv4_vs_table },
 
        { NET_IPV4_TCP_TIMESTAMPS,              "tcp_timestamps" },
        { NET_IPV4_TCP_WINDOW_SCALING,          "tcp_window_scaling" },
@@ -462,7 +427,7 @@ static struct trans_ctl_table trans_net_netrom_table[] = {
        {}
 };
 
-static struct trans_ctl_table trans_net_ax25_table[] = {
+static struct trans_ctl_table trans_net_ax25_param_table[] = {
        { NET_AX25_IP_DEFAULT_MODE,     "ip_default_mode" },
        { NET_AX25_DEFAULT_MODE,        "ax25_default_mode" },
        { NET_AX25_BACKOFF_TYPE,        "backoff_type" },
@@ -480,6 +445,11 @@ static struct trans_ctl_table trans_net_ax25_table[] = {
        {}
 };
 
+static struct trans_ctl_table trans_net_ax25_table[] = {
+       { 0, NULL, trans_net_ax25_param_table },
+       {}
+};
+
 static struct trans_ctl_table trans_net_bridge_table[] = {
        { NET_BRIDGE_NF_CALL_ARPTABLES,         "bridge-nf-call-arptables" },
        { NET_BRIDGE_NF_CALL_IPTABLES,          "bridge-nf-call-iptables" },
@@ -738,7 +708,7 @@ static struct trans_ctl_table trans_net_table[] = {
        { NET_ROSE,             "rose",         trans_net_rose_table },
        { NET_IPV6,             "ipv6",         trans_net_ipv6_table },
        { NET_X25,              "x25",          trans_net_x25_table },
-       { NET_TR,               "tr",           trans_net_tr_table },
+       { NET_TR,               "token-ring",   trans_net_tr_table },
        { NET_DECNET,           "decnet",       trans_net_decnet_table },
        /*  NET_ECONET not used */
        { NET_SCTP,             "sctp",         trans_net_sctp_table },
@@ -1219,16 +1189,6 @@ static struct trans_ctl_table trans_arlan_table[] = {
        {}
 };
 
-static struct trans_ctl_table trans_appldata_table[] = {
-       { CTL_APPLDATA_TIMER,           "timer" },
-       { CTL_APPLDATA_INTERVAL,        "interval" },
-       { CTL_APPLDATA_OS,              "os" },
-       { CTL_APPLDATA_NET_SUM,         "net_sum" },
-       { CTL_APPLDATA_MEM,             "mem" },
-       {}
-
-};
-
 static struct trans_ctl_table trans_s390dbf_table[] = {
        { 5678 /* CTL_S390DBF_STOPPABLE */,     "debug_stoppable" },
        { 5679 /* CTL_S390DBF_ACTIVE */,        "debug_active" },
@@ -1273,7 +1233,6 @@ static struct trans_ctl_table trans_root_table[] = {
        { CTL_ABI,      "abi" },
        /* CTL_CPU not used */
        { CTL_ARLAN,    "arlan",        trans_arlan_table },
-       { CTL_APPLDATA, "appldata",     trans_appldata_table },
        { CTL_S390DBF,  "s390dbf",      trans_s390dbf_table },
        { CTL_SUNRPC,   "sunrpc",       trans_sunrpc_table },
        { CTL_PM,       "pm",           trans_pm_table },
@@ -1383,7 +1342,8 @@ static void sysctl_repair_table(struct ctl_table *table)
        }
 }
 
-static struct ctl_table *sysctl_check_lookup(struct ctl_table *table)
+static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces,
+                                               struct ctl_table *table)
 {
        struct ctl_table_header *head;
        struct ctl_table *ref, *test;
@@ -1391,8 +1351,8 @@ static struct ctl_table *sysctl_check_lookup(struct ctl_table *table)
 
        depth = sysctl_depth(table);
 
-       for (head = sysctl_head_next(NULL); head;
-            head = sysctl_head_next(head)) {
+       for (head = __sysctl_head_next(namespaces, NULL); head;
+            head = __sysctl_head_next(namespaces, head)) {
                cur_depth = depth;
                ref = head->ctl_table;
 repeat:
@@ -1437,13 +1397,14 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str
        *fail = str;
 }
 
-static int sysctl_check_dir(struct ctl_table *table)
+static int sysctl_check_dir(struct nsproxy *namespaces,
+                               struct ctl_table *table)
 {
        struct ctl_table *ref;
        int error;
 
        error = 0;
-       ref = sysctl_check_lookup(table);
+       ref = sysctl_check_lookup(namespaces, table);
        if (ref) {
                int match = 0;
                if ((!table->procname && !ref->procname) ||
@@ -1468,11 +1429,12 @@ static int sysctl_check_dir(struct ctl_table *table)
        return error;
 }
 
-static void sysctl_check_leaf(struct ctl_table *table, const char **fail)
+static void sysctl_check_leaf(struct nsproxy *namespaces,
+                               struct ctl_table *table, const char **fail)
 {
        struct ctl_table *ref;
 
-       ref = sysctl_check_lookup(table);
+       ref = sysctl_check_lookup(namespaces, table);
        if (ref && (ref != table))
                set_fail(fail, table, "Sysctl already exists");
 }
@@ -1496,7 +1458,7 @@ static void sysctl_check_bin_path(struct ctl_table *table, const char **fail)
        }
 }
 
-int sysctl_check_table(struct ctl_table *table)
+int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
 {
        int error = 0;
        for (; table->ctl_name || table->procname; table++) {
@@ -1526,7 +1488,7 @@ int sysctl_check_table(struct ctl_table *table)
                                set_fail(&fail, table, "Directory with extra1");
                        if (table->extra2)
                                set_fail(&fail, table, "Directory with extra2");
-                       if (sysctl_check_dir(table))
+                       if (sysctl_check_dir(namespaces, table))
                                set_fail(&fail, table, "Inconsistent directory names");
                } else {
                        if ((table->strategy == sysctl_data) ||
@@ -1575,7 +1537,7 @@ int sysctl_check_table(struct ctl_table *table)
                        if (!table->procname && table->proc_handler)
                                set_fail(&fail, table, "proc_handler without procname");
 #endif
-                       sysctl_check_leaf(table, &fail);
+                       sysctl_check_leaf(namespaces, table, &fail);
                }
                sysctl_check_bin_path(table, &fail);
                if (fail) {
@@ -1583,7 +1545,7 @@ int sysctl_check_table(struct ctl_table *table)
                        error = -EINVAL;
                }
                if (table->child)
-                       error |= sysctl_check_table(table->child);
+                       error |= sysctl_check_table(namespaces, table->child);
        }
        return error;
 }