Motr  M0
ss_svc.c File Reference
#include "lib/trace.h"
#include "lib/assert.h"
#include "lib/errno.h"
#include "lib/finject.h"
#include "lib/misc.h"
#include "lib/memory.h"
#include "fop/fop.h"
#include "fop/fom_generic.h"
#include "reqh/reqh_service.h"
#include "rpc/rpc_opcodes.h"
#include "motr/setup.h"
#include "spiel/spiel.h"
#include "sss/process_fops.h"
#include "sss/device_fops.h"
#include "sss/ss_fops.h"
#include "sss/ss_svc.h"
Include dependency graph for ss_svc.c:

Go to the source code of this file.

Data Structures

struct  ss_svc
 
struct  ss_fom
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SSS
 

Enumerations

enum  ss_fom_stage { SS_FOM_STAGE_BEFORE_TX, SS_FOM_STAGE_AFTER_TX }
 

Functions

static int ss_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
static int ss_fom_tick (struct m0_fom *fom)
 
static int ss_fom_tick__init (struct ss_fom *m, const struct m0_sss_req *fop, const struct m0_reqh *reqh)
 
static void ss_fom_fini (struct m0_fom *fom)
 
static size_t ss_fom_home_locality (const struct m0_fom *fom)
 
static int ss_svc_rso_start (struct m0_reqh_service *service)
 
static void ss_svc_rso_stop (struct m0_reqh_service *service)
 
static void ss_svc_rso_fini (struct m0_reqh_service *service)
 
static enum m0_service_health ss_svc_rso_health (struct m0_reqh_service *service)
 
static int ss_svc_rsto_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
 
M0_INTERNAL int m0_ss_svc_init (void)
 
M0_INTERNAL void m0_ss_svc_fini (void)
 
static enum m0_service_health ss_svc_health (struct m0_reqh_service *svc)
 
static int ss_fom_tick__svc_alloc (struct ss_fom *m, const struct m0_sss_req *fop, struct m0_reqh *reqh)
 
static int ss_fom_tick__start (struct m0_reqh_service *svc, struct m0_fom *fom, struct m0_reqh_service_start_async_ctx *ctx)
 
static int ss_fom_tick__stop (struct m0_reqh_service *svc, struct m0_reqh *reqh, struct m0_fom *fom)
 
static int ss_fom_tick__quiesce (struct m0_reqh_service *svc)
 

Variables

enum ss_fom_stage M0_XCA_DOMAIN
 
static const struct m0_reqh_service_ops ss_svc_ops
 
static const struct m0_reqh_service_type_ops ss_svc_type_ops
 
struct m0_reqh_service_type m0_ss_svc_type
 
const struct m0_fom_ops ss_fom_ops
 
const struct m0_fom_type_ops ss_fom_type_ops
 
struct m0_sm_state_descr ss_fom_phases []
 
M0_INTERNAL struct m0_sm_conf ss_fom_conf
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SSS

Definition at line 26 of file ss_svc.c.

Enumeration Type Documentation

◆ ss_fom_stage

Stages of Start Stop fom.

All custom phases of Start Stop FOM are separated into two stages.

One part of custom phases is executed outside of FOM local transaction context (before M0_FOPH_TXN_INIT phase), the other part is executed as usual for FOMs in context of local transaction.

Separation is done to prevent dead-lock between two exclusively opened BE transactions: one is in FOM local transaction context and the other one created during start service, like IO service.

See also
ss_fom_phases.
Enumerator
SS_FOM_STAGE_BEFORE_TX 

Phases of this stage are executed before M0_FOPH_TXN_INIT phase.

SS_FOM_STAGE_AFTER_TX 

Stage includes phases which works ordinary methods.

Definition at line 62 of file ss_svc.c.

Function Documentation

◆ ss_fom_create()

static int ss_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)
static

Definition at line 272 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_fom_fini()

static void ss_fom_fini ( struct m0_fom fom)
static

Definition at line 569 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_fom_home_locality()

static size_t ss_fom_home_locality ( const struct m0_fom fom)
static

Definition at line 581 of file ss_svc.c.

◆ ss_fom_tick()

static int ss_fom_tick ( struct m0_fom fom)
static

Definition at line 464 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_fom_tick__init()

static int ss_fom_tick__init ( struct ss_fom m,
const struct m0_sss_req fop,
const struct m0_reqh reqh 
)
static

