lttng-modules v0.19-stable: setup_trace_write: Fix recursive locking
[lttng-modules.git] / ltt-relay-alloc.c
index 6ff552efacc06cb5506f23090a34833533e5783e..03a6ffa0e83827fccc58b19db953f762e7527e8c 100644 (file)
@@ -360,7 +360,7 @@ void ltt_chan_alloc_remove_files(struct ltt_chan_alloc *chan)
                 * Wait for every reference to the dentry to be gone,
                 * except us.
                 */
-               while (atomic_read(&dentry->d_count) != 1)
+               while (ACCESS_ONCE(dentry->d_count) != 1)
                        msleep(100);
                dput(dentry);
        }
@@ -716,9 +716,14 @@ void *ltt_relay_offset_address(struct ltt_chanbuf_alloc *bufa, size_t offset)
 }
 EXPORT_SYMBOL_GPL(ltt_relay_offset_address);
 
+static struct notifier_block ltt_relay_hotcpu = {
+       .notifier_call = ltt_relay_hotcpu_callback,
+       .priority = 5,
+};
+
 static __init int ltt_relay_alloc_init(void)
 {
-       hotcpu_notifier(ltt_relay_hotcpu_callback, 5);
+       register_cpu_notifier(&ltt_relay_hotcpu);
        ltt_relay_init();
        ltt_ascii_init();
        return 0;
@@ -728,6 +733,7 @@ static void __exit ltt_relay_alloc_exit(void)
 {
        ltt_ascii_exit();
        ltt_relay_exit();
+       unregister_cpu_notifier(&ltt_relay_hotcpu);
 }
 
 module_init(ltt_relay_alloc_init);
This page took 0.023437 seconds and 4 git commands to generate.