Motr  M0
helpers.c File Reference
#include "lib/trace.h"
#include "lib/misc.h"
#include "fid/fid.h"
#include "cm/proxy.h"
#include "sns/parity_repair.h"
#include "sns/cm/cm_utils.h"
#include "sns/cm/ag.h"
#include "sns/cm/file.h"
#include "pool/pool.h"
Include dependency graph for helpers.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_rebalance_ag_setup (struct m0_sns_cm_ag *sag, struct m0_pdclust_layout *pl)
 
static bool is_spare_relevant (const struct m0_sns_cm *scm, struct m0_sns_cm_file_ctx *fctx, uint64_t group, uint32_t spare, uint32_t *incoming_unit)
 
static int cob_to_proxy (struct m0_fid *cobfid, const struct m0_cm *cm, struct m0_poolmach *pm, struct m0_cm_proxy **pxy)
 
static int rebalance_ag_in_cp_units (const struct m0_sns_cm *scm, const struct m0_cm_ag_id *id, struct m0_sns_cm_file_ctx *fctx, uint32_t *in_cp_nr, uint32_t *in_units_nr, struct m0_cm_proxy_in_count *pcount)
 
static uint64_t rebalance_ag_unit_start (const struct m0_pdclust_layout *pl)
 
static uint64_t rebalance_ag_unit_end (const struct m0_pdclust_layout *pl)
 
static int _tgt_check_and_change (struct m0_sns_cm_ag *sag, struct m0_poolmach *pm, struct m0_pdclust_layout *pl, uint64_t data_unit, uint32_t old_tgt_dev, uint64_t *new_tgt_unit)
 
M0_INTERNAL int m0_sns_cm_rebalance_tgt_info (struct m0_sns_cm_ag *sag, struct m0_sns_cm_cp *scp)
 
static bool rebalance_ag_is_relevant (struct m0_sns_cm *scm, struct m0_sns_cm_file_ctx *fctx, uint64_t group)
 
static int rebalance_cob_locate (struct m0_sns_cm *scm, struct m0_cob_domain *cdom, struct m0_poolmach *pm, const struct m0_fid *cob_fid)
 
static bool rebalance_is_cob_failed (struct m0_poolmach *pm, uint32_t cob_index)
 

Variables

const struct m0_sns_cm_helpers rebalance_helpers
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM

Definition at line 23 of file helpers.c.

Function Documentation

◆ _tgt_check_and_change()

static int _tgt_check_and_change ( struct m0_sns_cm_ag sag,
struct m0_poolmach pm,
struct m0_pdclust_layout pl,
uint64_t  data_unit,
uint32_t  old_tgt_dev,
uint64_t *  new_tgt_unit 
)
static

Definition at line 167 of file helpers.c.

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

◆ cob_to_proxy()

static int cob_to_proxy ( struct m0_fid cobfid,
const struct m0_cm cm,
struct m0_poolmach pm,
struct m0_cm_proxy **  pxy 
)
static

Definition at line 46 of file helpers.c.

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

◆ is_spare_relevant()

static bool is_spare_relevant ( const struct m0_sns_cm scm,
struct m0_sns_cm_file_ctx fctx,
uint64_t  group,
uint32_t  spare,
uint32_t *  incoming_unit 
)
static

Definition at line 237 of file helpers.c.

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

◆ rebalance_ag_in_cp_units()

static int rebalance_ag_in_cp_units ( const struct m0_sns_cm scm,
const struct m0_cm_ag_id id,
struct m0_sns_cm_file_ctx fctx,
uint32_t *  in_cp_nr,
uint32_t *  in_units_nr,
struct m0_cm_proxy_in_count pcount 
)
static

Definition at line 70 of file helpers.c.

Here is the call graph for this function:

◆ rebalance_ag_is_relevant()

static bool rebalance_ag_is_relevant ( struct m0_sns_cm scm,
struct m0_sns_cm_file_ctx fctx,
uint64_t  group 
)
static

Definition at line 283 of file helpers.c.

Here is the call graph for this function:

◆ rebalance_ag_unit_end()

static uint64_t rebalance_ag_unit_end ( const struct m0_pdclust_layout pl)
static

Definition at line 162 of file helpers.c.

Here is the call graph for this function:

◆ rebalance_ag_unit_start()

static uint64_t rebalance_ag_unit_start ( const struct m0_pdclust_layout pl)
static

Definition at line 157 of file helpers.c.

Here is the call graph for this function:

◆ rebalance_cob_locate()

static int rebalance_cob_locate ( struct m0_sns_cm scm,
struct m0_cob_domain cdom,
struct m0_poolmach pm,
const struct m0_fid cob_fid 
)
static

Definition at line 339 of file helpers.c.

Here is the call graph for this function:

◆ rebalance_is_cob_failed()

static bool rebalance_is_cob_failed ( struct m0_poolmach pm,
uint32_t  cob_index 
)
static

Definition at line 345 of file helpers.c.

Here is the call graph for this function: