Motr  M0
xform.c File Reference
#include "lib/vec.h"
#include "lib/locality.h"
#include "lib/finject.h"
#include "ioservice/io_service.h"
#include "motr/setup.h"
#include "sns/cm/repair/xform.c"
#include "sns/cm/repair/ut/cp_common.h"
#include "ioservice/fid_convert.h"
#include "ut/stob.h"
#include "module/instance.h"
Include dependency graph for xform.c:

Go to the source code of this file.

Enumerations

enum  {
  SEG_NR = 16, SEG_SIZE = 4096, BUF_NR = 2, DATA_NR = 5,
  PARITY_NR = 2, CP_SINGLE = 1, SINGLE_FAILURE = 1, MULTI_FAILURES = 2,
  SINGLE_FAIL_MULTI_CP_NR = 512, MULTI_FAIL_MULTI_CP_NR = 5
}
 

Functions

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 uint64_t cp_single_get (const struct m0_cm_aggr_group *ag)
 
static uint64_t single_fail_multi_cp_get (const struct m0_cm_aggr_group *ag)
 
static uint64_t multi_fail_multi_cp_get (const struct m0_cm_aggr_group *ag)
 
static size_t dummy_fom_locality (const struct m0_fom *fom)
 
static int dummy_fom_tick (struct m0_fom *fom)
 
static int dummy_acc_cp_fom_tick (struct m0_fom *fom)
 
static void single_cp_fom_fini (struct m0_fom *fom)
 
static void multiple_cp_fom_fini (struct m0_fom *fom)
 
static void cp_buf_free (struct m0_sns_cm_ag *sag)
 
static void tgt_fid_cob_create (struct m0_reqh *reqh)
 
static void ag_init (struct m0_sns_cm_repair_ag *rag)
 
static void ag_fini (struct m0_sns_cm_repair_ag *rag)
 
static void ag_prepare (struct m0_sns_cm_repair_ag *rag, int failure_nr, const struct m0_cm_aggr_group_ops *ag_ops, struct m0_sns_cm_repair_ag_failure_ctx *fc)
 
static void test_bufvec_xor ()
 
static void test_single_cp (void)
 
static void test_multi_cp_single_failure (void)
 
static void rs_init ()
 
static void buffers_attach (struct m0_net_buffer *nb, struct m0_cm_cp *cp, char data)
 
static void cp_multi_failures_post (char data, int cnt, int index)
 
static void buf_initialize (struct m0_buf *bufs, uint32_t count, uint32_t len)
 
static void buf_free (struct m0_buf *bufs, uint32_t count)
 
static void ref_parity_calculate (struct m0_parity_math *math, struct m0_bufvec *bufvecs)
 
static void test_multi_cp_multi_failures (void)
 
static int xform_init (void)
 
static int xform_fini (void)
 

Variables

static struct m0_fid gob_fid
 
static struct m0_fid cob_fid
 
static struct m0_reqhreqh
 
struct m0_pdclust_layoutpdlay
 
static struct m0_cmcm
 
static struct m0_sns_cmscm
 
static struct m0_reqh_servicescm_service
 
static struct m0_cob_domaincdom
 
static struct m0_semaphore sem
 
static struct m0_net_buffer_pool nbp
 
static struct m0_bufvec src
 
static struct m0_bufvec dst
 
static struct m0_bufvec xor
 
static struct m0_sns_cm_repair_ag s_rag
 
static struct m0_sns_cm_repair_ag_failure_ctx s_fc [SINGLE_FAILURE]
 
static struct m0_sns_cm_cp s_cp
 
static struct m0_net_buffer s_buf
 
static struct m0_net_buffer s_acc_buf
 
static struct m0_sns_cm_repair_ag m_rag
 
static struct m0_sns_cm_repair_ag_failure_ctx m_fc [SINGLE_FAILURE]
 
static struct m0_sns_cm_cp m_cp [SINGLE_FAIL_MULTI_CP_NR]
 
static struct m0_net_buffer m_buf [SINGLE_FAIL_MULTI_CP_NR]
 
static struct m0_net_buffer m_acc_buf [SINGLE_FAILURE]
 
