Motr  M0
common_service.c File Reference
#include "lib/arith.h"
#include "lib/errno.h"
#include "cm/ut/common_service.h"
#include "rpc/rpc_opcodes.h"
#include "motr/setup.h"
#include "ha/msg.h"
Include dependency graph for common_service.c:

Go to the source code of this file.

Functions

struct m0_ut_cmcm2utcm (struct m0_cm *cm)
 
static int cm_ut_service_start (struct m0_reqh_service *service)
 
static void cm_ut_service_stop (struct m0_reqh_service *service)
 
static void cm_ut_service_fini (struct m0_reqh_service *service)
 
static void cm_cp_ut_free (struct m0_cm_cp *cp)
 
static bool cm_cp_ut_invariant (const struct m0_cm_cp *cp)
 
static struct m0_cm_cpcm_ut_cp_alloc (struct m0_cm *cm)
 
static int cm_ut_setup (struct m0_cm *cm)
 
static int cm_ut_prepare (struct m0_cm *cm)
 
static int cm_ut_start (struct m0_cm *cm)
 
static void cm_ut_stop (struct m0_cm *cm)
 
static int cm_ut_data_next (struct m0_cm *cm, struct m0_cm_cp *cp)
 
static void cm_ag_ut_fini (struct m0_cm_aggr_group *ag)
 
static uint64_t cm_ag_ut_local_cp_nr (const struct m0_cm_aggr_group *ag)
 
static int cm_ut_ag_alloc (struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, struct m0_cm_aggr_group **out)
 
static int cm_ut_ag_next (struct m0_cm *cm, const struct m0_cm_ag_id *id_curr, struct m0_cm_ag_id *id_next)
 
static void cm_ut_ha_msg (struct m0_cm *cm, struct m0_ha_msg *msg, int rc)
 
static void cm_ut_fini (struct m0_cm *cm)
 
static int cm_ut_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
 
 M0_CM_TYPE_DECLARE (cm_ut, M0_CM_UT_OPCODE, &cm_ut_service_type_ops, "cm_ut", 0)
 
void cm_ut_service_alloc_init (struct m0_reqh *reqh)
 
void cm_ut_service_cleanup ()
 

Variables

struct m0_cm_cp cm_ut_cp
 
struct m0_ut_cm cm_ut [MAX_CM_NR]
 
struct m0_reqh_servicecm_ut_service
 
struct m0_ut_rpc_mach_ctx cmut_rmach_ctx
 
const char lfname [] = "cm_ut.errlog"
 
FILE * lf
 
uint64_t ut_cm_id
 
static const struct m0_reqh_service_ops cm_ut_service_ops
 
static const struct m0_cm_cp_ops cm_cp_ut_ops
 
const struct m0_cm_aggr_group_ops cm_ag_ut_ops
 
struct m0_cm_aggr_group aggr_grps [MAX_CM_NR][MAX_CM_NR]
 
struct m0_cm_ag_id ag_ids [MAX_CM_NR][MAX_CM_NR]
 
uint64_t ag_id_cnt [MAX_CM_NR]
 
bool test_ready_fop
 
static const struct m0_cm_ops cm_ut_ops
 
static const struct m0_reqh_service_type_ops cm_ut_service_type_ops
 
struct m0_motr motr = { .cc_pool_width = 10 }
 
struct m0_reqh_context rctx = { .rc_motr = &motr }
 

Function Documentation

◆ cm2utcm()

struct m0_ut_cm* cm2utcm ( struct m0_cm cm)

Definition at line 41 of file common_service.c.

Here is the caller graph for this function:

◆ cm_ag_ut_fini()

static void cm_ag_ut_fini ( struct m0_cm_aggr_group ag)
static

Definition at line 125 of file common_service.c.

◆ cm_ag_ut_local_cp_nr()

static uint64_t cm_ag_ut_local_cp_nr ( const struct m0_cm_aggr_group ag)
static

Definition at line 129 of file common_service.c.

◆ cm_cp_ut_free()

static void cm_cp_ut_free ( struct m0_cm_cp cp)
static

