aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index c9a0af887033..ff5abcca5ddf 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1932,6 +1932,21 @@ void unregister_sysctl_table(struct ctl_table_header * header)
1932 spin_unlock(&sysctl_lock); 1932 spin_unlock(&sysctl_lock);
1933} 1933}
1934 1934
1935int sysctl_is_seen(struct ctl_table_header *p)
1936{
1937 struct ctl_table_set *set = p->set;
1938 int res;
1939 spin_lock(&sysctl_lock);
1940 if (p->unregistering)
1941 res = 0;
1942 else if (!set->is_seen)
1943 res = 1;
1944 else
1945 res = set->is_seen(set);
1946 spin_unlock(&sysctl_lock);
1947 return res;
1948}
1949
1935void setup_sysctl_set(struct ctl_table_set *p, 1950void setup_sysctl_set(struct ctl_table_set *p,
1936 struct ctl_table_set *parent, 1951 struct ctl_table_set *parent,
1937 int (*is_seen)(struct ctl_table_set *)) 1952 int (*is_seen)(struct ctl_table_set *))