Motr  M0
service.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DTM0
23 #include "lib/trace.h"
24 #include "dtm0/service.h"
25 #include "be/dtm0_log.h" /* DTM0 log API */
26 #include "dtm0/addb2.h" /* M0_AVI_DTX0_SM_STATE */
27 #include "dtm0/drlink.h" /* m0_dtm0_rpc_link_mod_{init,fini} */
28 #include "dtm0/dtx.h" /* m0_dtm0_dtx_domain_init */
29 #include "dtm0/fop.h" /* m0_dtm0_fop_{init,fini} */
30 #include "dtm0/svc_internal.h" /* dtm0_process */
31 #include "lib/errno.h" /* ENOMEM and so on */
32 #include "lib/memory.h" /* M0_ALLOC_PTR */
33 #include "lib/string.h" /* streq */
34 #include "lib/tlist.h" /* tlist API */
35 #include "module/instance.h" /* m0_get */
36 #include "reqh/reqh.h" /* m0_reqh */
37 #include "reqh/reqh.h" /* m0_reqh2confc */
38 #include "reqh/reqh_service.h" /* m0_reqh_service */
39 #include "rpc/rpc_machine.h" /* m0_rpc_machine */
40 
41 static struct m0_dtm0_service *to_dtm(struct m0_reqh_service *service);
42 static int dtm0_service_start(struct m0_reqh_service *service);
43 static void dtm0_service_stop(struct m0_reqh_service *service);
46  const struct m0_reqh_service_type *stype);
47 static void dtm0_service_fini(struct m0_reqh_service *service);
48 
51 };
52 
53 static const struct m0_reqh_service_ops dtm0_service_ops = {
55  .rso_stop = dtm0_service_stop,
56  .rso_fini = dtm0_service_fini,
57  .rso_prepare_to_stop = dtm0_service_prepare_to_stop,
58 };
59 
61  .rst_name = "M0_CST_DTM0",
62  .rst_ops = &dtm0_service_type_ops,
63  .rst_level = M0_RS_LEVEL_LATE,
64 };
65 
66 
67 M0_TL_DESCR_DEFINE(dopr, "dtm0_process", static, struct dtm0_process, dop_link,
69 M0_TL_DEFINE(dopr, static, struct dtm0_process);
70 
74 static const struct m0_bob_type dtm0_service_bob = {
75  .bt_name = "dtm0 service",
76  .bt_magix_offset = M0_MAGIX_OFFSET(struct m0_dtm0_service, dos_magix),
77  .bt_magix = M0_DTM0_SVC_MAGIC,
78  .bt_check = NULL
79 };
81 
83 {
84  return bob_of(service, struct m0_dtm0_service, dos_generic,
86 }
87 
88 M0_INTERNAL struct m0_dtm0_service *m0_dtm0_fom2service(struct m0_fom *fom)
89 {
90  return to_dtm(fom->fo_service);
91 }
92 
96 static void dtm0_service__init(struct m0_dtm0_service *s)
97 {
98  m0_dtm0_service_bob_init(s);
99  dopr_tlist_init(&s->dos_processes);
101  m0_dtm0_clk_src_init(&s->dos_clk_src, M0_DTM0_CS_PHYS);
102 }
103 
105 {
106  m0_dtm0_clk_src_fini(&s->dos_clk_src);
108  dopr_tlist_fini(&s->dos_processes);
109  m0_dtm0_service_bob_fini(s);
110 }
111 
112 M0_INTERNAL int
113 m0_dtm_client_service_start(struct m0_reqh *reqh, struct m0_fid *cli_srv_fid,
114  struct m0_reqh_service **out)
115 {
116  struct m0_reqh_service_type *svct;
117  struct m0_reqh_service *reqh_svc;
118  int rc;
119 
120  svct = m0_reqh_service_type_find("M0_CST_DTM0");
121  if (svct == NULL)
122  return M0_ERR(-ENOENT);
123 
125  if (rc != 0)
126  return M0_ERR(rc);
127 
128  m0_reqh_service_init(reqh_svc, reqh, cli_srv_fid);
129 
131  if (rc != 0)
133  else
134  *out = reqh_svc;
135 
136  return M0_RC(rc);
137 }
138 
140 {
142  m0_reqh_idle_wait_for(svc->rs_reqh, svc);
145 }
146 
147 
148 M0_INTERNAL struct dtm0_process *
150  const struct m0_fid *remote_dtm0)
151 {
152  return m0_tl_find(dopr, proc, &to_dtm(reqh_dtm0_svc)->dos_processes,
153  m0_fid_eq(&proc->dop_rserv_fid, remote_dtm0));
154 }
155 
156 
157 M0_INTERNAL int
159  struct m0_fid *remote_srv,
160  const char *remote_ep,
161  bool async)
162 {
163  /*
164  * TODO: This function will be eliminated once drlink gets
165  * "synchronous" mode.
166  */
167  M0_ASSERT_INFO(0, "Direct connect() call is not supported.");
168 }
169 
170 static int dtm0_process_disconnect(struct dtm0_process *process)
171 {
172  int rc;
173  const m0_time_t timeout =
175 
176  M0_ENTRY("process=%p, rfid=" FID_F, process,
177  FID_P(&process->dop_rserv_fid));
178 
179  if (M0_IS0(&process->dop_rlink))
180  return M0_RC(0);
181 
182  rc = m0_rpc_link_is_connected(&process->dop_rlink) ?
184 
185  if (M0_IN(rc, (0, -ETIMEDOUT, -ECANCELED))) {
186  /*
187  * XXX: At this moment there is no special call to
188  * unconditionally terminate an RPC connection without
189  * communication with the other side. Because of that,
190  * we are reusing the existing ::m0_rpc_link_disconnect_sync,
191  * but ignoring the cases where the counterpart is
192  * dead (timed out) or has already disconnected
193  * from us (canceled).
194  */
195  if (rc == -ETIMEDOUT || rc == -ECANCELED) {
196  M0_LOG(M0_WARN, "Disconnect %s (suppressed)",
197  rc == -ETIMEDOUT ? "timed out" : "cancelled");
198  rc = 0;
199  }
200 
201  m0_rpc_link_fini(&process->dop_rlink);
202  M0_SET0(&process->dop_rlink);
203  }
204 
205  return M0_RC(rc);
206 }
207 
208 M0_INTERNAL int
210  struct m0_fid *remote_srv)
211 {
212  struct dtm0_process *process =
213  dtm0_service_process__lookup(s, remote_srv);
214 
215  M0_ENTRY("rs=%p, remote="FID_F, s, FID_P(remote_srv));
216 
217  return process == NULL ? M0_ERR(-ENOENT) :
218  M0_RC(dtm0_process_disconnect(process));
219 }
220 
221 M0_INTERNAL struct m0_rpc_session *
223  const struct m0_fid *remote_srv)
224 {
225  struct dtm0_process *process =
226  dtm0_service_process__lookup(s, remote_srv);
227 
228  return process == NULL ? NULL : &process->dop_rlink.rlk_sess;
229 }
230 
232  const struct m0_reqh_service_type *stype,
233  const struct m0_reqh_service_ops *ops)
234 {
235  struct m0_dtm0_service *s;
236 
237  M0_PRE(stype != NULL && service != NULL && ops != NULL);
238 
239  M0_ALLOC_PTR(s);
240  if (s == NULL)
241  return M0_ERR(-ENOMEM);
242 
243  s->dos_generic.rs_type = stype;
244  s->dos_generic.rs_ops = ops;
246  *service = &s->dos_generic;
247 
248  return M0_RC(0);
249 }
250 
252  const struct m0_reqh_service_type *stype)
253 {
255 }
256 
257 static int volatile_log_init(struct m0_dtm0_service *dtm0)
258 {
259  int rc;
260 
261  rc = m0_be_dtm0_log_alloc(&dtm0->dos_log);
262  if (rc == 0) {
264  &dtm0->dos_clk_src, false);
265  if (rc != 0)
267  }
268  return rc;
269 }
270 
271 static int persistent_log_init(struct m0_dtm0_service *dtm0)
272 {
273  struct m0_reqh *reqh = dtm0->dos_generic.rs_reqh;
274 
275  M0_PRE(reqh != NULL);
276 
277  dtm0->dos_log = m0_reqh_lockers_get(reqh, m0_get()->i_dtm0_log_key);
278  /* 0type should create it during mkfs */
279  M0_ASSERT_INFO(dtm0->dos_log != NULL, "Forgot to do mkfs?");
280 
281  return m0_be_dtm0_log_init(dtm0->dos_log, reqh->rh_beseg,
282  &dtm0->dos_clk_src, true);
283 }
284 
286 {
287  struct m0_conf_service *service_obj;
288  struct m0_conf_obj *obj;
290  const char **param;
291  struct m0_dtm0_service *dtm0 = to_dtm(service);
292  int rc;
293 
294  M0_ENTRY("rs_svc=%p", service);
295 
296  /* W/A for UTs */
297  if (!m0_confc_is_inited(confc)) {
299  goto out;
300  }
301 
303  if (obj == NULL)
304  return M0_ERR(-ENOENT);
305 
306  service_obj = M0_CONF_CAST(obj, m0_conf_service);
307 
308  if (service_obj->cs_params == NULL) {
310  M0_LOG(M0_WARN, "dtm0 is treated as volatile,"
311  " no parameters given");
312  goto out;
313  }
314 
315  for (param = service_obj->cs_params; *param != NULL; ++param) {
316  if (m0_streq(*param, "origin:in-volatile"))
318  else if (m0_streq(*param, "origin:in-persistent"))
320  }
321 
322 out:
323  if (dtm0->dos_origin == DTM0_ON_VOLATILE)
324  rc = volatile_log_init(dtm0);
325  else if (dtm0->dos_origin == DTM0_ON_PERSISTENT)
326  rc = persistent_log_init(dtm0);
327  else
328  rc = M0_ERR(-EINVAL);
329 
330  return M0_RC_INFO(rc, "origin=%d", dtm0->dos_origin);
331 }
332 
334 {
335  M0_PRE(service != NULL);
337 }
338 
339 static void dtm0_service_prepare_to_stop(struct m0_reqh_service *reqh_rs)
340 {
341  struct m0_dtm0_service *dtms;
342 
343  M0_PRE(reqh_rs != NULL);
344  dtms = M0_AMB(dtms, reqh_rs, dos_generic);
346 }
347 
349 {
350  struct m0_dtm0_service *dtm0;
351 
352  M0_PRE(service != NULL);
353  dtm0 = to_dtm(service);
354 
360  if (dtm0->dos_origin == DTM0_ON_VOLATILE && dtm0->dos_log != NULL) {
364  }
365 }
366 
368 {
369  M0_PRE(service != NULL);
371  m0_free(service);
372 }
373 
374 M0_INTERNAL int m0_dtm0_stype_init(void)
375 {
376  extern struct m0_sm_conf m0_dtx_sm_conf;
377 
380  m0_dtm0_fop_init() ?:
383 }
384 
385 M0_INTERNAL void m0_dtm0_stype_fini(void)
386 {
387  extern struct m0_sm_conf m0_dtx_sm_conf;
391 }
392 
394 {
395  return m0_streq(service->rs_type->rst_name, "M0_CST_DTM0") &&
397 }
398 
400 {
401  return m0_streq(service->rs_type->rst_name, "M0_CST_DTM0") &&
403 }
404 
405 M0_INTERNAL struct m0_dtm0_service *
407 {
408  struct m0_reqh_service *rh_srv;
409 
411 
412  return rh_srv == NULL ? NULL : to_dtm(rh_srv);
413 }
414 
415 M0_INTERNAL bool m0_dtm0_in_ut(void)
416 {
417  return M0_FI_ENABLED("ut");
418 }
419 
420 
421 M0_INTERNAL int dtm0_process_init(struct dtm0_process *proc,
422  struct m0_dtm0_service *dtms,
423  const struct m0_fid *rem_svc_fid)
424 {
425  struct m0_conf_process *rem_proc_conf;
426  struct m0_conf_service *rem_svc_conf;
427  struct m0_conf_obj *obj;
428  struct m0_reqh *reqh;
429  struct m0_conf_cache *cache;
430 
431  M0_ENTRY("proc=%p, dtms=%p, rem=" FID_F, proc, dtms,
432  FID_P(rem_svc_fid));
433 
434  reqh = dtms->dos_generic.rs_reqh;
436 
437  obj = m0_conf_cache_lookup(cache, rem_svc_fid);
438  if (obj == NULL)
439  return M0_ERR_INFO(-ENOENT,
440  "Cannot find svc" FID_F
441  " in the conf cache.", FID_P(rem_svc_fid));
442  rem_svc_conf = M0_CONF_CAST(obj, m0_conf_service);
444  M0_ASSERT_INFO(obj != NULL, "Service " FID_F " does not belong to "
445  "any process?", FID_P(rem_svc_fid));
446 
447  rem_proc_conf = M0_CONF_CAST(obj, m0_conf_process);
448  if (rem_svc_conf->cs_type != M0_CST_DTM0)
449  return M0_ERR_INFO(-ENOENT, "Not a DTM0 service.");
450 
451  dopr_tlink_init(proc);
452  dopr_tlist_add(&dtms->dos_processes, proc);
453 
454  proc->dop_rproc_fid = rem_proc_conf->pc_obj.co_id;
455  proc->dop_rserv_fid = rem_svc_conf->cs_obj.co_id;
456 
457  proc->dop_rep = m0_strdup(rem_proc_conf->pc_endpoint);
458 
460 
461  return M0_RC(0);
462 }
463 
464 M0_INTERNAL void dtm0_process_fini(struct dtm0_process *proc)
465 {
466  dopr_tlink_fini(proc);
467  m0_free(proc->dop_rep);
469 }
470 
472 {
473  struct dtm0_process *process;
474  int rc;
475 
476  M0_ENTRY("dtms=%p", service);
477 
478  while ((process = dopr_tlist_pop(&service->dos_processes)) != NULL) {
479  rc = dtm0_process_disconnect(process);
480  M0_ASSERT_INFO(rc == 0, "Failed to disconnect from %p?",
481  process);
482  dtm0_process_fini(process);
483  m0_free(process);
484  }
485 
486  M0_LEAVE();
487 }
488 
489 /*
490  * Local variables:
491  * c-indentation-style: "K&R"
492  * c-basic-offset: 8
493  * tab-width: 8
494  * fill-column: 80
495  * scroll-step: 1
496  * End:
497  */
static int dtm0_service__alloc(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype, const struct m0_reqh_service_ops *ops)
Definition: service.c:231
M0_INTERNAL int m0_dtm0_stype_init(void)
Definition: service.c:374
struct m0_fid co_id
Definition: obj.h:208
Definition: beck.c:235
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)
Definition: service.c:393
static void dtm0_service_fini(struct m0_reqh_service *service)
Definition: service.c:367
struct m0_reqh_service * reqh_svc
Definition: rm_foms.c:49
const char * pc_endpoint
Definition: obj.h:590
#define M0_PRE(cond)
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
Definition: reqh_service.c:343
char * dop_rep
Definition: svc_internal.h:66
static void dtm0_service_prepare_to_stop(struct m0_reqh_service *service)
Definition: service.c:339
int(* rso_start)(struct m0_reqh_service *service)
Definition: reqh_service.h:360
M0_INTERNAL int dtm0_process_init(struct dtm0_process *proc, struct m0_dtm0_service *dtms, const struct m0_fid *rem_svc_fid)
Definition: service.c:421
#define m0_strdup(s)
Definition: string.h:43
M0_INTERNAL int m0_sm_addb2_init(struct m0_sm_conf *conf, uint64_t id, uint64_t counter)
Definition: sm.c:846
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
Definition: reqh_service.c:402
#define NULL
Definition: misc.h:38
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_service_find(const struct m0_reqh *reqh)
Definition: service.c:406
M0_INTERNAL void m0_be_dtm0_log_free(struct m0_be_dtm0_log **in_log)
Definition: dtm0_log.c:119
M0_INTERNAL void m0_dtm_client_service_stop(struct m0_reqh_service *svc)
Definition: service.c:139
M0_INTERNAL void dtm0_process_fini(struct dtm0_process *proc)
Definition: service.c:464
Definition: sm.h:350
M0_INTERNAL struct m0_conf_obj * m0_conf_cache_lookup(const struct m0_conf_cache *cache, const struct m0_fid *id)
Definition: cache.c:106
uint64_t m0_time_t
Definition: time.h:37
#define M0_LOG(level,...)
Definition: trace.h:167
M0_LEAVE()
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
Definition: reqh_service.c:375
static int dtm0_process_disconnect(struct dtm0_process *process)
Definition: service.c:170
static const struct m0_bob_type dtm0_service_bob
Definition: service.c:74
static int dtm0_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: service.c:251
static const struct m0_reqh_service_ops dtm0_service_ops
Definition: service.c:53
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)
Definition: dtm0_log.c:111
M0_INTERNAL struct m0 * m0_get(void)
Definition: instance.c:41
M0_INTERNAL struct dtm0_process * dtm0_service_process__lookup(struct m0_reqh_service *reqh_dtm0_svc, const struct m0_fid *remote_dtm0)
Definition: service.c:149
M0_INTERNAL void dtm0_service_conns_term(struct m0_dtm0_service *service)
Definition: service.c:471
#define M0_SET0(obj)
Definition: misc.h:64
static void dtm0_service_stop(struct m0_reqh_service *service)
Definition: service.c:348
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
Definition: reqh_service.c:473
static struct foo * obj
Definition: tlist.c:302
const char * bt_name
Definition: bob.h:73
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
Definition: reqh_service.c:168
static void dtm0_service__fini(struct m0_dtm0_service *s)
Definition: service.c:104
M0_INTERNAL void m0_be_dtm0_log_clear(struct m0_be_dtm0_log *log)
Definition: dtm0_log.c:520
return M0_RC(rc)
struct m0_be_dtm0_log * dos_log
Definition: service.h:50
#define M0_ENTRY(...)
Definition: trace.h:170
M0_INTERNAL bool m0_dtm0_is_a_persistent_dtm(struct m0_reqh_service *service)
Definition: service.c:399
M0_INTERNAL int m0_dtm0_fop_init(void)
Definition: fop.c:166
enum m0_dtm0_service_origin dos_origin
Definition: service.h:47
struct m0_fid dop_rserv_fid
Definition: svc_internal.h:64
#define M0_RC_INFO(rc, fmt,...)
Definition: trace.h:209
#define M0_ERR_INFO(rc, fmt,...)
Definition: trace.h:215
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_dtm0_dtx_domain_init(void)
Definition: dtx.c:90
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
Definition: reqh.c:753
#define M0_AMB(obj, ptr, field)
Definition: misc.h:320
static const struct socktype stype[]
Definition: sock.c:1156
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)
Definition: dtm0_log.c:94
static int volatile_log_init(struct m0_dtm0_service *dtm0)
Definition: service.c:257
struct m0_long_lock dop_llock
Definition: svc_internal.h:71
static struct m0_confc * confc
Definition: file.c:94
M0_INTERNAL int m0_be_dtm0_log_alloc(struct m0_be_dtm0_log **out)
Definition: dtm0_log.c:70
static int dtm0_service_start(struct m0_reqh_service *service)
Definition: service.c:333
M0_INTERNAL void m0_dtm0_stype_fini(void)
Definition: service.c:385
const char * rst_name
Definition: reqh_service.h:447
struct m0_conf_obj * m0_conf_obj_grandparent(const struct m0_conf_obj *obj)
Definition: obj.c:384
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
Definition: reqh_service.c:457
struct m0_fid rs_service_fid
Definition: reqh_service.h:220
#define bob_of(ptr, type, field, bt)
Definition: bob.h:140
#define m0_streq(a, b)
Definition: string.h:34
M0_INTERNAL int m0_dtm_client_service_start(struct m0_reqh *reqh, struct m0_fid *cli_srv_fid, struct m0_reqh_service **out)
Definition: service.c:113
M0_INTERNAL int m0_dtm0_service_process_disconnect(struct m0_reqh_service *s, struct m0_fid *remote_srv)
Definition: service.c:209
static int dtm_service__origin_fill(struct m0_reqh_service *service)
Definition: service.c:285
struct m0_dtm0_clk_src dos_clk_src
Definition: service.h:49
struct m0_conf_cache cc_cache
Definition: confc.h:394
M0_INTERNAL void m0_dtm0_dtx_domain_fini(void)
Definition: dtx.c:98
static int persistent_log_init(struct m0_dtm0_service *dtm0)
Definition: service.c:271
static void dtm0_service__init(struct m0_dtm0_service *s)
Definition: service.c:96
M0_INTERNAL void m0_sm_addb2_fini(struct m0_sm_conf *conf)
Definition: sm.c:870
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
Definition: reqh_service.c:185
Definition: reqh.h:94
Definition: dump.c:103
M0_INTERNAL void m0_dtm0_fop_fini(void)
Definition: fop.c:100
struct m0_sm_conf m0_dtx_sm_conf
Definition: dtx.c:82
enum m0_conf_service_type cs_type
Definition: obj.h:598
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
Definition: reqh_service.c:428
#define M0_CONF_CAST(ptr, type)
Definition: obj.h:780
M0_INTERNAL bool m0_confc_is_inited(const struct m0_confc *confc)
Definition: confc.c:448
struct m0_fid dop_rproc_fid
Definition: svc_internal.h:62
struct m0_rpc_link dop_rlink
Definition: svc_internal.h:60
#define FID_P(f)
Definition: fid.h:77
M0_TL_DEFINE(dopr, static, struct dtm0_process)
const char ** cs_params
Definition: obj.h:611
static uint32_t timeout
Definition: console.c:52
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
Definition: fid.c:164
M0_INTERNAL void m0_long_lock_init(struct m0_long_lock *lock)
Definition: fom.h:481
struct m0_conf_obj pc_obj
Definition: obj.h:581
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)
Definition: reqh_service.c:538
struct m0_reqh reqh
Definition: rm_foms.c:48
#define M0_MAGIX_OFFSET(type, field)
Definition: misc.h:356
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: reqh_service.h:435
struct m0_reqh_service_type dtm0_service_type
Definition: service.c:60
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
Definition: fid.h:38
const struct m0_reqh_service_type * rs_type
Definition: reqh_service.h:227
M0_INTERNAL void m0_dtm0_clk_src_fini(struct m0_dtm0_clk_src *cs)
Definition: clk_src.c:49
#define M0_IS0(obj)
Definition: misc.h:70
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
struct m0_conf_obj cs_obj
Definition: obj.h:595
m0_time_t m0_time_from_now(uint64_t secs, long ns)
Definition: time.c:96
struct m0_tl dos_processes
Definition: service.h:46
static struct m0_net_test_service svc
Definition: service.c:34
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_fom2service(struct m0_fom *fom)
Definition: service.c:88
M0_INTERNAL void m0_reqh_idle_wait_for(struct m0_reqh *reqh, struct m0_reqh_service *service)
Definition: reqh.c:591
struct m0_be_seg * rh_beseg
Definition: reqh.h:112
#define M0_ASSERT_INFO(cond, fmt,...)
#define out(...)
Definition: gen.c:41
static const struct m0_reqh_service_type_ops dtm0_service_type_ops
Definition: service.c:49
M0_INTERNAL int m0_dtm0_service_process_connect(struct m0_reqh_service *s, struct m0_fid *remote_srv, const char *remote_ep, bool async)
Definition: service.c:158
struct m0_fom_ops ops
Definition: io_foms.c:623
#define m0_tl_find(name, var, head,...)
Definition: tlist.h:757
struct m0_reqh * rs_reqh
Definition: reqh_service.h:259
void m0_free(void *data)
Definition: memory.c:146
static struct m0_addb2_source * s
Definition: consumer.c:39
M0_INTERNAL void m0_dtm0_clk_src_init(struct m0_dtm0_clk_src *cs, enum m0_dtm0_cs_types type)
Definition: clk_src.c:38
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
Definition: reqh_service.c:490
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
struct m0_reqh_service dos_generic
Definition: service.h:45
int32_t rc
Definition: trigger_fop.h:47
M0_INTERNAL struct m0_rpc_session * m0_dtm0_service_process_session_get(struct m0_reqh_service *s, const struct m0_fid *remote_srv)
Definition: service.c:222
static struct m0_dtm0_service * to_dtm(struct m0_reqh_service *service)
Definition: service.c:82
#define FID_F
Definition: fid.h:75
Definition: trace.h:478
M0_INTERNAL bool m0_dtm0_in_ut(void)
Definition: service.c:415