static struct m0_sns_cm_repair_ag n_rag
 
static struct m0_sns_cm_repair_ag_failure_ctx n_fc [MULTI_FAILURES]
 
static struct m0_sns_cm_cp n_cp [MULTI_FAIL_MULTI_CP_NR]
 
static struct m0_net_buffer n_buf [MULTI_FAIL_MULTI_CP_NR][BUF_NR]
 
static struct m0_net_buffer n_acc_buf [MULTI_FAILURES][BUF_NR]
 
static const struct m0_cm_aggr_group_ops group_single_ops
 
static const struct m0_cm_aggr_group_ops group_single_fail_multi_cp_ops
 
static const struct m0_cm_aggr_group_ops group_multi_fail_multi_cp_ops
 
static struct m0_fom_ops single_cp_fom_ops
 
static struct m0_fom_ops acc_cp_fom_ops
 
static struct m0_fom_ops multiple_cp_fom_ops
 
const struct m0_sns_cm_helpers xform_ut_repair_helpers
 
struct m0_ut_suite snscm_xform_ut
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEG_NR 
SEG_SIZE 
BUF_NR 
DATA_NR 
PARITY_NR 
CP_SINGLE 
SINGLE_FAILURE 
MULTI_FAILURES 
SINGLE_FAIL_MULTI_CP_NR 
MULTI_FAIL_MULTI_CP_NR 

Definition at line 34 of file xform.c.

Function Documentation

◆ ag_fini()

static void ag_fini ( struct m0_sns_cm_repair_ag rag)
static

Definition at line 256 of file xform.c.

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

◆ ag_init()

static void ag_init ( struct m0_sns_cm_repair_ag rag)
static

Definition at line 248 of file xform.c.

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

◆ ag_prepare()

static void ag_prepare ( struct m0_sns_cm_repair_ag rag,
int  failure_nr,
const struct m0_cm_aggr_group_ops ag_ops,
struct m0_sns_cm_repair_ag_failure_ctx fc 
)
static

Definition at line 263 of file xform.c.

Here is the caller graph for this function:

◆ buf_free()

static void buf_free ( struct m0_buf bufs,
uint32_t  count 
)
static

Definition at line 453 of file xform.c.

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

◆ buf_initialize()

static void buf_initialize ( struct m0_buf bufs,
uint32_t  count,
uint32_t  len 
)
static

Definition at line 442 of file xform.c.

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

◆ buffers_attach()

static void buffers_attach ( struct m0_net_buffer nb,
struct m0_cm_cp cp,
char  data 
)
static

Definition at line 402 of file xform.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:

◆ cp_buf_free()

static void cp_buf_free ( struct m0_sns_cm_ag sag)
static

Definition at line 219 of file xform.c.

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

◆ cp_multi_failures_post()

static void cp_multi_failures_post ( char  data,
int  cnt,
int  index 
)
static

Definition at line 420 of file xform.c.

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

◆ cp_single_get()

static uint64_t cp_single_get ( const struct m0_cm_aggr_group ag)
static

Definition at line 99 of file xform.c.

◆ dummy_acc_cp_fom_tick()

static int dummy_acc_cp_fom_tick ( struct m0_fom fom)
static

Definition at line 154 of file xform.c.

Here is the call graph for this function:

◆ dummy_fom_locality()

static size_t dummy_fom_locality ( const struct m0_fom fom)
static

Definition at line 126 of file xform.c.

◆ dummy_fom_tick()

static int dummy_fom_tick ( struct m0_fom fom)
static

Definition at line 133 of file xform.c.

Here is the call graph for this function:

◆ multi_fail_multi_cp_get()

static uint64_t multi_fail_multi_cp_get ( const struct m0_cm_aggr_group ag)
static

Definition at line 117 of file xform.c.

◆ multiple_cp_fom_fini()

static void multiple_cp_fom_fini ( struct m0_fom fom)
static

Definition at line 180 of file xform.c.

Here is the call graph for this function:

◆ ref_parity_calculate()

static void ref_parity_calculate ( struct m0_parity_math math,
struct m0_bufvec bufvecs 
)
static

Definition at line 461 of file xform.c.

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

◆ rs_init()

