22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DTM0 98 m0_dtm0_service_bob_init(
s);
99 dopr_tlist_init(&
s->dos_processes);
108 dopr_tlist_fini(&
s->dos_processes);
109 m0_dtm0_service_bob_fini(
s);
150 const struct m0_fid *remote_dtm0)
153 m0_fid_eq(&proc->dop_rserv_fid, remote_dtm0));
159 struct m0_fid *remote_srv,
160 const char *remote_ep,
185 if (M0_IN(
rc, (0, -ETIMEDOUT, -ECANCELED))) {
195 if (
rc == -ETIMEDOUT ||
rc == -ECANCELED) {
197 rc == -ETIMEDOUT ?
"timed out" :
"cancelled");
210 struct m0_fid *remote_srv)
223 const struct m0_fid *remote_srv)
243 s->dos_generic.rs_type =
stype;
244 s->dos_generic.rs_ops =
ops;
311 " no parameters given");
423 const struct m0_fid *rem_svc_fid)
440 "Cannot find svc" FID_F 441 " in the conf cache.",
FID_P(rem_svc_fid));
445 "any process?",
FID_P(rem_svc_fid));
448 if (rem_svc_conf->
cs_type != M0_CST_DTM0)
449 return M0_ERR_INFO(-ENOENT,
"Not a DTM0 service.");
451 dopr_tlink_init(proc);
466 dopr_tlink_fini(proc);
478 while ((process = dopr_tlist_pop(&
service->dos_processes)) !=
NULL) {
static int dtm0_service__alloc(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype, const struct m0_reqh_service_ops *ops)
M0_INTERNAL int m0_dtm0_stype_init(void)
M0_INTERNAL void m0_long_lock_fini(struct m0_long_lock *lock)
M0_INTERNAL bool m0_dtm0_is_a_volatile_dtm(struct m0_reqh_service *service)
static void dtm0_service_fini(struct m0_reqh_service *service)
struct m0_reqh_service * reqh_svc
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
static void dtm0_service_prepare_to_stop(struct m0_reqh_service *service)
int(* rso_start)(struct m0_reqh_service *service)
M0_INTERNAL int dtm0_process_init(struct dtm0_process *proc, struct m0_dtm0_service *dtms, const struct m0_fid *rem_svc_fid)
M0_INTERNAL int m0_sm_addb2_init(struct m0_sm_conf *conf, uint64_t id, uint64_t counter)
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_service_find(const struct m0_reqh *reqh)
M0_INTERNAL void m0_be_dtm0_log_free(struct m0_be_dtm0_log **in_log)
M0_INTERNAL void m0_dtm_client_service_stop(struct m0_reqh_service *svc)
M0_INTERNAL void dtm0_process_fini(struct dtm0_process *proc)
M0_INTERNAL struct m0_conf_obj * m0_conf_cache_lookup(const struct m0_conf_cache *cache, const struct m0_fid *id)
#define M0_LOG(level,...)
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
static int dtm0_process_disconnect(struct dtm0_process *process)
static const struct m0_bob_type dtm0_service_bob
static int dtm0_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
static const struct m0_reqh_service_ops dtm0_service_ops
M0_TL_DESCR_DEFINE(dopr, "dtm0_process", static, struct dtm0_process, dop_link, dop_magic, M0_DTM0_PROC_MAGIC, M0_DTM0_PROC_HEAD_MAGIC)
M0_INTERNAL void m0_be_dtm0_log_fini(struct m0_be_dtm0_log *log)
M0_INTERNAL void m0_rpc_link_fini(struct m0_rpc_link *rlink)
M0_INTERNAL struct m0 * m0_get(void)
M0_INTERNAL struct dtm0_process * dtm0_service_process__lookup(struct m0_reqh_service *reqh_dtm0_svc, const struct m0_fid *remote_dtm0)
M0_INTERNAL void dtm0_service_conns_term(struct m0_dtm0_service *service)
static void dtm0_service_stop(struct m0_reqh_service *service)
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
static void dtm0_service__fini(struct m0_dtm0_service *s)
M0_INTERNAL void m0_be_dtm0_log_clear(struct m0_be_dtm0_log *log)
struct m0_be_dtm0_log * dos_log
M0_INTERNAL bool m0_dtm0_is_a_persistent_dtm(struct m0_reqh_service *service)
M0_INTERNAL int m0_dtm0_fop_init(void)
enum m0_dtm0_service_origin dos_origin
struct m0_fid dop_rserv_fid
#define M0_RC_INFO(rc, fmt,...)
#define M0_ERR_INFO(rc, fmt,...)
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_dtm0_dtx_domain_init(void)
M0_INTERNAL void m0_dtm0_rpc_link_mod_fini(void)
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
#define M0_AMB(obj, ptr, field)
static const struct socktype stype[]
M0_INTERNAL int m0_be_dtm0_log_init(struct m0_be_dtm0_log *log, struct m0_be_seg *seg, struct m0_dtm0_clk_src *cs, bool is_plog)
static int volatile_log_init(struct m0_dtm0_service *dtm0)
struct m0_long_lock dop_llock
static struct m0_confc * confc
M0_INTERNAL int m0_be_dtm0_log_alloc(struct m0_be_dtm0_log **out)
static int dtm0_service_start(struct m0_reqh_service *service)
M0_INTERNAL void m0_dtm0_stype_fini(void)
struct m0_conf_obj * m0_conf_obj_grandparent(const struct m0_conf_obj *obj)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
struct m0_fid rs_service_fid
#define bob_of(ptr, type, field, bt)
M0_INTERNAL int m0_dtm_client_service_start(struct m0_reqh *reqh, struct m0_fid *cli_srv_fid, struct m0_reqh_service **out)
M0_INTERNAL int m0_dtm0_service_process_disconnect(struct m0_reqh_service *s, struct m0_fid *remote_srv)
static int dtm_service__origin_fill(struct m0_reqh_service *service)
M0_INTERNAL bool m0_rpc_link_is_connected(const struct m0_rpc_link *rlink)
struct m0_dtm0_clk_src dos_clk_src
struct m0_conf_cache cc_cache
M0_INTERNAL int m0_dtm0_rpc_link_mod_init(void)
M0_INTERNAL void m0_dtm0_dtx_domain_fini(void)
static int persistent_log_init(struct m0_dtm0_service *dtm0)
static void dtm0_service__init(struct m0_dtm0_service *s)
M0_INTERNAL void m0_sm_addb2_fini(struct m0_sm_conf *conf)
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
M0_INTERNAL void m0_dtm0_fop_fini(void)
struct m0_sm_conf m0_dtx_sm_conf
enum m0_conf_service_type cs_type
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
#define M0_CONF_CAST(ptr, type)
M0_INTERNAL bool m0_confc_is_inited(const struct m0_confc *confc)
M0_INTERNAL int m0_rpc_link_disconnect_sync(struct m0_rpc_link *rlink, m0_time_t abs_timeout)
struct m0_fid dop_rproc_fid
struct m0_rpc_link dop_rlink
M0_TL_DEFINE(dopr, static, struct dtm0_process)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL void m0_long_lock_init(struct m0_long_lock *lock)
struct m0_conf_obj pc_obj
M0_BOB_DEFINE(static, &dtm0_service_bob, m0_dtm0_service)
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
#define M0_MAGIX_OFFSET(type, field)
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
struct m0_reqh_service_type dtm0_service_type
#define M0_FI_ENABLED(tag)
const struct m0_reqh_service_type * rs_type
M0_INTERNAL void m0_dtm0_clk_src_fini(struct m0_dtm0_clk_src *cs)
#define M0_ALLOC_PTR(ptr)
struct m0_conf_obj cs_obj
m0_time_t m0_time_from_now(uint64_t secs, long ns)
struct m0_tl dos_processes
static struct m0_net_test_service svc
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_fom2service(struct m0_fom *fom)
M0_INTERNAL void m0_reqh_idle_wait_for(struct m0_reqh *reqh, struct m0_reqh_service *service)
struct m0_be_seg * rh_beseg
#define M0_ASSERT_INFO(cond, fmt,...)
struct m0_rpc_session rlk_sess
static const struct m0_reqh_service_type_ops dtm0_service_type_ops
M0_INTERNAL int m0_dtm0_service_process_connect(struct m0_reqh_service *s, struct m0_fid *remote_srv, const char *remote_ep, bool async)
#define m0_tl_find(name, var, head,...)
static struct m0_addb2_source * s
M0_INTERNAL void m0_dtm0_clk_src_init(struct m0_dtm0_clk_src *cs, enum m0_dtm0_cs_types type)
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
struct m0_reqh_service dos_generic
M0_INTERNAL struct m0_rpc_session * m0_dtm0_service_process_session_get(struct m0_reqh_service *s, const struct m0_fid *remote_srv)
static struct m0_dtm0_service * to_dtm(struct m0_reqh_service *service)
M0_INTERNAL bool m0_dtm0_in_ut(void)