+
+ metadata_stream = channel->metadata_stream;
+
+ if (!metadata_stream) {
+ /*
+ * Having no metadata stream means the channel is being destroyed so there
+ * is no cache to flush anymore.
+ */
+ ret = 0;
+ } else if (metadata_stream->ust_metadata_pushed >= offset) {
+ ret = 0;
+ } else if (channel->metadata_stream->endpoint_status !=
+ CONSUMER_ENDPOINT_ACTIVE) {
+ /* An inactive endpoint means we don't have to flush anymore. */