Motr  M0
cm.c File Reference
#include <sys/stat.h>
#include "lib/misc.h"
#include "lib/memory.h"
#include "lib/finject.h"
#include "lib/locality.h"
#include "net/buffer_pool.h"
#include "net/lnet/lnet.h"
#include "reqh/reqh_service.h"
#include "reqh/reqh.h"
#include "motr/setup.h"
#include "cob/cob.h"
#include "mdstore/mdstore.h"
#include "fop/fom.h"
#include "fop/fom_simple.h"
#include "ioservice/io_service.h"
#include "ioservice/fid_convert.h"
#include "pool/pool.h"
#include "mdservice/md_fid.h"
#include "rm/rm_service.h"
#include "sns/cm/repair/ag.h"
#include "sns/cm/cm.h"
#include "sns/cm/file.h"
#include "sns/cm/repair/ut/cp_common.h"
Include dependency graph for cm.c:

Go to the source code of this file.

Enumerations

enum  { ITER_UT_BUF_NR = 1 << 8, ITER_GOB_KEY_START = 4 }
 
enum  { ITER_RUN = M0_FOM_PHASE_FINISH + 1, ITER_WAIT, ITER_COMPLETE }
 

Functions

static void service_start_success (void)
 
static void service_init_failure (void)
 
static void service_start_failure (void)
 
static void iter_setup (uint64_t fd)
 
static bool cp_verify (struct m0_sns_cm_cp *scp)
 
M0_INTERNAL void cob_create (struct m0_reqh *reqh, struct m0_cob_domain *cdom, struct m0_be_domain *bedom, uint64_t cont, struct m0_fid *gfid, uint32_t cob_idx)
 
M0_INTERNAL void cob_delete (struct m0_cob_domain *cdom, struct m0_be_domain *bedom, uint64_t cont, const struct m0_fid *gfid)
 
static void buf_put (struct m0_sns_cm_cp *scp)
 
static void repair_ag_destroy (const struct m0_tl_descr *descr, struct m0_tl *head)
 
static void rebalance_ag_destroy (const struct m0_tl_descr *descr, struct m0_tl *head)
 
static void ag_destroy (void)
 
static void cobs_create (uint64_t nr_files, uint64_t nr_cobs)
 
static void cobs_delete (uint64_t nr_files, uint64_t nr_cobs)
 
static int iter_ut_fom_tick (struct m0_fom *fom, uint32_t *sem_id, int *phase)
 
static void iter_run (uint64_t pool_width, uint64_t nr_files, uint64_t fd)
 
static void _cpp_tx_start (struct m0_cm *cm)
 
static void _cpp_tx_close (struct m0_cm *cm)
 
static void iter_stop (uint64_t pool_width, uint64_t nr_files, uint64_t fd)
 
static void iter_repreb_single_file (void)
 
static void iter_repreb_multi_file (void)
 
static void iter_repreb_large_file_with_large_unit_size (void)
 
static void iter_ag_init_failure (void)
 
static void iter_invalid_nr_cobs (void)
 

Variables

static struct m0_reqhreqh
 
static struct m0_reqh_serviceservice
 
static struct m0_cmcm
 
static struct m0_sns_cmscm
 
static struct m0_sns_cm_cp scp
 
static struct m0_sns_cm_agsag
 
static struct m0_fom_simple iter_fom
 
static struct m0_fom_timeout iter_fom_timeout
 
static struct m0_semaphore iter_sem
 
static const struct m0_fid M0_SNS_CM_REPAIR_UT_PVER = M0_FID_TINIT('v', 1, 8)
 
static enum m0_cm_op op
 
static struct m0_sm_state_descr iter_ut_fom_phases []
 
static struct m0_sm_conf iter_ut_conf
 
struct m0_ut_suite sns_cm_repreb_ut
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ITER_UT_BUF_NR 
ITER_GOB_KEY_START 

Definition at line 50 of file cm.c.

