From: Mathieu Desnoyers Date: Sat, 21 May 2011 17:45:43 +0000 (-0400) Subject: Fix teardown event vs session X-Git-Tag: v2.0-pre1~127 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aa7c23a91f7af01415106af98b96a2a1871e97b0;p=lttng-modules.git Fix teardown event vs session Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index 02f7232c..046fca43 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -534,10 +534,8 @@ int lttng_event_release(struct inode *inode, struct file *file) { struct ltt_event *event = file->private_data; - if (event) { - ltt_event_unregister(event); + if (event) fput(event->chan->file); - } return 0; } diff --git a/ltt-events.c b/ltt-events.c index 61b9de6a..6d9eafaa 100644 --- a/ltt-events.c +++ b/ltt-events.c @@ -23,6 +23,7 @@ static DEFINE_MUTEX(sessions_mutex); static struct kmem_cache *event_cache; static void _ltt_event_destroy(struct ltt_event *event); +static void _ltt_channel_destroy(struct ltt_channel *chan); static int _ltt_event_unregister(struct ltt_event *event); static int _ltt_event_metadata_statedump(struct ltt_session *session, @@ -191,6 +192,7 @@ active: /* * Only used internally at session destruction. */ +static void _ltt_channel_destroy(struct ltt_channel *chan) { chan->ops->channel_destroy(chan->chan); @@ -308,19 +310,6 @@ int _ltt_event_unregister(struct ltt_event *event) return ret; } -/* - * Used when an event FD is released. - */ -int ltt_event_unregister(struct ltt_event *event) -{ - int ret; - - mutex_lock(&sessions_mutex); - ret = ltt_event_unregister(event); - mutex_unlock(&sessions_mutex); - return ret; -} - /* * Only used internally at session destruction. */ diff --git a/ltt-events.h b/ltt-events.h index 015bbffd..d07f1c87 100644 --- a/ltt-events.h +++ b/ltt-events.h @@ -242,13 +242,11 @@ struct ltt_channel *ltt_global_channel_create(struct ltt_session *session, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval); -void _ltt_channel_destroy(struct ltt_channel *chan); struct ltt_event *ltt_event_create(struct ltt_channel *chan, char *name, struct lttng_kernel_event *event_param, void *filter); -int ltt_event_unregister(struct ltt_event *event); void ltt_transport_register(struct ltt_transport *transport); void ltt_transport_unregister(struct ltt_transport *transport);