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 (enum m0_cm_op op, 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 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_repair_single_file (void)
 
static void iter_repair_multi_file (void)
 
static void iter_repair_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 struct m0_sm_state_descr iter_ut_fom_phases []
 
static struct m0_sm_conf iter_ut_conf
 
struct m0_ut_suite sns_cm_repair_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 436 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 421 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 284 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 259 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 176 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 231 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 292 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 312 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 168 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 521 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 529 of file cm.c.

Here is the call graph for this function:

◆ iter_repair_large_file_with_large_unit_size()

static void iter_repair_large_file_with_large_unit_size ( void  )
static

Definition at line 482 of file cm.c.

Here is the call graph for this function:

◆ iter_repair_multi_file()

static void iter_repair_multi_file ( void  )
static

Definition at line 475 of file cm.c.

Here is the call graph for this function:

◆ iter_repair_single_file()

static void iter_repair_single_file ( void  )
static

Definition at line 468 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 386 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 ( enum m0_cm_op  op,
uint64_t  fd 
)
static

Definition at line 131 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 446 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 327 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 264 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 113 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 122 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 104 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:72
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 98 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 72 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.

◆ 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_repair_ut

struct m0_ut_suite sns_cm_repair_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-repair-single-file", iter_repair_single_file},
{ "iter-repair-multi-file", iter_repair_multi_file},
{ "iter-repair-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:529
#define NULL
Definition: misc.h:38
static void service_init_failure(void)
Definition: cm.c:113
static void service_start_success(void)
Definition: cm.c:104
static void iter_repair_multi_file(void)
Definition: cm.c:475
static void iter_repair_large_file_with_large_unit_size(void)
Definition: cm.c:482
static void iter_ag_init_failure(void)
Definition: cm.c:521
static void service_start_failure(void)
Definition: cm.c:122
static void iter_repair_single_file(void)
Definition: cm.c:468

Definition at line 536 of file cm.c.