◆ anonymous enum

anonymous enum
Enumerator
ITER_RUN 
ITER_WAIT 
ITER_COMPLETE 

Definition at line 55 of file cm.c.

Function Documentation

◆ _cpp_tx_close()

static void _cpp_tx_close ( struct m0_cm cm)
static

Definition at line 469 of file cm.c.

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

◆ _cpp_tx_start()

static void _cpp_tx_start ( struct m0_cm cm)
static

Definition at line 454 of file cm.c.

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

◆ ag_destroy()

static void ag_destroy ( void  )
static

Definition at line 307 of file cm.c.

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

◆ buf_put()

static void buf_put ( struct m0_sns_cm_cp scp)
static

Definition at line 269 of file cm.c.

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

◆ cob_create()

M0_INTERNAL void cob_create ( struct m0_reqh reqh,
struct m0_cob_domain cdom,
struct m0_be_domain bedom,
uint64_t  cont,
struct m0_fid gfid,
uint32_t  cob_idx 
)

Definition at line 186 of file cm.c.

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

◆ cob_delete()

M0_INTERNAL void cob_delete ( struct m0_cob_domain cdom,
struct m0_be_domain bedom,
uint64_t  cont,
const struct m0_fid gfid 
)

Definition at line 241 of file cm.c.

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

◆ cobs_create()

static void cobs_create ( uint64_t  nr_files,
uint64_t  nr_cobs 
)
static

Definition at line 321 of file cm.c.

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

◆ cobs_delete()

static void cobs_delete ( uint64_t  nr_files,
uint64_t  nr_cobs 
)
static

Definition at line 341 of file cm.c.

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

◆ cp_verify()

static bool cp_verify ( struct m0_sns_cm_cp scp)
static

Definition at line 178 of file cm.c.

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

◆ iter_ag_init_failure()

static void iter_ag_init_failure ( void  )
static

Definition at line 570 of file cm.c.

Here is the call graph for this function:

◆ iter_invalid_nr_cobs()

static void iter_invalid_nr_cobs ( void  )
static

Definition at line 583 of file cm.c.

Here is the call graph for this function:

◆ iter_repreb_large_file_with_large_unit_size()

static void iter_repreb_large_file_with_large_unit_size ( void  )
static

Definition at line 526 of file cm.c.

Here is the call graph for this function:

◆ iter_repreb_multi_file()

static void iter_repreb_multi_file ( void  )
static

Definition at line 514 of file cm.c.

Here is the call graph for this function:

◆ iter_repreb_single_file()

static void iter_repreb_single_file ( void  )
static

Definition at line 502 of file cm.c.

Here is the call graph for this function:

◆ iter_run()

static void iter_run ( uint64_t  pool_width,
uint64_t  nr_files,
uint64_t  fd 
)
static

Definition at line 418 of file cm.c.

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

◆ iter_setup()

static void iter_setup ( uint64_t  fd)
static

Definition at line 132 of file cm.c.

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

◆ iter_stop()

static void iter_stop ( uint64_t  pool_width,
uint64_t  nr_files,
uint64_t  fd 
)
static

Definition at line 479 of file cm.c.

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

◆ iter_ut_fom_tick()

static int iter_ut_fom_tick ( struct m0_fom fom,
uint32_t *  sem_id,
int *  phase 
)
static

Definition at line 356 of file cm.c.

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

◆ rebalance_ag_destroy()

static void rebalance_ag_destroy ( const struct m0_tl_descr descr,
struct m0_tl head 
)
static

Definition at line 294 of file cm.c.

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

◆ repair_ag_destroy()

static void repair_ag_destroy ( const struct m0_tl_descr descr,
struct m0_tl head 
)
static

Definition at line 274 of file cm.c.

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

◆ service_init_failure()

static void service_init_failure ( void  )
static

Definition at line 114 of file cm.c.

Here is the call graph for this function:

◆ service_start_failure()

