Motr  M0
ss_svc.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 
26 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SSS
27 #include "lib/trace.h"
28 
29 #include "lib/assert.h"
30 #include "lib/errno.h"
31 #include "lib/finject.h" /* M0_FI_ENABLED */
32 #include "lib/misc.h"
33 #include "lib/memory.h"
34 #include "fop/fop.h"
35 #include "fop/fom_generic.h"
36 #include "reqh/reqh_service.h"
37 #include "rpc/rpc_opcodes.h"
38 #ifndef __KERNEL__
39 #include "motr/setup.h"
40 #endif
41 #include "spiel/spiel.h" /* m0_spiel_health */
42 #include "sss/process_fops.h"
43 #include "sss/device_fops.h"
44 #include "sss/ss_fops.h"
45 #include "sss/ss_svc.h"
46 
71 };
72 
74 struct ss_svc {
76 };
77 
79 struct ss_fom {
80  uint64_t ssf_magic;
81  struct m0_fom ssf_fom;
85 };
86 
87 
88 static int ss_fom_create(struct m0_fop *fop, struct m0_fom **out,
89  struct m0_reqh *reqh);
90 static int ss_fom_tick(struct m0_fom *fom);
91 static int ss_fom_tick__init(struct ss_fom *m, const struct m0_sss_req *fop,
92  const struct m0_reqh *reqh);
93 static void ss_fom_fini(struct m0_fom *fom);
94 static size_t ss_fom_home_locality(const struct m0_fom *fom);
95 
97 {
99  return 0;
100 }
101 
103 {
105 }
106 
108 {
109  struct ss_svc *svc = container_of(service, struct ss_svc, sss_reqhs);
110 
111  M0_ENTRY();
113 
114  m0_free(svc);
115  M0_LEAVE();
116 }
117 
119 {
120  M0_ENTRY("service %p", service);
121 
122  return M0_RC(M0_HEALTH_GOOD);
123 }
124 
125 static const struct m0_reqh_service_ops ss_svc_ops = {
127  .rso_stop = ss_svc_rso_stop,
128  .rso_fini = ss_svc_rso_fini,
129  .rso_health = ss_svc_rso_health
130 };
131 
132 static int
134  const struct m0_reqh_service_type *stype)
135 {
136  struct ss_svc *svc;
137 
138  M0_ENTRY();
139  M0_PRE(service != NULL && stype != NULL);
140 
141  if (M0_FI_ENABLED("fail_allocation"))
142  svc = NULL;
143  else
144  M0_ALLOC_PTR(svc);
145 
146  if (svc == NULL)
147  return M0_ERR(-ENOMEM);
148 
149  *service = &svc->sss_reqhs;
150  (*service)->rs_type = stype;
151  (*service)->rs_ops = &ss_svc_ops;
152  return M0_RC(0);
153 }
154 
157 };
158 
160  .rst_name = "M0_CST_SSS",
161  .rst_ops = &ss_svc_type_ops,
162  .rst_level = M0_SS_SVC_LEVEL,
163  .rst_typecode = M0_CST_SSS,
164  .rst_keep_alive = true,
165 };
166 
167 /*
168  * Public interfaces.
169  */
170 M0_INTERNAL int m0_ss_svc_init(void)
171 {
172  int rc;
173 
174  M0_ENTRY();
176  if (rc != 0)
177  return M0_ERR(rc);
178 
179  rc = m0_ss_fops_init();
180  if (rc != 0)
181  goto err_ss;
182 
184  if (rc != 0)
185  goto err_process;
186 
188  if (rc != 0)
189  goto err_device;
190 
191  return M0_RC(0);
192 
193 err_device:
195 err_process:
196  m0_ss_fops_fini();
197 err_ss:
199  return M0_ERR(rc);
200 }
201 
202 M0_INTERNAL void m0_ss_svc_fini(void)
203 {
204  M0_ENTRY();
207  m0_ss_fops_fini();
209  M0_LEAVE();
210 }
211 
212 /*
213  * Start Stop fom.
214  */
215 
216 const struct m0_fom_ops ss_fom_ops = {
217  .fo_tick = ss_fom_tick,
218  .fo_home_locality = ss_fom_home_locality,
219  .fo_fini = ss_fom_fini
220 };
221 
224 };
225 
227  [SS_FOM_SWITCH]= {
229  .sd_name = "SS_FOM_SWITCH",
230  .sd_allowed = M0_BITS(SS_FOM_SVC_INIT, SS_FOM_QUIESCE,
234  },
235  [SS_FOM_SVC_INIT]= {
236  .sd_name = "SS_FOM_SVC_INIT",
237  .sd_allowed = M0_BITS(M0_FOPH_SUCCESS, M0_FOPH_FAILURE),
238  },
239  [SS_FOM_START]= {
240  .sd_name = "SS_FOM_START",
241  .sd_allowed = M0_BITS(SS_FOM_START_WAIT, M0_FOPH_FAILURE),
242  },
243  [SS_FOM_START_WAIT]= {
244  .sd_name = "SS_FOM_START_WAIT",
245  .sd_allowed = M0_BITS(M0_FOPH_SUCCESS, M0_FOPH_FAILURE),
246  },
247  [SS_FOM_QUIESCE]= {
248  .sd_name = "SS_FOM_QUIESCE",
249  .sd_allowed = M0_BITS(M0_FOPH_SUCCESS, M0_FOPH_FAILURE),
250  },
251  [SS_FOM_STOP] = {
252  .sd_name = "SS_FOM_STOP",
253  .sd_allowed = M0_BITS(SS_FOM_STOP, M0_FOPH_SUCCESS),
254  },
255  [SS_FOM_STATUS]= {
256  .sd_name = "SS_FOM_STATUS",
257  .sd_allowed = M0_BITS(M0_FOPH_SUCCESS, M0_FOPH_FAILURE),
258  },
259  [SS_FOM_HEALTH]= {
260  .sd_name = "SS_FOM_HEALTH",
261  .sd_allowed = M0_BITS(M0_FOPH_SUCCESS, M0_FOPH_FAILURE),
262  },
263 };
264 
265 M0_INTERNAL struct m0_sm_conf ss_fom_conf = {
266  .scf_name = "ss-fom-sm",
267  .scf_nr_states = ARRAY_SIZE(ss_fom_phases),
268  .scf_state = ss_fom_phases
269 };
270 
271 static int
272 ss_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
273 {
274  struct ss_fom *ssfom;
275  struct m0_fom *fom;
276  struct m0_fop *rfop;
277  struct m0_sss_rep *ssrep_fop;
278 
279  M0_ENTRY();
280  M0_PRE(fop != NULL);
281  M0_PRE(out != NULL);
282 
283  M0_ALLOC_PTR(ssfom);
284  if (ssfom == NULL)
285  return M0_ERR(-ENOMEM);
286 
287  M0_ALLOC_PTR(ssrep_fop);
288  if (ssrep_fop == NULL)
289  goto err;
290 
291  rfop = m0_fop_alloc(&m0_fop_ss_rep_fopt, ssrep_fop,
293  if (rfop == NULL)
294  goto err;
295 
296  fom = &ssfom->ssf_fom;
298  &ss_fom_ops, fop, rfop, reqh);
299 
300  ssfom->ssf_magic = M0_SS_FOM_MAGIC;
301  *out = fom;
302  M0_LOG(M0_DEBUG, "fom %p, ss_fom %p", fom, ssfom);
303  return M0_RC(0);
304 err:
305  m0_free(ssrep_fop);
306  m0_free(ssfom);
307  return M0_ERR(-ENOMEM);
308 }
309 
311 {
312  enum m0_service_health health;
313 
314  M0_ENTRY();
315  M0_PRE(svc != NULL);
316 
318  health = M0_HEALTH_INACTIVE;
319  goto exit;
320  }
321  if (svc->rs_ops->rso_health == NULL) {
322  M0_LOG(M0_WARN, "rso_health isn't implemented, service type %s",
323  svc->rs_type->rst_name);
324  health = M0_HEALTH_UNKNOWN;
325  } else {
326  health = svc->rs_ops->rso_health(svc);
327  }
328 exit:
329  M0_LEAVE("health %d", health);
330  return health;
331 }
332 
333 static int ss_fom_tick__init(struct ss_fom *m, const struct m0_sss_req *fop,
334  const struct m0_reqh *reqh)
335 {
336  static const enum ss_fom_phases next_phase[][2] = {
343  };
344 
345  M0_ENTRY("cmd=%d fid:"FID_F, fop->ss_cmd, FID_P(&fop->ss_id));
346 
347  M0_PRE(M0_IN(m->ssf_stage,
349 
350  if (!IS_IN_ARRAY(fop->ss_cmd, next_phase) ||
352  return M0_ERR(-EINVAL);
353 
354  m->ssf_svc = m0_reqh_service_lookup(reqh, &fop->ss_id);
355 
356  if (m->ssf_svc == NULL && fop->ss_cmd != M0_SERVICE_INIT)
357  return M0_ERR(-ENOENT);
358 
359  if (m->ssf_svc != NULL && fop->ss_cmd == M0_SERVICE_INIT)
360  return M0_ERR(-EEXIST);
361 
362  m0_fom_phase_set(&m->ssf_fom, next_phase[fop->ss_cmd][m->ssf_stage]);
363  ++m->ssf_stage;
364  return M0_RC(0);
365 }
366 
367 #ifndef __KERNEL__
368 static int ss_fom_tick__svc_alloc(struct ss_fom *m,
369  const struct m0_sss_req *fop,
370  struct m0_reqh *reqh)
371 {
372  int rc;
373  char *name;
374  struct m0_reqh_service_type *stype;
375  struct m0_reqh_context *rctx =
377 
378  if (m->ssf_svc != NULL)
379  return M0_ERR(-EALREADY);
380 
381  name = m0_buf_strdup(&fop->ss_name);
382  if (name == NULL)
383  return M0_ERR(-ENOMEM);
384 
386  if (stype == NULL) {
387  m0_free(name);
388  return M0_ERR(-ENOENT);
389  }
390 
391  rc = m0_reqh_service_allocate(&m->ssf_svc, stype, rctx);
392  if (rc == 0) {
393  m0_reqh_service_init(m->ssf_svc, reqh, &fop->ss_id);
394  m0_buf_copy(&m->ssf_svc->rs_ss_param, &fop->ss_param);
395  }
396 
397  m0_free(name);
398  return M0_RC(rc);
399 }
400 #else
401 static int ss_fom_tick__svc_alloc(struct ss_fom *m M0_UNUSED,
402  const struct m0_sss_req *fop M0_UNUSED,
403  struct m0_reqh *reqh M0_UNUSED)
404 {
405  return M0_RC(0);
406 }
407 #endif /* __KERNEL__ */
408 
410  struct m0_fom *fom,
412 {
413  M0_ENTRY();
414  M0_PRE(svc != NULL);
415 
417  return M0_ERR_INFO(-EPROTO, "%d",
419 
420  ctx->sac_service = svc;
421  ctx->sac_fom = fom;
423 }
424 
426  struct m0_reqh *reqh,
427  struct m0_fom *fom)
428 {
429  int rc;
430 
431  M0_ENTRY();
432  M0_PRE(svc != NULL);
433  M0_PRE(reqh != NULL);
434 
436  return M0_ERR_INFO(-EPROTO, "%d",
438 
442  rc = 0;
443  } else {
445  m0_fom_wait_on(fom, &reqh->rh_sm_grp.s_chan, &fom->fo_cb);
447  rc = -EBUSY;
448  }
449 
450  return M0_RC(rc);
451 }
452 
454 {
455  M0_PRE(svc != NULL);
456 
458  return M0_ERR_INFO(-EPROTO, "%d",
461  return M0_RC(0);
462 }
463 
464 static int ss_fom_tick(struct m0_fom *fom)
465 {
466  struct ss_fom *m;
467  struct m0_reqh *reqh;
468  struct m0_sss_req *fop;
469  struct m0_sss_rep *rep;
470 
471  M0_ENTRY("fom %p, state %d", fom, m0_fom_phase(fom));
472  M0_PRE(fom != NULL);
473 
474  m = container_of(fom, struct ss_fom, ssf_fom);
475 
476  /* first handle generic phase */
477  if (m0_fom_phase(fom) < M0_FOPH_NR) {
479  if (m->ssf_stage == SS_FOM_STAGE_BEFORE_TX) {
481  return M0_FSO_AGAIN;
482  }
483  }
484  return m0_fom_tick_generic(fom);
485  }
486 
487  fop = m0_fop_data(fom->fo_fop);
488  rep = m0_fop_data(fom->fo_rep_fop);
489  reqh = m0_fom_reqh(fom);
490 
491  switch (m0_fom_phase(fom)) {
492  case SS_FOM_SWITCH:
493  rep->ssr_rc = ss_fom_tick__init(m, fop, reqh);
494  if (rep->ssr_rc != 0)
496  return M0_FSO_AGAIN;
497 
498  case SS_FOM_SVC_INIT:
499  rep->ssr_rc = ss_fom_tick__svc_alloc(m, fop, reqh);
500 
501  if (m->ssf_svc != NULL)
502  rep->ssr_state = m0_reqh_service_state_get(m->ssf_svc);
503 
506  M0_LOG(M0_DEBUG, "init: m %p svc %p", m, m->ssf_svc);
507  return M0_FSO_AGAIN;
508 
509  case SS_FOM_START:
510  M0_PRE(m->ssf_svc != NULL);
511  M0_LOG(M0_DEBUG, "start: m %p svc %p", m, m->ssf_svc);
512  rep->ssr_rc = ss_fom_tick__start(m->ssf_svc, fom, &m->ssf_ctx);
515  return rep->ssr_rc == 0 ? M0_FSO_WAIT : M0_FSO_AGAIN;
516 
517  case SS_FOM_START_WAIT:
518  M0_PRE(m->ssf_svc != NULL);
519  if (m->ssf_ctx.sac_rc == 0)
520  m0_reqh_service_started(m->ssf_svc);
521  else
522  m0_reqh_service_failed(m->ssf_svc);
523  rep->ssr_rc = m->ssf_ctx.sac_rc;
524  rep->ssr_state = m0_reqh_service_state_get(m->ssf_svc);
527  return M0_FSO_AGAIN;
528 
529  case SS_FOM_QUIESCE:
530  M0_PRE(m->ssf_svc != NULL);
531  rep->ssr_rc = ss_fom_tick__quiesce(m->ssf_svc);
532  rep->ssr_state = m0_reqh_service_state_get(m->ssf_svc);
535  return M0_FSO_AGAIN;
536 
537  case SS_FOM_STOP:
538  M0_PRE(m->ssf_svc != NULL);
539  rep->ssr_rc = ss_fom_tick__stop(m->ssf_svc, reqh, fom);
540  if (rep->ssr_rc == -EBUSY)
541  return M0_FSO_WAIT;
542 
543  M0_ASSERT(rep->ssr_rc == 0);
544  rep->ssr_state = M0_RST_STOPPED;
546  return M0_FSO_AGAIN;
547 
548  case SS_FOM_STATUS:
549  M0_PRE(m->ssf_svc != NULL);
550  M0_LOG(M0_DEBUG, "status: m %p svc %p", m, m->ssf_svc);
551  rep->ssr_state = m0_reqh_service_state_get(m->ssf_svc);
552  rep->ssr_rc = 0;
554  return M0_FSO_AGAIN;
555 
556  case SS_FOM_HEALTH:
557  M0_PRE(m->ssf_svc != NULL);
558  rep->ssr_state = m0_reqh_service_state_get(m->ssf_svc);
559  rep->ssr_rc = ss_svc_health(m->ssf_svc);
560  M0_ASSERT(rep->ssr_rc >= 0);
562  return M0_FSO_AGAIN;
563 
564  default:
565  M0_IMPOSSIBLE("Invalid phase");
566  }
567 }
568 
569 static void ss_fom_fini(struct m0_fom *fom)
570 {
571  struct ss_fom *m = container_of(fom, struct ss_fom, ssf_fom);
572 
573  M0_ENTRY();
574  M0_LOG(M0_DEBUG, "fom %p ss_fom %p", fom, m);
575  m0_fom_fini(fom);
576  m0_free(m);
577 
578  M0_LEAVE();
579 }
580 
581 static size_t ss_fom_home_locality(const struct m0_fom *fom)
582 {
583  return 1;
584 }
585 
586 #undef M0_TRACE_SUBSYSTEM
587 
588 /*
589  * Local variables:
590  * c-indentation-style: "K&R"
591  * c-basic-offset: 8
592  * tab-width: 8
593  * fill-column: 80
594  * scroll-step: 1
595  * End:
596  */
M0_INTERNAL int m0_ss_fops_init(void)
Definition: ss_fops.c:51
M0_INTERNAL int m0_reqh_service_state_get(const struct m0_reqh_service *s)
Definition: reqh_service.c:560
M0_INTERNAL int m0_reqh_service_start_async(struct m0_reqh_service_start_async_ctx *asc)
Definition: reqh_service.c:272
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
Definition: fom.c:1710
static size_t ss_fom_home_locality(const struct m0_fom *fom)
Definition: ss_svc.c:581
#define M0_PRE(cond)
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_lookup(const struct m0_reqh *reqh, const struct m0_fid *fid)
Definition: reqh_service.c:551
static int ss_fom_tick__start(struct m0_reqh_service *svc, struct m0_fom *fom, struct m0_reqh_service_start_async_ctx *ctx)
Definition: ss_svc.c:409
int(* rso_start)(struct m0_reqh_service *service)
Definition: reqh_service.h:360
static void ss_svc_rso_fini(struct m0_reqh_service *service)
Definition: ss_svc.c:107
const struct m0_fom_ops ss_fom_ops
Definition: ss_svc.c:216
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 void m0_sss_device_fops_fini(void)
Definition: device_fops.c:80
static struct m0_addb2_mach * m
Definition: consumer.c:38
static const struct m0_reqh_service_ops ss_svc_ops
Definition: ss_svc.c:125
Definition: sm.h:350
ss_fom_phases
Definition: ss_svc.h:118
int(* fo_tick)(struct m0_fom *fom)
Definition: fom.h:663
static enum m0_service_health ss_svc_rso_health(struct m0_reqh_service *service)
Definition: ss_svc.c:118
#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
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
Definition: service.c:156
static int ss_fom_tick__svc_alloc(struct ss_fom *m, const struct m0_sss_req *fop, struct m0_reqh *reqh)
Definition: ss_svc.c:368
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
static int ss_fom_tick__quiesce(struct m0_reqh_service *svc)
Definition: ss_svc.c:453
M0_INTERNAL void m0_ss_svc_fini(void)
Definition: ss_svc.c:202
enum ss_fom_stage ssf_stage
Definition: ss_svc.c:84
static const struct m0_reqh_service_type_ops ss_svc_type_ops
Definition: ss_svc.c:155
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
struct m0_chan s_chan
Definition: sm.h:518
Definition: ss_svc.c:74
static enum m0_service_health ss_svc_health(struct m0_reqh_service *svc)
Definition: ss_svc.c:310
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
Definition: fom.c:1490
#define M0_BITS(...)
Definition: misc.h:236
#define container_of(ptr, type, member)
Definition: misc.h:33
struct m0_fop_getxattr_rep * rep
Definition: dir.c:455
M0_INTERNAL void m0_ss_process_fops_fini(void)
Definition: process_fops.c:102
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
Definition: reqh_service.c:473
m0_fom_phase
Definition: fom.h:372
struct m0_fom_type ft_fom_type
Definition: fop.h:232
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
Definition: reqh_service.c:168
static int ss_fom_tick__stop(struct m0_reqh_service *svc, struct m0_reqh *reqh, struct m0_fom *fom)
Definition: ss_svc.c:425
return M0_RC(rc)
#define M0_ENTRY(...)
Definition: trace.h:170
struct m0_reqh_context rctx
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
Definition: sm.c:96
M0_INTERNAL int m0_ss_svc_init(void)
Definition: ss_svc.c:170
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
Definition: fom.c:1372
struct m0_fop_type * f_type
Definition: fop.h:81
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
Definition: fop.c:360
#define M0_ERR_INFO(rc, fmt,...)
Definition: trace.h:215
return M0_ERR(-EOPNOTSUPP)
struct m0_fop_type m0_fop_ss_rep_fopt
Definition: ss_fops.c:40
m0_service_health
Definition: reqh_service.h:306
M0_INTERNAL struct m0_sm_conf ss_fom_conf
Definition: ss_svc.c:265
const char * name
Definition: trace.c:110
struct m0_reqh_service sss_reqhs
Definition: ss_svc.c:75
M0_INTERNAL bool m0_fom_domain_is_idle_for(const struct m0_reqh_service *svc)
Definition: fom.c:1281
static const struct socktype stype[]
Definition: sock.c:1156
int m0_fom_tick_generic(struct m0_fom *fom)
Definition: fom_generic.c:848
const struct m0_fid_type cot_ftype
Definition: obj.h:314
void m0_fom_fini(struct m0_fom *fom)
Definition: fom.c:1324
static int ss_fom_tick(struct m0_fom *fom)
Definition: ss_svc.c:464
#define M0_ASSERT(cond)
const char * scf_name
Definition: sm.h:352
const char * rst_name
Definition: reqh_service.h:447
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
Definition: fom.c:1699
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
Definition: reqh_service.c:457
static int ss_svc_rsto_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: ss_svc.c:133
struct m0_reqh rc_reqh
Definition: setup.h:312
static int ss_fom_tick__init(struct ss_fom *m, const struct m0_sss_req *fop, const struct m0_reqh *reqh)
Definition: ss_svc.c:333
uint64_t ssf_magic
Definition: ss_svc.c:80
M0_INTERNAL const struct m0_fid_type * m0_fid_type_getfid(const struct m0_fid *fid)
Definition: fid.c:76
struct m0_reqh_service_type m0_ss_svc_type
Definition: ss_svc.c:159
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_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
Definition: reqh_service.c:428
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
Definition: buf.c:104
#define FID_P(f)
Definition: fid.h:77
uint32_t sd_flags
Definition: sm.h:378
M0_INTERNAL int m0_ss_process_fops_init(void)
Definition: process_fops.c:56
Definition: fom.h:481
static int ss_svc_rso_start(struct m0_reqh_service *service)
Definition: ss_svc.c:96
M0_INTERNAL char * m0_buf_strdup(const struct m0_buf *buf)
Definition: buf.c:140
struct m0_reqh_service_start_async_ctx ssf_ctx
Definition: ss_svc.c:82
struct m0_reqh reqh
Definition: rm_foms.c:48
M0_INTERNAL int m0_sss_device_fops_init(void)
Definition: device_fops.c:46
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: reqh_service.h:435
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
const struct m0_fom_type_ops ss_fom_type_ops
Definition: ss_svc.c:222
struct m0_sm_group rh_sm_grp
Definition: reqh.h:107
static struct m0_net_test_service svc
Definition: service.c:34
static struct m0_fop * fop
Definition: item.c:57
static void ss_svc_rso_stop(struct m0_reqh_service *service)
Definition: ss_svc.c:102
#define IS_IN_ARRAY(idx, array)
Definition: misc.h:311
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
Definition: sm.c:83
M0_INTERNAL void m0_ss_fops_fini(void)
Definition: ss_fops.c:90
M0_INTERNAL void m0_reqh_service_started(struct m0_reqh_service *service)
Definition: reqh_service.c:311
Definition: nucleus.c:42
#define out(...)
Definition: gen.c:41
void m0_fom_phase_set(struct m0_fom *fom, int phase)
Definition: fom.c:1688
struct m0_reqh_service * ssf_svc
Definition: ss_svc.c:83
void m0_free(void *data)
Definition: memory.c:146
struct m0_fom ssf_fom
Definition: ss_svc.c:81
Definition: ss_svc.c:79
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
Definition: reqh_service.c:490
ss_fom_stage
Definition: ss_svc.c:62
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
int32_t rc
Definition: trigger_fop.h:47
static void ss_fom_fini(struct m0_fom *fom)
Definition: ss_svc.c:569
#define ARRAY_SIZE(a)
Definition: misc.h:45
Definition: fop.h:79
#define FID_F
Definition: fid.h:75
M0_INTERNAL struct m0_reqh * m0_fom_reqh(const struct m0_fom *fom)
Definition: fom.c:283
Definition: trace.h:478
M0_INTERNAL void m0_reqh_service_failed(struct m0_reqh_service *service)
Definition: reqh_service.c:326
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
Definition: fop.c:96
#define M0_IMPOSSIBLE(fmt,...)
static int ss_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: ss_svc.c:272
#define M0_UNUSED
Definition: misc.h:380