Definition at line 81 of file common_service.c.

◆ cm_cp_ut_invariant()

static bool cm_cp_ut_invariant ( const struct m0_cm_cp cp)
static

Definition at line 85 of file common_service.c.

◆ cm_ut_ag_alloc()

static int cm_ut_ag_alloc ( struct m0_cm cm,
const struct m0_cm_ag_id id,
bool  has_incoming,
struct m0_cm_aggr_group **  out 
)
static

Definition at line 145 of file common_service.c.

Here is the call graph for this function:

◆ cm_ut_ag_next()

static int cm_ut_ag_next ( struct m0_cm cm,
const struct m0_cm_ag_id id_curr,
struct m0_cm_ag_id id_next 
)
static

Definition at line 158 of file common_service.c.

Here is the call graph for this function:

◆ cm_ut_cp_alloc()

static struct m0_cm_cp* cm_ut_cp_alloc ( struct m0_cm cm)
static

Definition at line 95 of file common_service.c.

◆ cm_ut_data_next()

static int cm_ut_data_next ( struct m0_cm cm,
struct m0_cm_cp cp 
)
static

Definition at line 120 of file common_service.c.

◆ cm_ut_fini()

static void cm_ut_fini ( struct m0_cm cm)
static

Definition at line 187 of file common_service.c.

◆ cm_ut_ha_msg()

static void cm_ut_ha_msg ( struct m0_cm cm,
struct m0_ha_msg msg,
int  rc 
)
static

Definition at line 184 of file common_service.c.

◆ cm_ut_prepare()

static int cm_ut_prepare ( struct m0_cm cm)
static

Definition at line 106 of file common_service.c.

◆ cm_ut_service_alloc_init()

void cm_ut_service_alloc_init ( struct m0_reqh reqh)

Definition at line 231 of file common_service.c.

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

◆ cm_ut_service_allocate()

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

Definition at line 204 of file common_service.c.

Here is the call graph for this function:

◆ cm_ut_service_cleanup()

void cm_ut_service_cleanup ( )

Definition at line 242 of file common_service.c.

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

◆ cm_ut_service_fini()

static void cm_ut_service_fini ( struct m0_reqh_service service)
static

Definition at line 61 of file common_service.c.

Here is the call graph for this function:

◆ cm_ut_service_start()

static int cm_ut_service_start ( struct m0_reqh_service service)
static

Definition at line 46 of file common_service.c.

Here is the call graph for this function:

◆ cm_ut_service_stop()

static void cm_ut_service_stop ( struct m0_reqh_service service)
static

Definition at line 54 of file common_service.c.

Here is the call graph for this function:

◆ cm_ut_setup()

static int cm_ut_setup ( struct m0_cm cm)
static

Definition at line 101 of file common_service.c.

◆ cm_ut_start()

static int cm_ut_start ( struct m0_cm cm)
static

Definition at line 111 of file common_service.c.

◆ cm_ut_stop()

static void cm_ut_stop ( struct m0_cm cm)
static

Definition at line 116 of file common_service.c.

◆ M0_CM_TYPE_DECLARE()

M0_CM_TYPE_DECLARE ( cm_ut  ,
M0_CM_UT_OPCODE  ,
cm_ut_service_type_ops,
"cm_ut"  ,
 
)

Variable Documentation

◆ ag_id_cnt

uint64_t ag_id_cnt[MAX_CM_NR]

Definition at line 142 of file common_service.c.

◆ ag_ids

struct m0_cm_ag_id ag_ids[MAX_CM_NR][MAX_CM_NR]

Definition at line 141 of file common_service.c.

◆ aggr_grps

struct m0_cm_aggr_group aggr_grps[MAX_CM_NR][MAX_CM_NR]

Definition at line 140 of file common_service.c.

◆ cm_ag_ut_ops

const struct m0_cm_aggr_group_ops cm_ag_ut_ops
Initial value:
= {
.cago_fini = cm_ag_ut_fini,
.cago_local_cp_nr = cm_ag_ut_local_cp_nr,
}
static void cm_ag_ut_fini(struct m0_cm_aggr_group *ag)
static uint64_t cm_ag_ut_local_cp_nr(const struct m0_cm_aggr_group *ag)

