30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_HA 47 struct m0_ha_link, hln_service_link, hln_service_magic,
62 .
bt_name =
"m0_ha_link_service",
85 ha_link_svc_tlist_init(&hl_service->
hls_links);
96 ha_link_svc_tlist_fini(&hl_service->
hls_links);
98 ha_link_service_bob_fini(hl_service);
134 if (connection_id !=
NULL)
180 uint64_t ref_counter;
192 M0_LEAVE(
"service=%p hl_service=%p hl=%p " 193 "hln_service_ref_counter=%"PRIu64,
194 service, hl_service, hl, ref_counter);
230 ha_link_svc_tlink_init_at_tail(hl, &hl_service->
hls_links);
244 ha_link_svc_tlink_del_fini(hl);
267 .rst_keep_alive =
true,
279 if (hl_service ==
NULL)
280 return M0_RC(-ENOMEM);
282 ha_link_service_bob_init(hl_service);
300 M0_ENTRY(
"hl_service=%p", hl_service);
315 #undef M0_TRACE_SUBSYSTEM static struct ha_link_service * ha_link_service_container(struct m0_reqh_service *service)
M0_INTERNAL void m0_ha_link_service_put(struct m0_reqh_service *service, struct m0_ha_link *hl)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
int(* rso_start)(struct m0_reqh_service *service)
static int ha_link_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
M0_INTERNAL bool m0_uint128_eq(const struct m0_uint128 *u0, const struct m0_uint128 *u1)
M0_BOB_DEFINE(static inline, &ha_link_service_bob_type, ha_link_service)
uint64_t hln_service_ref_counter
struct m0_uint128 hln_service_connection_id
M0_INTERNAL struct m0_ha_link * m0_ha_link_service_find_get(struct m0_reqh_service *service, const struct m0_uint128 *link_id, struct m0_uint128 *connection_id)
static const struct m0_reqh_service_type_ops ha_link_stype_ops
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
static int ha_link_service_start(struct m0_reqh_service *service)
struct m0_chan * hln_service_release_chan
bool hln_service_quiescing
static const struct socktype stype[]
M0_INTERNAL void m0_reqh_service_quit(struct m0_reqh_service *svc)
M0_INTERNAL bool m0_mutex_is_locked(const struct m0_mutex *mutex)
#define bob_of(ptr, type, field, bt)
M0_TL_DESCR_DEFINE(ha_link_svc, "ha_link_service::hls_links", static, struct m0_ha_link, hln_service_link, hln_service_magic, M0_HA_LINK_SERVICE_LINK_MAGIC, M0_HA_LINK_SERVICE_HEAD_MAGIC)
struct m0_uint128 hln_service_link_id
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
static void ha_link_service_fini(struct m0_reqh_service *service)
M0_INTERNAL int m0_reqh_service_setup(struct m0_reqh_service **out, struct m0_reqh_service_type *stype, struct m0_reqh *reqh, struct m0_reqh_context *rctx, const struct m0_fid *fid)
struct m0_reqh_service hls_service
M0_INTERNAL int m0_ha_link_service_init(struct m0_reqh_service **hl_service, struct m0_reqh *reqh)
M0_INTERNAL int m0_ha_link_service_mod_init(void)
static const struct m0_reqh_service_ops ha_link_service_ops
M0_INTERNAL void m0_chan_signal_lock(struct m0_chan *chan)
M0_INTERNAL void m0_ha_link_service_register(struct m0_reqh_service *service, struct m0_ha_link *hl, const struct m0_uint128 *link_id, const struct m0_uint128 *connection_id)
#define M0_MAGIX_OFFSET(type, field)
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
static void ha_link_service_init(struct m0_reqh_service *service)
struct m0_reqh_service_type m0_ha_link_service_type
static struct m0_chan chan[RDWR_REQUEST_MAX]
M0_INTERNAL void m0_ha_link_service_fini(struct m0_reqh_service *hl_service)
M0_INTERNAL void m0_ha_link_service_quiesce(struct m0_reqh_service *service, struct m0_ha_link *hl, struct m0_chan *chan)
#define M0_ALLOC_PTR(ptr)
static void ha_link_service_stop(struct m0_reqh_service *service)
static int ha_link_service_fop_accept(struct m0_reqh_service *service, struct m0_fop *fop)
M0_TL_DEFINE(ha_link_svc, static, struct m0_ha_link)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
static struct m0_fop * fop
static void ha_link_service_get(struct ha_link_service *hl_service, struct m0_ha_link *hl)
#define M0_UINT128(hi, lo)
static struct m0_ha_link * ha_link_service_find(struct ha_link_service *hl_service, const struct m0_uint128 *link_id, struct m0_uint128 *connection_id)
#define m0_tl_find(name, var, head,...)
struct m0_reqh * hls_reqh
struct m0_tl hls_quiescing
M0_INTERNAL void m0_ha_link_service_deregister(struct m0_reqh_service *service, struct m0_ha_link *hl)
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
M0_INTERNAL void m0_ha_link_service_mod_fini(void)
bool hln_service_released
const struct m0_reqh_service_ops * rs_ops
static const struct m0_bob_type ha_link_service_bob_type