Пример #1
0
int
meta2_filter_check_backend(struct gridd_filter_ctx_s *ctx,
		struct gridd_reply_ctx_s *reply)
{
	(void) reply;
	TRACE_FILTER();
	struct meta2_backend_s *m2b = meta2_filter_ctx_get_backend(ctx);
	if (meta2_backend_initiated(m2b))
		return FILTER_OK;
	meta2_filter_ctx_set_error(ctx, SYSERR("Backend not ready"));
	return FILTER_KO;
}
int
meta2_filter_check_backend(struct gridd_filter_ctx_s *ctx,
		struct gridd_reply_ctx_s *reply)
{
	struct meta2_backend_s *m2b;

	(void) reply;
	TRACE_FILTER();
	m2b = meta2_filter_ctx_get_backend(ctx);
	if (meta2_backend_initiated(m2b))
		return FILTER_OK;
	meta2_filter_ctx_set_error(ctx, NEWERROR(CODE_INTERNAL_ERROR, "Backend not ready"));
	return FILTER_KO;
}
Пример #3
0
int
meta2_filter_check_events_not_stalled (struct gridd_filter_ctx_s *ctx,
		struct gridd_reply_ctx_s *reply)
{
	(void) reply;
	TRACE_FILTER ();

	struct meta2_backend_s *m2b = meta2_filter_ctx_get_backend(ctx);
	if (m2b->notifier && meta2_backend_initiated (m2b)) {
		if (oio_events_queue__is_stalled (m2b->notifier)) {
			meta2_filter_ctx_set_error(ctx, BUSY("Too many pending events"));
			return FILTER_KO;
		}
	}

	return FILTER_OK;
}