Definition at line 134 of file common_service.c.

◆ cm_cp_ut_ops

const struct m0_cm_cp_ops cm_cp_ut_ops
static
Initial value:
= {
.co_invariant = cm_cp_ut_invariant,
.co_free = cm_cp_ut_free
}
static bool cm_cp_ut_invariant(const struct m0_cm_cp *cp)
static void cm_cp_ut_free(struct m0_cm_cp *cp)

Definition at line 90 of file common_service.c.

◆ cm_ut

struct m0_ut_cm cm_ut[MAX_CM_NR]

Definition at line 31 of file common_service.c.

◆ cm_ut_cp

struct m0_cm_cp cm_ut_cp

Definition at line 30 of file common_service.c.

◆ cm_ut_ops

const struct m0_cm_ops cm_ut_ops
static
Initial value:
= {
.cmo_setup = cm_ut_setup,
.cmo_prepare = cm_ut_prepare,
.cmo_start = cm_ut_start,
.cmo_stop = cm_ut_stop,
.cmo_ag_alloc = cm_ut_ag_alloc,
.cmo_cp_alloc = cm_ut_cp_alloc,
.cmo_data_next = cm_ut_data_next,
.cmo_ag_next = cm_ut_ag_next,
.cmo_ha_msg = cm_ut_ha_msg,
.cmo_fini = cm_ut_fini
}
static void cm_ut_stop(struct m0_cm *cm)
static void cm_ut_ha_msg(struct m0_cm *cm, struct m0_ha_msg *msg, int rc)
static int cm_ut_prepare(struct m0_cm *cm)
static int cm_ut_ag_alloc(struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, struct m0_cm_aggr_group **out)
static int cm_ut_data_next(struct m0_cm *cm, struct m0_cm_cp *cp)
static void cm_ut_fini(struct m0_cm *cm)
static int cm_ut_ag_next(struct m0_cm *cm, const struct m0_cm_ag_id *id_curr, struct m0_cm_ag_id *id_next)
static int cm_ut_setup(struct m0_cm *cm)
static struct m0_cm_cp * cm_ut_cp_alloc(struct m0_cm *cm)
static int cm_ut_start(struct m0_cm *cm)

Definition at line 191 of file common_service.c.

◆ cm_ut_service

struct m0_reqh_service * cm_ut_service

Definition at line 32 of file common_service.c.

◆ cm_ut_service_ops

const struct m0_reqh_service_ops cm_ut_service_ops
static
Initial value:
= {
.rso_start = cm_ut_service_start,
.rso_stop = cm_ut_service_stop,
.rso_fini = cm_ut_service_fini
}
static void cm_ut_service_fini(struct m0_reqh_service *service)
static int cm_ut_service_start(struct m0_reqh_service *service)
static void cm_ut_service_stop(struct m0_reqh_service *service)

Definition at line 75 of file common_service.c.

◆ cm_ut_service_type_ops

const struct m0_reqh_service_type_ops cm_ut_service_type_ops
static
Initial value:
= {
.rsto_service_allocate = cm_ut_service_allocate,
}
static int cm_ut_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)

Definition at line 222 of file common_service.c.

◆ cmut_rmach_ctx

struct m0_ut_rpc_mach_ctx cmut_rmach_ctx

Definition at line 33 of file common_service.c.

◆ lf

FILE* lf

Definition at line 36 of file common_service.c.

◆ lfname

const char lfname[] = "cm_ut.errlog"

Definition at line 35 of file common_service.c.

◆ motr

struct m0_motr motr = { .cc_pool_width = 10 }

Definition at line 228 of file common_service.c.

◆ rctx

struct m0_reqh_context rctx = { .rc_motr = &motr }

Definition at line 229 of file common_service.c.

◆ test_ready_fop

bool test_ready_fop

Definition at line 143 of file common_service.c.

◆ ut_cm_id

uint64_t ut_cm_id

Definition at line 39 of file common_service.c.