26 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SSS 150 (*service)->rs_type =
stype;
163 .rst_typecode = M0_CST_SSS,
164 .rst_keep_alive =
true,
229 .sd_name =
"SS_FOM_SWITCH",
236 .sd_name =
"SS_FOM_SVC_INIT",
240 .sd_name =
"SS_FOM_START",
244 .sd_name =
"SS_FOM_START_WAIT",
248 .sd_name =
"SS_FOM_QUIESCE",
252 .sd_name =
"SS_FOM_STOP",
256 .sd_name =
"SS_FOM_STATUS",
260 .sd_name =
"SS_FOM_HEALTH",
288 if (ssrep_fop ==
NULL)
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);
326 health =
svc->rs_ops->rso_health(
svc);
378 if (
m->ssf_svc !=
NULL)
494 if (
rep->ssr_rc != 0)
501 if (
m->ssf_svc !=
NULL)
519 if (
m->ssf_ctx.sac_rc == 0)
523 rep->ssr_rc =
m->ssf_ctx.sac_rc;
540 if (
rep->ssr_rc == -EBUSY)
586 #undef M0_TRACE_SUBSYSTEM M0_INTERNAL int m0_ss_fops_init(void)
M0_INTERNAL int m0_reqh_service_state_get(const struct m0_reqh_service *s)
M0_INTERNAL int m0_reqh_service_start_async(struct m0_reqh_service_start_async_ctx *asc)
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
static size_t ss_fom_home_locality(const struct m0_fom *fom)
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_lookup(const struct m0_reqh *reqh, const struct m0_fid *fid)
static int ss_fom_tick__start(struct m0_reqh_service *svc, struct m0_fom *fom, struct m0_reqh_service_start_async_ctx *ctx)
int(* rso_start)(struct m0_reqh_service *service)
static void ss_svc_rso_fini(struct m0_reqh_service *service)
const struct m0_fom_ops ss_fom_ops
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
M0_INTERNAL void m0_sss_device_fops_fini(void)
static struct m0_addb2_mach * m
static const struct m0_reqh_service_ops ss_svc_ops
int(* fo_tick)(struct m0_fom *fom)
static enum m0_service_health ss_svc_rso_health(struct m0_reqh_service *service)
#define M0_LOG(level,...)
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
static int ss_fom_tick__svc_alloc(struct ss_fom *m, const struct m0_sss_req *fop, struct m0_reqh *reqh)
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
static int ss_fom_tick__quiesce(struct m0_reqh_service *svc)
M0_INTERNAL void m0_ss_svc_fini(void)
enum ss_fom_stage ssf_stage
static const struct m0_reqh_service_type_ops ss_svc_type_ops
void * m0_fop_data(const struct m0_fop *fop)
static enum m0_service_health ss_svc_health(struct m0_reqh_service *svc)
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
#define container_of(ptr, type, member)
struct m0_fop_getxattr_rep * rep
M0_INTERNAL void m0_ss_process_fops_fini(void)
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
struct m0_fom_type ft_fom_type
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
static int ss_fom_tick__stop(struct m0_reqh_service *svc, struct m0_reqh *reqh, struct m0_fom *fom)
struct m0_reqh_context rctx
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL int m0_ss_svc_init(void)
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)
struct m0_fop_type * f_type
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
#define M0_ERR_INFO(rc, fmt,...)
return M0_ERR(-EOPNOTSUPP)
struct m0_fop_type m0_fop_ss_rep_fopt
M0_INTERNAL struct m0_sm_conf ss_fom_conf
struct m0_reqh_service sss_reqhs
M0_INTERNAL bool m0_fom_domain_is_idle_for(const struct m0_reqh_service *svc)
static const struct socktype stype[]
int m0_fom_tick_generic(struct m0_fom *fom)
const struct m0_fid_type cot_ftype
void m0_fom_fini(struct m0_fom *fom)
static int ss_fom_tick(struct m0_fom *fom)
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
static int ss_svc_rsto_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
static int ss_fom_tick__init(struct ss_fom *m, const struct m0_sss_req *fop, const struct m0_reqh *reqh)
M0_INTERNAL const struct m0_fid_type * m0_fid_type_getfid(const struct m0_fid *fid)
struct m0_reqh_service_type m0_ss_svc_type
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_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
M0_INTERNAL int m0_ss_process_fops_init(void)
static int ss_svc_rso_start(struct m0_reqh_service *service)
M0_INTERNAL char * m0_buf_strdup(const struct m0_buf *buf)
struct m0_reqh_service_start_async_ctx ssf_ctx
M0_INTERNAL int m0_sss_device_fops_init(void)
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
#define M0_FI_ENABLED(tag)
#define M0_ALLOC_PTR(ptr)
const struct m0_fom_type_ops ss_fom_type_ops
struct m0_sm_group rh_sm_grp
static struct m0_net_test_service svc
static struct m0_fop * fop
static void ss_svc_rso_stop(struct m0_reqh_service *service)
#define IS_IN_ARRAY(idx, array)
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
M0_INTERNAL void m0_ss_fops_fini(void)
M0_INTERNAL void m0_reqh_service_started(struct m0_reqh_service *service)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
struct m0_reqh_service * ssf_svc
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
static void ss_fom_fini(struct m0_fom *fom)
M0_INTERNAL struct m0_reqh * m0_fom_reqh(const struct m0_fom *fom)
M0_INTERNAL void m0_reqh_service_failed(struct m0_reqh_service *service)
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
#define M0_IMPOSSIBLE(fmt,...)
static int ss_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)