static void rs_init ( )
static

Definition at line 391 of file xform.c.

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

◆ single_cp_fom_fini()

static void single_cp_fom_fini ( struct m0_fom fom)
static

Definition at line 173 of file xform.c.

Here is the call graph for this function:

◆ single_fail_multi_cp_get()

static uint64_t single_fail_multi_cp_get ( const struct m0_cm_aggr_group ag)
static

Definition at line 108 of file xform.c.

◆ test_bufvec_xor()

static void test_bufvec_xor ( )
static

Definition at line 286 of file xform.c.

Here is the call graph for this function:

◆ test_multi_cp_multi_failures()

static void test_multi_cp_multi_failures ( void  )
static

Definition at line 507 of file xform.c.

Here is the call graph for this function:

◆ test_multi_cp_single_failure()

static void test_multi_cp_single_failure ( void  )
static

Definition at line 348 of file xform.c.

Here is the call graph for this function:

◆ test_single_cp()

static void test_single_cp ( void  )
static

Definition at line 307 of file xform.c.

Here is the call graph for this function:

◆ tgt_fid_cob_create()

static void tgt_fid_cob_create ( struct m0_reqh reqh)
static

Definition at line 235 of file xform.c.

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

◆ xform_fini()

static int xform_fini ( void  )
static

Definition at line 723 of file xform.c.

Here is the call graph for this function:

◆ xform_init()

static int xform_init ( void  )
static

Definition at line 647 of file xform.c.

Here is the call graph for this function:

Variable Documentation

◆ acc_cp_fom_ops

struct m0_fom_ops acc_cp_fom_ops
static
Initial value:
= {
.fo_fini = single_cp_fom_fini,
.fo_home_locality = dummy_fom_locality
}
static size_t dummy_fom_locality(const struct m0_fom *fom)
Definition: xform.c:126
static void single_cp_fom_fini(struct m0_fom *fom)
Definition: xform.c:173
static int dummy_acc_cp_fom_tick(struct m0_fom *fom)
Definition: xform.c:154

Definition at line 194 of file xform.c.

◆ cdom

struct m0_cob_domain* cdom
static

Definition at line 55 of file xform.c.

◆ cm

struct m0_cm* cm
static

Definition at line 52 of file xform.c.

◆ cob_fid

struct m0_fid cob_fid
static

Definition at line 48 of file xform.c.

◆ dst

struct m0_bufvec dst
static

Definition at line 61 of file xform.c.

◆ gob_fid

struct m0_fid gob_fid
static

Definition at line 47 of file xform.c.

◆ group_multi_fail_multi_cp_ops

const struct m0_cm_aggr_group_ops group_multi_fail_multi_cp_ops
static
Initial value:
= {
.cago_local_cp_nr = &multi_fail_multi_cp_get,
}
static uint64_t multi_fail_multi_cp_get(const struct m0_cm_aggr_group *ag)
Definition: xform.c:117

Definition at line 122 of file xform.c.

◆ group_single_fail_multi_cp_ops

const struct m0_cm_aggr_group_ops group_single_fail_multi_cp_ops
static
Initial value:
= {
.cago_local_cp_nr = &single_fail_multi_cp_get,
}
static uint64_t single_fail_multi_cp_get(const struct m0_cm_aggr_group *ag)
Definition: xform.c:108

Definition at line 113 of file xform.c.

◆ group_single_ops

const struct m0_cm_aggr_group_ops group_single_ops
static
Initial value:
= {
.cago_local_cp_nr = &cp_single_get,
}
static uint64_t cp_single_get(const struct m0_cm_aggr_group *ag)
Definition: xform.c:99

Definition at line 104 of file xform.c.

◆ m_acc_buf

struct m0_net_buffer m_acc_buf[SINGLE_FAILURE]
static

Definition at line 79 of file xform.c.

◆ m_buf

struct m0_net_buffer m_buf[SINGLE_FAIL_MULTI_CP_NR]
static

Definition at line 78 of file xform.c.

◆ m_cp

Definition at line 77 of file xform.c.

◆ m_fc

Definition at line 76 of file xform.c.

◆ m_rag

struct m0_sns_cm_repair_ag m_rag
static

