Refactoring: ring buffer context
[lttng-modules.git] / src / lttng-ring-buffer-metadata-client.h
index 0f68b38538779c2abe404cb59eca9394fead5358..7e418001f85fb51fadb2a31c5a38dec4f703a29e 100644 (file)
@@ -237,11 +237,12 @@ void lttng_channel_destroy(struct channel *chan)
 
 static
 struct channel *_channel_create(const char *name,
-                               struct lttng_channel *lttng_chan, void *buf_addr,
+                               void *priv, void *buf_addr,
                                size_t subbuf_size, size_t num_subbuf,
                                unsigned int switch_timer_interval,
                                unsigned int read_timer_interval)
 {
+       struct lttng_channel *lttng_chan = priv;
        struct channel *chan;
 
        chan = channel_create(&client_config, name,
@@ -254,7 +255,7 @@ struct channel *_channel_create(const char *name,
                 * using lttng_relay_transport.ops.
                 */
                if (!try_module_get(THIS_MODULE)) {
-                       printk(KERN_WARNING "LTT : Can't lock transport module.\n");
+                       printk(KERN_WARNING "LTTng: Can't lock transport module.\n");
                        goto error;
                }
                chan->backend.priv_ops = &lttng_relay_transport.ops;
@@ -301,13 +302,17 @@ void lttng_buffer_read_close(struct lib_ring_buffer *buf)
 static
 int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx, uint32_t event_id)
 {
+       struct channel *chan = ctx->client_priv;
        int ret;
 
+       memset(&ctx->priv, 0, sizeof(ctx->priv));
+       ctx->priv.chan = chan;
+
        ret = lib_ring_buffer_reserve(&client_config, ctx, NULL);
        if (ret)
                return ret;
        lib_ring_buffer_backend_get_pages(&client_config, ctx,
-                       &ctx->backend_pages);
+                       &ctx->priv.backend_pages);
        return 0;
 
 }
This page took 0.022769 seconds and 4 git commands to generate.