]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sysctl: Add register_sysctl for normal sysctl users
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 21 Jan 2012 05:47:03 +0000 (21:47 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 25 Jan 2012 00:40:30 +0000 (16:40 -0800)
The plan is to convert all callers of register_sysctl_table
and register_sysctl_paths to register_sysctl.  The interface
to register_sysctl is enough nicer this should make the callers
a bit more readable.  Additionally after the conversion the
230 lines of backwards compatibility can be removed.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
fs/proc/proc_sysctl.c
include/linux/sysctl.h

index 05c393a5c5302a1d64cf6a04f5edb955bc3c66cf..8dc7f0e46e7e56ee07e6993f1901f776f348bd92 100644 (file)
@@ -1228,6 +1228,23 @@ struct ctl_table_header *__register_sysctl_table(
        return NULL;
 }
 
+/**
+ * register_sysctl - register a sysctl table
+ * @path: The path to the directory the sysctl table is in.
+ * @table: the table structure
+ *
+ * Register a sysctl table. @table should be a filled in ctl_table
+ * array. A completely 0 filled entry terminates the table.
+ *
+ * See __register_sysctl_table for more details.
+ */
+struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table)
+{
+       return __register_sysctl_table(&sysctl_table_root.default_set,
+                                       path, table);
+}
+EXPORT_SYMBOL(register_sysctl);
+
 static char *append_path(const char *path, char *pos, const char *name)
 {
        int namelen;
index 35c50ed36fc98fe6c108922d5f2b436046ad4726..c34b4c82b0dcd6f60937cf6507da1b9988fd9d6f 100644 (file)
@@ -1090,6 +1090,7 @@ struct ctl_table_header *__register_sysctl_table(
 struct ctl_table_header *__register_sysctl_paths(
        struct ctl_table_set *set,
        const struct ctl_path *path, struct ctl_table *table);
+struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table);
 struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
 struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
                                                struct ctl_table *table);