Motr  M0
parity_repair.c File Reference
#include "lib/trace.h"
#include "lib/misc.h"
#include "lib/errno.h"
#include "sns/parity_repair.h"
#include "ioservice/fid_convert.h"
Include dependency graph for parity_repair.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM
 

Functions

static void device_index_get (struct m0_pdclust_instance *pi, uint64_t group_number, uint64_t unit_number, uint32_t *device_index_out)
 
static int _spare_next (struct m0_poolmach *pm, const struct m0_fid *fid, struct m0_pdclust_layout *pl, struct m0_pdclust_instance *pi, uint64_t group_number, uint64_t unit_number, uint32_t *spare_slot_out, uint32_t *spare_slot_out_prev, bool break_next)
 
M0_INTERNAL int m0_sns_repair_spare_map (struct m0_poolmach *pm, const struct m0_fid *fid, struct m0_pdclust_layout *pl, struct m0_pdclust_instance *pi, uint64_t group, uint64_t unit, uint32_t *spare_slot_out, uint32_t *spare_slot_out_prev)
 
M0_INTERNAL int m0_sns_repair_spare_rebalancing (struct m0_poolmach *pm, const struct m0_fid *fid, struct m0_pdclust_layout *pl, struct m0_pdclust_instance *pi, uint64_t group, uint64_t unit, uint32_t *spare_slot_out, uint32_t *spare_slot_out_prev)
 
static bool frame_eq (struct m0_pdclust_instance *pi, uint64_t group_number, uint64_t frame, uint32_t device_index)
 
static uint64_t frame_get (struct m0_pdclust_instance *pi, uint64_t spare_frame, uint64_t group_number, uint32_t device_index)
 
M0_INTERNAL int m0_sns_repair_data_map (struct m0_poolmach *pm, struct m0_pdclust_layout *pl, struct m0_pdclust_instance *pi, uint64_t group_number, uint64_t spare_unit_number, uint64_t *data_unit_id_out)
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM

Definition at line 22 of file parity_repair.c.

Function Documentation

◆ _spare_next()

static int _spare_next ( struct m0_poolmach pm,
const struct m0_fid fid,
struct m0_pdclust_layout pl,
struct m0_pdclust_instance pi,
uint64_t  group_number,
uint64_t  unit_number,
uint32_t *  spare_slot_out,
uint32_t *  spare_slot_out_prev,
bool  break_next 
)
static

Definition at line 47 of file parity_repair.c.

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

◆ device_index_get()

static void device_index_get ( struct m0_pdclust_instance pi,
uint64_t  group_number,
uint64_t  unit_number,
uint32_t *  device_index_out 
)
static

Definition at line 29 of file parity_repair.c.

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

◆ frame_eq()

static bool frame_eq ( struct m0_pdclust_instance pi,
uint64_t  group_number,
uint64_t  frame,
uint32_t  device_index 
)
static

Definition at line 140 of file parity_repair.c.

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

◆ frame_get()

static uint64_t frame_get ( struct m0_pdclust_instance pi,
uint64_t  spare_frame,
uint64_t  group_number,
uint32_t  device_index 
)
static

Definition at line 158 of file parity_repair.c.

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

◆ m0_sns_repair_data_map()

M0_INTERNAL int m0_sns_repair_data_map ( struct m0_poolmach pm,
struct m0_pdclust_layout pl,
struct m0_pdclust_instance pi,
uint64_t  group_number,
uint64_t  spare_unit_number,
uint64_t *  data_unit_id_out 
)

Map the {spare slot, data/parity unit id} pair after repair.

Parameters
pmpool machine.
fidGlobal file id.
plpdclust layout instance.
group_numberParity group number for a given file.
unit_numberSpare unit number in the parity group.
data_unit_id_outthe output data unit index.

Definition at line 192 of file parity_repair.c.

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

◆ m0_sns_repair_spare_map()

M0_INTERNAL int m0_sns_repair_spare_map ( struct m0_poolmach pm,
const struct m0_fid fid,
struct m0_pdclust_layout pl,
struct m0_pdclust_instance pi,
uint64_t  group_number,
uint64_t  unit_number,
uint32_t *  spare_slot_out,
uint32_t *  spare_slot_out_prev 
)

Map the {failed device, spare slot} pair of a specified device.

Parameters
pmpool machine.
fidGlobal file id.
plpdclust layout instance.
group_numberParity group number for a given file.
unit_numberUnit number in the parity group.
spare_slot_outthe output spare slot.
spare_slot_out_prevthe previous spare slot (in case of cascaded failures) Contains unit number in case of single failure.

Definition at line 103 of file parity_repair.c.

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

◆ m0_sns_repair_spare_rebalancing()

M0_INTERNAL int m0_sns_repair_spare_rebalancing ( struct m0_poolmach pm,
const struct m0_fid fid,
struct m0_pdclust_layout pl,
struct m0_pdclust_instance pi,
uint64_t  group,
uint64_t  unit,
uint32_t *  spare_slot_out,
uint32_t *  spare_slot_out_prev 
)

Definition at line 115 of file parity_repair.c.

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