Motr  M0
storage.c File Reference
#include "lib/trace.h"
#include "lib/misc.h"
#include "lib/locality.h"
#include "lib/finject.h"
#include "lib/hash.h"
#include "reqh/reqh.h"
#include "motr/setup.h"
#include "net/net.h"
#include "sns/cm/repair/ut/cp_common.h"
#include "sns/cm/file.h"
#include "ioservice/fid_convert.h"
#include "sns/cm/cm.h"
Include dependency graph for storage.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM
 

Enumerations

enum  { SEG_NR = 1, SEG_SIZE = 4096 }
 

Functions

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 dummy_fom_fini (struct m0_fom *fom)
 
static uint64_t dummy_fom_locality (const struct m0_fom *fom)
 
static int dummy_fom_tick (struct m0_fom *fom)
 
static int dummy_cp_init (struct m0_cm_cp *cp)
 
static int dummy_cp_read (struct m0_cm_cp *cp)
 
static int dummy_cp_write (struct m0_cm_cp *cp)
 
static int dummy_cp_phase (struct m0_cm_cp *cp)
 
static void dummy_cp_complete (struct m0_cm_cp *cp)
 
static int dummy_cp_fini (struct m0_cm_cp *cp)
 
static int dummy_cp_read_io_wait (struct m0_cm_cp *cp)
 
static int dummy_cp_write_io_wait (struct m0_cm_cp *cp)
 
void write_post (struct m0_pdclust_layout *pdlay)
 
static void read_post (struct m0_pdclust_layout *pdlay)
 
static void test_cp_write_read (void)
 

Variables

static struct m0_sns_cmscm
 
static struct m0_reqhreqh
 
static struct m0_semaphore sem
 
static struct m0_net_buffer_pool nbp
 
static struct m0_sns_cm_ag w_sag
 
static struct m0_sns_cm_cp w_sns_cp
 
static struct m0_net_buffer w_buf
 
static struct m0_sns_cm_ag r_sag
 
static struct m0_sns_cm_cp r_sns_cp
 
static struct m0_net_buffer r_buf
 
static struct m0_fid gob_fid
 
static struct m0_fid cob_fid
 
static const struct m0_fid M0_SNS_CM_REPAIR_UT_PVER = M0_FID_TINIT('v', 1, 8)
 
static struct m0_fom_ops dummy_cp_fom_ops
 
const struct m0_cm_cp_ops write_cp_dummy_ops
 
const struct m0_cm_cp_ops read_cp_dummy_ops
 
struct m0_ut_suite snscm_storage_ut
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM

Definition at line 23 of file storage.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEG_NR 
SEG_SIZE 

Definition at line 65 of file storage.c.

Function Documentation

◆ 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 caller graph for this function:

◆ dummy_cp_complete()

static void dummy_cp_complete ( struct m0_cm_cp cp)
static

Definition at line 144 of file storage.c.

◆ dummy_cp_fini()

static int dummy_cp_fini ( struct m0_cm_cp cp)
static

Definition at line 149 of file storage.c.

◆ dummy_cp_init()

static int dummy_cp_init ( struct m0_cm_cp cp)
static

Definition at line 106 of file storage.c.

Here is the call graph for this function:

◆ dummy_cp_phase()

static int dummy_cp_phase ( struct m0_cm_cp cp)
static

Definition at line 138 of file storage.c.

◆ dummy_cp_read()

static int dummy_cp_read ( struct m0_cm_cp cp)
static

Definition at line 118 of file storage.c.

◆ dummy_cp_read_io_wait()

static int dummy_cp_read_io_wait ( struct m0_cm_cp cp)
static

Definition at line 159 of file storage.c.

Here is the call graph for this function:

◆ dummy_cp_write()

static int dummy_cp_write ( struct m0_cm_cp cp)
static

Definition at line 130 of file storage.c.

◆ dummy_cp_write_io_wait()

static int dummy_cp_write_io_wait ( struct m0_cm_cp cp)
static

Definition at line 171 of file storage.c.

Here is the call graph for this function:

◆ dummy_fom_fini()

static void dummy_fom_fini ( struct m0_fom fom)
static

Definition at line 71 of file storage.c.

Here is the call graph for this function:

◆ dummy_fom_locality()

static uint64_t dummy_fom_locality ( const struct m0_fom fom)
static

Definition at line 77 of file storage.c.

◆ dummy_fom_tick()

static int dummy_fom_tick ( struct m0_fom fom)
static

Definition at line 86 of file storage.c.

Here is the call graph for this function:

◆ read_post()

static void read_post ( struct m0_pdclust_layout pdlay)
static

Definition at line 252 of file storage.c.

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

◆ test_cp_write_read()

static void test_cp_write_read ( void  )
static

Definition at line 283 of file storage.c.

Here is the call graph for this function:

◆ write_post()

void write_post ( struct m0_pdclust_layout pdlay)

Definition at line 200 of file storage.c.

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

Variable Documentation

◆ cob_fid

struct m0_fid cob_fid
static

Definition at line 57 of file storage.c.

◆ dummy_cp_fom_ops

