Clean-up and simplify event_agent_disable_all
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 6 Sep 2015 23:40:42 +0000 (19:40 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Sep 2015 14:00:58 +0000 (10:00 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/event.c

index b0652bed00d783203e7c1e23c10c9636f558b3e6..f63364a855e3ca8dc5724e1fe4242c4b11db5052 100644 (file)
@@ -641,7 +641,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) {
@@ -651,14 +651,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;
 }
This page took 0.026431 seconds and 4 git commands to generate.