static void service_start_failure ( void  )
static

Definition at line 123 of file cm.c.

Here is the call graph for this function:

◆ service_start_success()

static void service_start_success ( void  )
static

Definition at line 105 of file cm.c.

Here is the call graph for this function:

Variable Documentation

◆ cm

struct m0_cm* cm
static

Definition at line 63 of file cm.c.

◆ iter_fom

struct m0_fom_simple iter_fom
static

Definition at line 67 of file cm.c.

◆ iter_fom_timeout

struct m0_fom_timeout iter_fom_timeout
static

Definition at line 68 of file cm.c.

◆ iter_sem

struct m0_semaphore iter_sem
static

Definition at line 69 of file cm.c.

◆ iter_ut_conf

struct m0_sm_conf iter_ut_conf
static
Initial value:
= {
.scf_name = "iter ut fom",
.scf_nr_states = ARRAY_SIZE(iter_ut_fom_phases),
.scf_state = iter_ut_fom_phases,
}
static struct m0_sm_state_descr iter_ut_fom_phases[]
Definition: cm.c:73
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 99 of file cm.c.

◆ iter_ut_fom_phases

struct m0_sm_state_descr iter_ut_fom_phases[]
static
Initial value:
= {
.sd_name = "init",
.sd_allowed = M0_BITS(ITER_RUN),
.sd_flags = M0_SDF_INITIAL
},
[ITER_RUN] = {
.sd_name = "Iterator run",
},
[ITER_WAIT] = {
.sd_name = "Iterator wait",
},
.sd_name = "Iterator complete",
},
.sd_name = "fini",
.sd_flags = M0_SDF_TERMINAL
}
}
#define M0_BITS(...)
Definition: misc.h:236
Definition: cm.c:56
Definition: cm.c:57

Definition at line 73 of file cm.c.

◆ M0_SNS_CM_REPAIR_UT_PVER

const struct m0_fid M0_SNS_CM_REPAIR_UT_PVER = M0_FID_TINIT('v', 1, 8)
static

Definition at line 70 of file cm.c.

◆ op

enum m0_cm_op op
static

Definition at line 71 of file cm.c.

◆ reqh

struct m0_reqh* reqh
static

Definition at line 61 of file cm.c.

◆ sag

struct m0_sns_cm_ag* sag
static

Definition at line 66 of file cm.c.

◆ scm

struct m0_sns_cm* scm
static

Definition at line 64 of file cm.c.

◆ scp

struct m0_sns_cm_cp scp
static

Definition at line 65 of file cm.c.

◆ service

struct m0_reqh_service* service
static

Definition at line 62 of file cm.c.

◆ sns_cm_repreb_ut

struct m0_ut_suite sns_cm_repreb_ut
Initial value:
= {
.ts_name = "sns-cm-repair-ut",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "service-startstop", service_start_success},
{ "service-init-fail", service_init_failure},
{ "service-start-fail", service_start_failure},
{ "iter-repreb-single-file", iter_repreb_single_file},
{ "iter-repreb-multi-file", iter_repreb_multi_file},
{ "iter-repreb-large-file-with-large-unit-size",
{ "iter-ag-init-failure", iter_ag_init_failure},
{ "iter-invalid-nr-cobs", iter_invalid_nr_cobs},
{ NULL, NULL }
}
}
static void iter_invalid_nr_cobs(void)
Definition: cm.c:583
#define NULL
Definition: misc.h:38
static void service_init_failure(void)
Definition: cm.c:114
static void service_start_success(void)
Definition: cm.c:105
static void iter_repreb_large_file_with_large_unit_size(void)
Definition: cm.c:526
static void iter_ag_init_failure(void)
Definition: cm.c:570
static void service_start_failure(void)
Definition: cm.c:123
static void iter_repreb_multi_file(void)
Definition: cm.c:514
static void iter_repreb_single_file(void)
Definition: cm.c:502

Definition at line 595 of file cm.c.