]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/sysctl_check.c
time: fold __get_realtime_clock_ts() into getnstimeofday()
[linux-2.6-omap-h63xx.git] / kernel / sysctl_check.c
index bed939f82c31577aadb15ef84714f0869942d34f..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>
@@ -428,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" },
@@ -446,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" },
@@ -1338,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;
@@ -1346,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:
@@ -1392,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) ||
@@ -1423,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");
 }
@@ -1451,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++) {
@@ -1481,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) ||
@@ -1530,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) {
@@ -1538,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;
 }