From b9866e086ad21be6f73c678e7c3548c8fdafeef5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sun, 6 Sep 2015 19:40:42 -0400 Subject: [PATCH] Clean-up and simplify event_agent_disable_all MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit event_agent_disable_all contains comments which make no sense since they were blindly copy-pasted from event_agent_enable_all. Also add an error_unlock label instead of open coding the unlock on error. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/event.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index d7034efa5..dacd56d33 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -634,7 +634,7 @@ int event_agent_disable_all(struct ltt_ust_session *usess, goto error; } - /* Flag every event that they are now enabled. */ + /* Disable every event. */ rcu_read_lock(); cds_lfht_for_each_entry(agt->events->ht, &iter.iter, aevent, node.node) { @@ -644,14 +644,15 @@ int event_agent_disable_all(struct ltt_ust_session *usess, ret = event_agent_disable(usess, agt, aevent->name); if (ret != LTTNG_OK) { - rcu_read_unlock(); - goto error; + goto error_unlock; } } rcu_read_unlock(); ret = LTTNG_OK; +error_unlock: + rcu_read_unlock(); error: return ret; } -- 2.34.1