Fix: ring buffer: honor switch parameter type in remote switch
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 20 May 2016 01:32:06 +0000 (21:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 20 May 2016 01:34:20 +0000 (21:34 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_frontend.c

index 6eec323232b8d2910b19603d82bbd47c2735f011..b25ce7df6058d9dea6898062f4e6acbf6601c7b8 100644 (file)
@@ -1602,11 +1602,17 @@ void lib_ring_buffer_switch_slow(struct lib_ring_buffer *buf, enum switch_mode m
 }
 EXPORT_SYMBOL_GPL(lib_ring_buffer_switch_slow);
 
+struct switch_param {
+       struct lib_ring_buffer *buf;
+       enum switch_mode mode;
+};
+
 static void remote_switch(void *info)
 {
-       struct lib_ring_buffer *buf = info;
+       struct switch_param *param = info;
+       struct lib_ring_buffer *buf = param->buf;
 
-       lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE);
+       lib_ring_buffer_switch_slow(buf, param->mode);
 }
 
 static void _lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf,
@@ -1615,6 +1621,7 @@ static void _lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf,
        struct channel *chan = buf->backend.chan;
        const struct lib_ring_buffer_config *config = &chan->backend.config;
        int ret;
+       struct switch_param param;
 
        /*
         * With global synchronization we don't need to use the IPI scheme.
@@ -1635,8 +1642,10 @@ static void _lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf,
         * switch.
         */
        get_online_cpus();
+       param.buf = buf;
+       param.mode = mode;
        ret = smp_call_function_single(buf->backend.cpu,
-                                remote_switch, buf, 1);
+                                remote_switch, &param, 1);
        if (ret) {
                /* Remote CPU is offline, do it ourself. */
                lib_ring_buffer_switch_slow(buf, mode);
This page took 0.025842 seconds and 4 git commands to generate.