Merge branch 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[cascardo/linux.git] / kernel / sysctl.c
index 4fc9244..11d65b5 100644 (file)
@@ -938,6 +938,12 @@ static struct ctl_table kern_table[] = {
        },
 #endif
 #ifdef CONFIG_PERF_EVENTS
+       /*
+        * User-space scripts rely on the existence of this file
+        * as a feature check for perf_events being enabled.
+        *
+        * So it's an ABI, do not remove!
+        */
        {
                .procname       = "perf_event_paranoid",
                .data           = &sysctl_perf_event_paranoid,
@@ -1584,16 +1590,11 @@ void sysctl_head_get(struct ctl_table_header *head)
        spin_unlock(&sysctl_lock);
 }
 
-static void free_head(struct rcu_head *rcu)
-{
-       kfree(container_of(rcu, struct ctl_table_header, rcu));
-}
-
 void sysctl_head_put(struct ctl_table_header *head)
 {
        spin_lock(&sysctl_lock);
        if (!--head->count)
-               call_rcu(&head->rcu, free_head);
+               kfree_rcu(head, rcu);
        spin_unlock(&sysctl_lock);
 }
 
@@ -1965,10 +1966,10 @@ void unregister_sysctl_table(struct ctl_table_header * header)
        start_unregistering(header);
        if (!--header->parent->count) {
                WARN_ON(1);
-               call_rcu(&header->parent->rcu, free_head);
+               kfree_rcu(header->parent, rcu);
        }
        if (!--header->count)
-               call_rcu(&header->rcu, free_head);
+               kfree_rcu(header, rcu);
        spin_unlock(&sysctl_lock);
 }