struct m0_fom_ops dummy_cp_fom_ops
static
Initial value:
= {
.fo_fini = dummy_fom_fini,
.fo_tick = dummy_fom_tick,
.fo_home_locality = dummy_fom_locality
}
static int dummy_fom_tick(struct m0_fom *fom)
Definition: storage.c:86
static uint64_t dummy_fom_locality(const struct m0_fom *fom)
Definition: storage.c:77
static void dummy_fom_fini(struct m0_fom *fom)
Definition: storage.c:71

Definition at line 99 of file storage.c.

◆ gob_fid

struct m0_fid gob_fid
static

Definition at line 56 of file storage.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 59 of file storage.c.

◆ nbp

struct m0_net_buffer_pool nbp
static

Definition at line 44 of file storage.c.

◆ r_buf

struct m0_net_buffer r_buf
static

Definition at line 54 of file storage.c.

◆ r_sag

struct m0_sns_cm_ag r_sag
static

Definition at line 52 of file storage.c.

◆ r_sns_cp

struct m0_sns_cm_cp r_sns_cp
static

Definition at line 53 of file storage.c.

◆ read_cp_dummy_ops

const struct m0_cm_cp_ops read_cp_dummy_ops
Initial value:
= {
.co_action = {
},
.co_action_nr = M0_CCP_NR,
.co_phase_next = &m0_sns_cm_cp_phase_next,
.co_invariant = &m0_sns_cm_cp_invariant,
.co_complete = &dummy_cp_complete,
}
static void dummy_cp_complete(struct m0_cm_cp *cp)
Definition: storage.c:144
static int dummy_cp_write(struct m0_cm_cp *cp)
Definition: storage.c:130
static int dummy_cp_write_io_wait(struct m0_cm_cp *cp)
Definition: storage.c:171
M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
Definition: storage.c:330
Definition: cp.h:151
static int dummy_cp_fini(struct m0_cm_cp *cp)
Definition: storage.c:149
static int dummy_cp_phase(struct m0_cm_cp *cp)
Definition: storage.c:138
M0_INTERNAL int m0_sns_cm_cp_phase_next(struct m0_cm_cp *cp)
Definition: cp.c:261
M0_INTERNAL bool m0_sns_cm_cp_invariant(const struct m0_cm_cp *cp)
Definition: cp.c:62
M0_INTERNAL int m0_sns_cm_cp_read(struct m0_cm_cp *cp)
Definition: storage.c:324
M0_INTERNAL int m0_sns_cm_cp_fail(struct m0_cm_cp *cp)
Definition: cp.c:216
static int dummy_cp_init(struct m0_cm_cp *cp)
Definition: storage.c:106

Definition at line 230 of file storage.c.

◆ reqh

struct m0_reqh* reqh
static

Definition at line 42 of file storage.c.

◆ scm

struct m0_sns_cm* scm
static

Definition at line 41 of file storage.c.

◆ sem

struct m0_semaphore sem
static

Definition at line 43 of file storage.c.

◆ snscm_storage_ut

struct m0_ut_suite snscm_storage_ut
Initial value:
= {
.ts_name = "snscm_storage-ut",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "cp_write_read", test_cp_write_read },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_cp_write_read(void)
Definition: storage.c:283

Definition at line 380 of file storage.c.

◆ w_buf

struct m0_net_buffer w_buf
static

Definition at line 49 of file storage.c.

◆ w_sag

struct m0_sns_cm_ag w_sag
static

Definition at line 47 of file storage.c.

◆ w_sns_cp

struct m0_sns_cm_cp w_sns_cp
static

Definition at line 48 of file storage.c.

◆ write_cp_dummy_ops

const struct m0_cm_cp_ops write_cp_dummy_ops
Initial value:
= {
.co_action = {
},
.co_action_nr = M0_CCP_NR,
.co_phase_next = &m0_sns_cm_cp_phase_next,
.co_invariant = &m0_sns_cm_cp_invariant,
.co_complete = &dummy_cp_complete,
}
static void dummy_cp_complete(struct m0_cm_cp *cp)
Definition: storage.c:144
M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
Definition: storage.c:330
Definition: cp.h:151
static int dummy_cp_fini(struct m0_cm_cp *cp)
Definition: storage.c:149
M0_INTERNAL int m0_sns_cm_cp_write(struct m0_cm_cp *cp)
Definition: storage.c:335
static int dummy_cp_phase(struct m0_cm_cp *cp)
Definition: storage.c:138
M0_INTERNAL int m0_sns_cm_cp_phase_next(struct m0_cm_cp *cp)
Definition: cp.c:261
M0_INTERNAL bool m0_sns_cm_cp_invariant(const struct m0_cm_cp *cp)
Definition: cp.c:62
static int dummy_cp_read(struct m0_cm_cp *cp)
Definition: storage.c:118
M0_INTERNAL int m0_sns_cm_cp_fail(struct m0_cm_cp *cp)
Definition: cp.c:216
static int dummy_cp_read_io_wait(struct m0_cm_cp *cp)
Definition: storage.c:159
static int dummy_cp_init(struct m0_cm_cp *cp)
Definition: storage.c:106

Definition at line 178 of file storage.c.