Motr  M0
cm.c File Reference
#include "lib/trace.h"
#include "lib/assert.h"
#include "lib/errno.h"
#include "fop/fop.h"
#include "reqh/reqh.h"
#include "conf/obj_ops.h"
#include "sns/cm/cm_utils.h"
#include "sns/cm/iter.h"
#include "sns/cm/cm.h"
#include "sns/cm/cp.h"
#include "sns/cm/file.h"
#include "sns/cm/repair/ag.h"
Include dependency graph for cm.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM
 

Functions

M0_INTERNAL int m0_sns_cm_repair_sw_onwire_fop_setup (struct m0_cm *cm, struct m0_fop *fop, void(*fop_release)(struct m0_ref *), uint64_t proxy_id, const char *local_ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval)
 
static struct m0_cm_cprepair_cm_cp_alloc (struct m0_cm *cm)
 
static int repair_cm_prepare (struct m0_cm *cm)
 
static void repair_cm_stop (struct m0_cm *cm)
 
static int repair_cm_get_space_for (struct m0_cm *cm, const struct m0_cm_ag_id *id, size_t *count)
 
M0_INTERNAL enum sns_repair_state m0_sns_cm_fid_repair_done (struct m0_fid *gfid, struct m0_reqh *reqh, enum m0_pool_nd_state device_state)
 

Variables

const struct m0_sns_cm_helpers repair_helpers
 
const struct m0_cm_cp_ops m0_sns_cm_repair_cp_ops
 
struct m0_cm_type sns_repair_cmt
 
M0_INTERNAL const struct m0_cm_ops sns_repair_ops
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM

Definition at line 23 of file cm.c.

Function Documentation

◆ repair_cm_cp_alloc()

static struct m0_cm_cp* repair_cm_cp_alloc ( struct m0_cm cm)
static

Definition at line 54 of file cm.c.

Here is the call graph for this function:

◆ repair_cm_get_space_for()

static int repair_cm_get_space_for ( struct m0_cm cm,
const struct m0_cm_ag_id id,
size_t *  count 
)
static

Returns 0 iff the copy machine has enough space to receive all the copy packets from the given relevant group "id". Calculates required number of buffers from incoming buffer pool struct m0_sns_cm::sc_ibp corresponding to all the incoming copy packets and checks if the incoming buffer pool has enough free buffers to receive all the remote units corresponding to a parity group.

Definition at line 160 of file cm.c.

Here is the call graph for this function:

◆ repair_cm_prepare()

static int repair_cm_prepare ( struct m0_cm cm)
static

Definition at line 65 of file cm.c.

Here is the call graph for this function:

◆ repair_cm_stop()

static void repair_cm_stop ( struct m0_cm cm)
static

Definition at line 82 of file cm.c.

Here is the call graph for this function:

Variable Documentation

◆ sns_repair_ops

M0_INTERNAL const struct m0_cm_ops sns_repair_ops
Initial value:
= {
.cmo_setup = m0_sns_cm_setup,
.cmo_prepare = repair_cm_prepare,
.cmo_start = m0_sns_cm_start,
.cmo_ag_alloc = m0_sns_cm_repair_ag_alloc,
.cmo_cp_alloc = repair_cm_cp_alloc,
.cmo_data_next = m0_sns_cm_iter_next,
.cmo_ag_next = m0_sns_cm_ag_next,
.cmo_get_space_for = repair_cm_get_space_for,
.cmo_sw_onwire_fop_setup = m0_sns_cm_repair_sw_onwire_fop_setup,
.cmo_is_peer = m0_sns_is_peer,
.cmo_ha_msg = m0_sns_cm_ha_msg,
.cmo_stop = repair_cm_stop,
.cmo_fini = m0_sns_cm_fini
}
static int repair_cm_prepare(struct m0_cm *cm)
Definition: cm.c:65
M0_INTERNAL int m0_sns_cm_setup(struct m0_cm *cm)
Definition: cm.c:487
static void repair_cm_stop(struct m0_cm *cm)
Definition: cm.c:82
M0_INTERNAL void m0_sns_cm_ha_msg(struct m0_cm *cm, struct m0_ha_msg *msg, int rc)
Definition: cm.c:756
M0_INTERNAL int m0_sns_cm_start(struct m0_cm *cm)
Definition: cm.c:641
M0_INTERNAL int m0_sns_cm_repair_ag_alloc(struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, struct m0_cm_aggr_group **out)
Definition: ag.c:453
M0_INTERNAL int m0_sns_cm_iter_next(struct m0_cm *cm, struct m0_cm_cp *cp)
Definition: iter.c:762
static struct m0_cm_cp * repair_cm_cp_alloc(struct m0_cm *cm)
Definition: cm.c:54
M0_INTERNAL bool m0_sns_is_peer(struct m0_cm *cm, struct m0_reqh_service_ctx *ctx)
Definition: cm.c:542
static int repair_cm_get_space_for(struct m0_cm *cm, const struct m0_cm_ag_id *id, size_t *count)
Definition: cm.c:160
M0_INTERNAL void m0_sns_cm_fini(struct m0_cm *cm)
Definition: cm.c:773
M0_INTERNAL int m0_sns_cm_repair_sw_onwire_fop_setup(struct m0_cm *cm, struct m0_fop *fop, void(*fop_release)(struct m0_ref *), uint64_t proxy_id, const char *local_ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval)
Definition: sw_onwire_fop.c:88
M0_INTERNAL int m0_sns_cm_ag_next(struct m0_cm *cm, const struct m0_cm_ag_id *id_curr, struct m0_cm_ag_id *id_next)
Definition: cm.c:938

Copy machine operations.

Definition at line 226 of file cm.c.