Definition at line 75 of file xform.c.

◆ multiple_cp_fom_ops

struct m0_fom_ops multiple_cp_fom_ops
static
Initial value:
= {
.fo_tick = dummy_fom_tick,
.fo_home_locality = dummy_fom_locality
}
static size_t dummy_fom_locality(const struct m0_fom *fom)
Definition: xform.c:126
static int dummy_fom_tick(struct m0_fom *fom)
Definition: xform.c:133
static void multiple_cp_fom_fini(struct m0_fom *fom)
Definition: xform.c:180

Definition at line 201 of file xform.c.

◆ n_acc_buf

struct m0_net_buffer n_acc_buf[MULTI_FAILURES][BUF_NR]
static

Definition at line 89 of file xform.c.

◆ n_buf

Definition at line 88 of file xform.c.

◆ n_cp

struct m0_sns_cm_cp n_cp[MULTI_FAIL_MULTI_CP_NR]
static

Definition at line 87 of file xform.c.

◆ n_fc

Definition at line 86 of file xform.c.

◆ n_rag

struct m0_sns_cm_repair_ag n_rag
static

Definition at line 85 of file xform.c.

◆ nbp

struct m0_net_buffer_pool nbp
static

Definition at line 57 of file xform.c.

◆ pdlay

struct m0_pdclust_layout* pdlay

Definition at line 51 of file xform.c.

◆ reqh

struct m0_reqh* reqh
static

Definition at line 50 of file xform.c.

◆ s_acc_buf

struct m0_net_buffer s_acc_buf
static

Definition at line 69 of file xform.c.

◆ s_buf

struct m0_net_buffer s_buf
static

Definition at line 68 of file xform.c.

◆ s_cp

struct m0_sns_cm_cp s_cp
static

Definition at line 67 of file xform.c.

◆ s_fc

Definition at line 66 of file xform.c.

◆ s_rag

struct m0_sns_cm_repair_ag s_rag
static

Definition at line 65 of file xform.c.

◆ scm

struct m0_sns_cm* scm
static

Definition at line 53 of file xform.c.

◆ scm_service

struct m0_reqh_service* scm_service
static

Definition at line 54 of file xform.c.

◆ sem

struct m0_semaphore sem
static

Definition at line 56 of file xform.c.

◆ single_cp_fom_ops

struct m0_fom_ops single_cp_fom_ops
static
Initial value:
= {
.fo_fini = single_cp_fom_fini,
.fo_tick = dummy_fom_tick,
.fo_home_locality = dummy_fom_locality
}
static size_t dummy_fom_locality(const struct m0_fom *fom)
Definition: xform.c:126
static void single_cp_fom_fini(struct m0_fom *fom)
Definition: xform.c:173
static int dummy_fom_tick(struct m0_fom *fom)
Definition: xform.c:133

Definition at line 188 of file xform.c.

◆ snscm_xform_ut

struct m0_ut_suite snscm_xform_ut
Initial value:
= {
.ts_name = "snscm_xform-ut",
.ts_init = &xform_init,
.ts_fini = &xform_fini,
.ts_tests = {
{ "bufvec_xor_correctness", test_bufvec_xor },
{ "single_cp_passthrough", test_single_cp },
{ "multi_cp_single_failure",
{ "multi_cp_multi_failures",
{ NULL, NULL }
}
}
static int xform_fini(void)
Definition: xform.c:723
#define NULL
Definition: misc.h:38
static void test_single_cp(void)
Definition: xform.c:307
static void test_multi_cp_single_failure(void)
Definition: xform.c:348
static void test_multi_cp_multi_failures(void)
Definition: xform.c:507
static void test_bufvec_xor()
Definition: xform.c:286
static int xform_init(void)
Definition: xform.c:647

Definition at line 743 of file xform.c.

◆ src

struct m0_bufvec src
static

Definition at line 60 of file xform.c.

◆ xform_ut_repair_helpers

const struct m0_sns_cm_helpers xform_ut_repair_helpers
Initial value:
= {
}

Definition at line 216 of file xform.c.

◆ xor

struct m0_bufvec xor
static

Definition at line 62 of file xform.c.