]> Pileus Git - ~andy/linux/blobdiff - include/linux/sysctl.h
sysctl: Remove the now unused ctl_table parent field.
[~andy/linux] / include / linux / sysctl.h
index bb9127dd814b4d377d915fb693c8f8659ffe0639..094bc5ccf1e2e63f4e8b2df64f586152a79f42c7 100644 (file)
@@ -937,30 +937,8 @@ enum
 struct ctl_table;
 struct nsproxy;
 struct ctl_table_root;
-
-struct ctl_table_set {
-       struct list_head list;
-       struct ctl_table_set *parent;
-       int (*is_seen)(struct ctl_table_set *);
-};
-
-extern void setup_sysctl_set(struct ctl_table_set *p,
-       struct ctl_table_set *parent,
-       int (*is_seen)(struct ctl_table_set *));
-
 struct ctl_table_header;
 
-extern void sysctl_head_get(struct ctl_table_header *);
-extern void sysctl_head_put(struct ctl_table_header *);
-extern int sysctl_is_seen(struct ctl_table_header *);
-extern struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *);
-extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev);
-extern struct ctl_table_header *__sysctl_head_next(struct nsproxy *namespaces,
-                                               struct ctl_table_header *prev);
-extern void sysctl_head_finish(struct ctl_table_header *prev);
-extern int sysctl_perm(struct ctl_table_root *root,
-               struct ctl_table *table, int op);
-
 typedef struct ctl_table ctl_table;
 
 typedef int proc_handler (struct ctl_table *ctl, int write,
@@ -1023,8 +1001,6 @@ static inline void *proc_sys_poll_event(struct ctl_table_poll *poll)
        return (void *)(unsigned long)atomic_read(&poll->event);
 }
 
-void proc_sys_poll_notify(struct ctl_table_poll *poll);
-
 #define __CTL_TABLE_POLL_INITIALIZER(name) {                           \
        .event = ATOMIC_INIT(0),                                        \
        .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) }
@@ -1039,23 +1015,13 @@ struct ctl_table
        void *data;
        int maxlen;
        umode_t mode;
-       struct ctl_table *child;
-       struct ctl_table *parent;       /* Automatically set */
+       struct ctl_table *child;        /* Deprecated */
        proc_handler *proc_handler;     /* Callback for text formatting */
        struct ctl_table_poll *poll;
        void *extra1;
        void *extra2;
 };
 
-struct ctl_table_root {
-       struct list_head root_list;
-       struct ctl_table_set default_set;
-       struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
-                                          struct nsproxy *namespaces);
-       int (*permissions)(struct ctl_table_root *root,
-                       struct nsproxy *namespaces, struct ctl_table *table);
-};
-
 /* struct ctl_table_header is used to maintain dynamic lists of
    struct ctl_table trees. */
 struct ctl_table_header
@@ -1078,12 +1044,37 @@ struct ctl_table_header
        struct ctl_table_header *parent;
 };
 
+struct ctl_table_set {
+       struct list_head list;
+       int (*is_seen)(struct ctl_table_set *);
+};
+
+struct ctl_table_root {
+       struct list_head root_list;
+       struct ctl_table_set default_set;
+       struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
+                                          struct nsproxy *namespaces);
+       int (*permissions)(struct ctl_table_root *root,
+                       struct nsproxy *namespaces, struct ctl_table *table);
+};
+
 /* struct ctl_path describes where in the hierarchy a table is added */
 struct ctl_path {
        const char *procname;
 };
 
+#ifdef CONFIG_SYSCTL
+
+void proc_sys_poll_notify(struct ctl_table_poll *poll);
+
+extern void setup_sysctl_set(struct ctl_table_set *p,
+       int (*is_seen)(struct ctl_table_set *));
+extern void retire_sysctl_set(struct ctl_table_set *set);
+
 void register_sysctl_root(struct ctl_table_root *root);
+struct ctl_table_header *__register_sysctl_table(
+       struct ctl_table_root *root, struct nsproxy *namespaces,
+       const char *path, struct ctl_table *table);
 struct ctl_table_header *__register_sysctl_paths(
        struct ctl_table_root *root, struct nsproxy *namespaces,
        const struct ctl_path *path, struct ctl_table *table);
@@ -1092,7 +1083,30 @@ struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path,
                                                struct ctl_table *table);
 
 void unregister_sysctl_table(struct ctl_table_header * table);
-int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table);
+
+extern int sysctl_init(void);
+#else /* CONFIG_SYSCTL */
+static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
+{
+       return NULL;
+}
+
+static inline struct ctl_table_header *register_sysctl_paths(
+                       const struct ctl_path *path, struct ctl_table *table)
+{
+       return NULL;
+}
+
+static inline void unregister_sysctl_table(struct ctl_table_header * table)
+{
+}
+
+static inline void setup_sysctl_set(struct ctl_table_set *p,
+       int (*is_seen)(struct ctl_table_set *))
+{
+}
+
+#endif /* CONFIG_SYSCTL */
 
 #endif /* __KERNEL__ */