Definition at line 333 of file ss_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ss_fom_tick__quiesce()

static int ss_fom_tick__quiesce ( struct m0_reqh_service svc)
static

Definition at line 453 of file ss_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ss_fom_tick__start()

static int ss_fom_tick__start ( struct m0_reqh_service svc,
struct m0_fom fom,
struct m0_reqh_service_start_async_ctx ctx 
)
static

Definition at line 409 of file ss_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ss_fom_tick__stop()

static int ss_fom_tick__stop ( struct m0_reqh_service svc,
struct m0_reqh reqh,
struct m0_fom fom 
)
static

Definition at line 425 of file ss_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ss_fom_tick__svc_alloc()

static int ss_fom_tick__svc_alloc ( struct ss_fom m,
const struct m0_sss_req fop,
struct m0_reqh reqh 
)
static

Definition at line 368 of file ss_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ss_svc_health()

static enum m0_service_health ss_svc_health ( struct m0_reqh_service svc)
static

Definition at line 310 of file ss_svc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ss_svc_rso_fini()

static void ss_svc_rso_fini ( struct m0_reqh_service service)
static

Definition at line 107 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_svc_rso_health()

static enum m0_service_health ss_svc_rso_health ( struct m0_reqh_service service)
static

Definition at line 118 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_svc_rso_start()

static int ss_svc_rso_start ( struct m0_reqh_service service)
static

Definition at line 96 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_svc_rso_stop()

static void ss_svc_rso_stop ( struct m0_reqh_service service)
static

Definition at line 102 of file ss_svc.c.

Here is the call graph for this function:

◆ ss_svc_rsto_service_allocate()

static int ss_svc_rsto_service_allocate ( struct m0_reqh_service **  service,
const struct m0_reqh_service_type stype 
)
static

Definition at line 133 of file ss_svc.c.

Here is the call graph for this function:

Variable Documentation

◆ M0_XCA_DOMAIN

enum ss_fom_stage M0_XCA_DOMAIN

◆ ss_fom_conf

M0_INTERNAL struct m0_sm_conf ss_fom_conf
Initial value:
= {
.scf_name = "ss-fom-sm",
.scf_nr_states = ARRAY_SIZE(ss_fom_phases),
.scf_state = ss_fom_phases
}
ss_fom_phases
Definition: ss_svc.h:118
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 265 of file ss_svc.c.

◆ ss_fom_ops

const struct m0_fom_ops ss_fom_ops
Initial value:
= {
.fo_tick = ss_fom_tick,
.fo_home_locality = ss_fom_home_locality,
.fo_fini = ss_fom_fini
}
static size_t ss_fom_home_locality(const struct m0_fom *fom)
Definition: ss_svc.c:581
static int ss_fom_tick(struct m0_fom *fom)
Definition: ss_svc.c:464
static void ss_fom_fini(struct m0_fom *fom)
Definition: ss_svc.c:569

Definition at line 216 of file ss_svc.c.

◆ ss_fom_phases

Definition at line 226 of file ss_svc.c.

◆ ss_fom_type_ops

const struct m0_fom_type_ops ss_fom_type_ops
Initial value:
= {
.fto_create = ss_fom_create
}
static int ss_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: ss_svc.c:272

Definition at line 222 of file ss_svc.c.

◆ ss_svc_ops

const struct m0_reqh_service_ops ss_svc_ops
static
Initial value:
= {
.rso_start = ss_svc_rso_start,
.rso_stop = ss_svc_rso_stop,
.rso_fini = ss_svc_rso_fini,
.rso_health = ss_svc_rso_health
}
static void ss_svc_rso_fini(struct m0_reqh_service *service)
Definition: ss_svc.c:107
static enum m0_service_health ss_svc_rso_health(struct m0_reqh_service *service)
Definition: ss_svc.c:118
static int ss_svc_rso_start(struct m0_reqh_service *service)
Definition: ss_svc.c:96
static void ss_svc_rso_stop(struct m0_reqh_service *service)
Definition: ss_svc.c:102

Definition at line 125 of file ss_svc.c.

◆ ss_svc_type_ops

const struct m0_reqh_service_type_ops ss_svc_type_ops
static
Initial value:
= {
.rsto_service_allocate = ss_svc_rsto_service_allocate
}
static int ss_svc_rsto_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: ss_svc.c:133

Definition at line 155 of file ss_svc.c.