+static void destroy_channels(struct cds_lfht *channels)
+{
+ int ret;
+ struct cds_lfht_node *node;
+ struct cds_lfht_iter iter;
+
+ hashtable_get_first(channels, &iter);
+ while ((node = hashtable_iter_get_node(&iter)) != NULL) {
+ ret = hashtable_del(channels, &iter);
+ if (!ret) {
+ call_rcu(&node->head, destroy_channel_rcu);
+ }
+ hashtable_get_next(channels, &iter);
+ }
+}
+
+/*
+ * Cleanup UST pid domain.
+ */
+static void destroy_domain_pid(struct cds_lfht *ht)
+{
+ int ret;
+ struct cds_lfht_node *node;
+ struct cds_lfht_iter iter;
+ struct ltt_ust_domain_pid *d;
+
+ hashtable_get_first(ht, &iter);
+ while ((node = hashtable_iter_get_node(&iter)) != NULL) {
+ ret = hashtable_del(ht , &iter);
+ if (!ret) {
+ d = caa_container_of(node, struct ltt_ust_domain_pid, node);
+ destroy_channels(d->channels);
+ }
+ hashtable_get_next(ht, &iter);
+ }
+}
+
+/*
+ * Cleanup UST exec name domain.
+ */
+static void destroy_domain_exec(struct cds_lfht *ht)