Motr
M0
|
Data Structures | |
struct | poolmach_equeue_link |
struct | m0_poolmach_state |
struct | m0_poolmach |
struct | m0_poolmach_event |
struct | m0_poolmach_event_link |
Macros | |
#define | POOL_TRACE_LEVEL M0_DEBUG |
Enumerations | |
enum | m0_pool_nd_state { M0_PNDS_UNKNOWN, M0_PNDS_ONLINE, M0_PNDS_FAILED, M0_PNDS_OFFLINE, M0_PNDS_SNS_REPAIRING, M0_PNDS_SNS_REPAIRED, M0_PNDS_SNS_REBALANCING, M0_PNDS_NR } |
enum | { POOL_PM_SPARE_SLOT_UNUSED = 0xFFFFFFFF } |
enum | m0_poolmach_event_owner_type { M0_POOL_NODE, M0_POOL_DEVICE } |
Functions | |
M0_TL_DESCR_DEFINE (poolmach_events, "pool machine events list", M0_INTERNAL, struct m0_poolmach_event_link, pel_linkage, pel_magic, M0_POOL_EVENTS_LIST_MAGIC, M0_POOL_EVENTS_HEAD_MAGIC) | |
M0_TL_DEFINE (poolmach_events, M0_INTERNAL, struct m0_poolmach_event_link) | |
M0_TL_DESCR_DEFINE (poolmach_equeue, "pool machine events queue", static, struct poolmach_equeue_link, pel_linkage, pel_magic, 100, 101) | |
M0_TL_DEFINE (poolmach_equeue, static, struct poolmach_equeue_link) | |
static struct m0_clink * | poolnode_clink (struct m0_poolnode *pnode) |
static struct m0_clink * | pooldev_clink (struct m0_pooldev *pdev) |
static struct m0_clink * | exp_clink (struct m0_poolmach_state *state) |
static struct m0_clink * | ready_clink (struct m0_poolmach_state *state) |
static bool | is_enclosurev_or_diskv (const struct m0_conf_obj *obj) |
static int | poolmach_state_update (struct m0_poolmach_state *st, const struct m0_conf_obj *objv_real, uint32_t *idx_nodes, uint32_t *idx_devices) |
static bool | poolmach_conf_expired_cb (struct m0_clink *clink) |
static bool | poolmach_conf_ready_cb (struct m0_clink *clink) |
M0_INTERNAL int | m0_poolmach_init_by_conf (struct m0_poolmach *pm, struct m0_conf_pver *pver) |
static void | state_init (struct m0_poolmach_state *state, struct m0_poolnode *nodes_array, uint32_t nr_nodes, struct m0_pooldev *devices_array, uint32_t nr_devices, struct m0_pool_spare_usage *spare_usage_array, uint32_t nr_spare, uint32_t max_node_failures, uint32_t max_device_failures, struct m0_poolmach *pm) |
static void | poolmach_init (struct m0_poolmach *pm, struct m0_pool_version *pver, struct m0_poolmach_state *pm_state) |
M0_INTERNAL int | m0_poolmach_init (struct m0_poolmach *pm, struct m0_pool_version *pver, uint32_t nr_nodes, uint32_t nr_devices, uint32_t nr_spare, uint32_t max_node_failures, uint32_t max_device_failures) |
static void | pool_obj_clink_fini (struct m0_clink *cl) |
M0_INTERNAL void | m0_poolmach_fini (struct m0_poolmach *pm) |
static bool | disk_is_in (struct m0_tl *head, struct m0_pooldev *pd) |
static int | poolmach_equeue_add (struct m0_poolmach *pm, const struct m0_poolmach_event *event) |
M0_INTERNAL uint32_t | m0_poolmach_equeue_length (struct m0_poolmach *pm) |
static void | spare_usage_arr_update (struct m0_poolmach *pm, const struct m0_poolmach_event *event) |
M0_INTERNAL int | m0_poolmach_state_transit (struct m0_poolmach *pm, const struct m0_poolmach_event *event) |
M0_INTERNAL void | m0_poolmach_state_last_cancel (struct m0_poolmach *pm) |
M0_INTERNAL int | m0_poolmach_device_state (struct m0_poolmach *pm, uint32_t device_index, enum m0_pool_nd_state *state_out) |
M0_INTERNAL int | m0_poolmach_node_state (struct m0_poolmach *pm, uint32_t node_index, enum m0_pool_nd_state *state_out) |
M0_INTERNAL int | m0_poolmach_device_node_return (struct m0_poolmach *pm, uint32_t device_index, struct m0_poolnode **node_out) |
M0_INTERNAL bool | m0_poolmach_device_is_in_spare_usage_array (struct m0_poolmach *pm, uint32_t device_index) |
M0_INTERNAL int | m0_poolmach_sns_repair_spare_query (struct m0_poolmach *pm, uint32_t device_index, uint32_t *spare_slot_out) |
M0_INTERNAL bool | m0_poolmach_sns_repair_spare_contains_data (struct m0_poolmach *p, uint32_t spare_slot, bool check_state) |
M0_INTERNAL int | m0_poolmach_sns_rebalance_spare_query (struct m0_poolmach *pm, uint32_t device_index, uint32_t *spare_slot_out) |
M0_INTERNAL int | m0_poolmach_fid_to_idx (struct m0_poolmach *pm, struct m0_fid *fid, uint32_t *idx) |
static void | poolmach_event_queue_drop (struct m0_poolmach *pm, struct m0_poolmach_event *ev) |
M0_INTERNAL void | m0_poolmach_failvec_apply (struct m0_poolmach *pm, const struct m0_ha_nvec *nvec) |
static int | poolmach_spare_inherit (struct m0_poolmach *pm, struct m0_pool *pool) |
M0_INTERNAL int | m0_poolmach_spare_build (struct m0_poolmach *mach, struct m0_pool *pool, enum m0_conf_pver_kind kind) |
M0_INTERNAL void | m0_poolmach_event_queue_apply (struct m0_poolmach *pm) |
M0_INTERNAL void | m0_poolmach_event_dump (const struct m0_poolmach_event *e) |
M0_INTERNAL void | m0_poolmach_event_list_dump (struct m0_poolmach *pm) |
M0_INTERNAL void | m0_poolmach_event_list_dump_locked (struct m0_poolmach *pm) |
M0_INTERNAL void | m0_poolmach_device_state_dump (struct m0_poolmach *pm) |
M0_INTERNAL uint64_t | m0_poolmach_nr_dev_failures (struct m0_poolmach *pm) |
M0_INTERNAL void | m0_poolmach_gob2cob (struct m0_poolmach *pm, const struct m0_fid *gfid, uint32_t idx, struct m0_fid *cob_fid) |
M0_TL_DESCR_DECLARE (poolmach_events, M0_EXTERN) | |
M0_TL_DECLARE (poolmach_events, M0_INTERNAL, struct m0_poolmach_event_link) | |
Variables | |
struct poolmach_equeue_link | M0_XCA_DOMAIN |
static int | lno = 0 |
enum m0_pool_nd_state | M0_XCA_ENUM |
#define POOL_TRACE_LEVEL M0_DEBUG |
Definition at line 1169 of file pool_machine.c.
anonymous enum |
Enumerator | |
---|---|
POOL_PM_SPARE_SLOT_UNUSED |
Definition at line 86 of file pool_machine.h.
enum m0_pool_nd_state |
A state that a pool node/device can be in.
Definition at line 57 of file pool_machine.h.
Event owner type, node or device.
Enumerator | |
---|---|
M0_POOL_NODE | |
M0_POOL_DEVICE |
Definition at line 182 of file pool_machine.h.
|
static |
Definition at line 473 of file pool_machine.c.
|
static |
|
static |
Definition at line 83 of file pool_machine.c.
M0_INTERNAL bool m0_poolmach_device_is_in_spare_usage_array | ( | struct m0_poolmach * | pm, |
uint32_t | device_index | ||
) |
Returns true if device is in the spare usage array of pool machine.
pm | Pool machine pointer in which spare usage array is populated. |
device_index | Index of device which needs to be searched. |
Definition at line 867 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_device_node_return | ( | struct m0_poolmach * | pm, |
uint32_t | device_index, | ||
struct m0_poolnode ** | node_out | ||
) |
Returns the parent node object of the specified device in the pool.
pm | pool machine. |
device_index | the index of the device to query. |
node_out | the parent node object. |
Definition at line 850 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_device_state | ( | struct m0_poolmach * | pm, |
uint32_t | device_index, | ||
enum m0_pool_nd_state * | state_out | ||
) |
Query the current state of a specified device.
pm | pool machine. |
device_index | the index of the device to query. |
state_out | the output state. |
Definition at line 816 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_device_state_dump | ( | struct m0_poolmach * | pm | ) |
Definition at line 1221 of file pool_machine.c.
M0_INTERNAL uint32_t m0_poolmach_equeue_length | ( | struct m0_poolmach * | pm | ) |
Definition at line 501 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_event_dump | ( | const struct m0_poolmach_event * | e | ) |
Definition at line 1171 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_event_list_dump | ( | struct m0_poolmach * | pm | ) |
M0_INTERNAL void m0_poolmach_event_list_dump_locked | ( | struct m0_poolmach * | pm | ) |
Definition at line 1189 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_event_queue_apply | ( | struct m0_poolmach * | pmach | ) |
Applies a set of pending events arranged in chronological order to pool machine.
Definition at line 1150 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_failvec_apply | ( | struct m0_poolmach * | pmach, |
const struct m0_ha_nvec * | nvec | ||
) |
Applies events from failure vector to pool machine.
Definition at line 999 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_fid_to_idx | ( | struct m0_poolmach * | pm, |
struct m0_fid * | fid, | ||
uint32_t * | idx | ||
) |
Returns the index within pool machine for a device with given fid.
Definition at line 968 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_fini | ( | struct m0_poolmach * | pm | ) |
Finalises the pool machine.
Definition at line 426 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_gob2cob | ( | struct m0_poolmach * | pm, |
const struct m0_fid * | gfid, | ||
uint32_t | idx, | ||
struct m0_fid * | cob_fid_out | ||
) |
Returns the idx-th component object of a global object according to the pool machine.
Definition at line 1244 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_init | ( | struct m0_poolmach * | pm, |
struct m0_pool_version * | pver, | ||
uint32_t | nr_nodes, | ||
uint32_t | nr_devices, | ||
uint32_t | nr_spare, | ||
uint32_t | max_node_failures, | ||
uint32_t | max_device_failures | ||
) |
Initialises the pool machine that stores its state in volatile memory.
Definition at line 380 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_init_by_conf | ( | struct m0_poolmach * | pm, |
struct m0_conf_pver * | pver | ||
) |
Definition at line 236 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_node_state | ( | struct m0_poolmach * | pm, |
uint32_t | node_index, | ||
enum m0_pool_nd_state * | state_out | ||
) |
Query the current state of a specified node.
pm | pool machine. |
node_index | the index of the node to query. |
state_out | the output state. |
Definition at line 833 of file pool_machine.c.
M0_INTERNAL uint64_t m0_poolmach_nr_dev_failures | ( | struct m0_poolmach * | pm | ) |
M0_INTERNAL int m0_poolmach_sns_rebalance_spare_query | ( | struct m0_poolmach * | pm, |
uint32_t | device_index, | ||
uint32_t * | spare_slot_out | ||
) |
Query the {sns rebalance, spare slot} pair of a specified device.
pm | pool machine. |
device_index | the index of the device to query. |
spare_slot_out | the output spair slot. |
Definition at line 930 of file pool_machine.c.
M0_INTERNAL bool m0_poolmach_sns_repair_spare_contains_data | ( | struct m0_poolmach * | pm, |
uint32_t | spare_slot, | ||
bool | check_state | ||
) |
Returns true if the spare slot now contains data. This case would be true when repair has already been invoked atleast once, due to which some failed data unit has been repaired onto the given spare slot.
pm | pool machine. |
spare_slot | the slot index which needs to be checked. |
check_state | check the device state before making the decision. |
Definition at line 919 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_sns_repair_spare_query | ( | struct m0_poolmach * | pm, |
uint32_t | device_index, | ||
uint32_t * | spare_slot_out | ||
) |
Query the {sns repair, spare slot} pair of a specified device.
pm | pool machine. |
device_index | the index of the device to query. |
spare_slot_out | the output spair slot. |
Definition at line 875 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_spare_build | ( | struct m0_poolmach * | mach, |
struct m0_pool * | pool, | ||
enum m0_conf_pver_kind | kind | ||
) |
Definition at line 1116 of file pool_machine.c.
M0_INTERNAL void m0_poolmach_state_last_cancel | ( | struct m0_poolmach * | pm | ) |
Remove last pool machine event.
Definition at line 796 of file pool_machine.c.
M0_INTERNAL int m0_poolmach_state_transit | ( | struct m0_poolmach * | pm, |
const struct m0_poolmach_event * | event | ||
) |
The state transition path:
+--------> OFFLINE | | | | v v
ONLINE –—> FAILED <–> SNS_REPAIRING –> SNS_REPAIRED ^ ^ | | | v | SNS_REBALANCING | | ^ | | v +---------———<----------------———+
Change the pool machine state according to this event.
event | the event to drive the state change. This event will be copied into pool machine state, and it can be used or released by caller after call. |
Definition at line 554 of file pool_machine.c.
M0_TL_DECLARE | ( | poolmach_events | , |
M0_INTERNAL | , | ||
struct m0_poolmach_event_link | |||
) |
M0_TL_DEFINE | ( | poolmach_events | , |
M0_INTERNAL | , | ||
struct m0_poolmach_event_link | |||
) |
M0_TL_DEFINE | ( | poolmach_equeue | , |
static | , | ||
struct poolmach_equeue_link | |||
) |
M0_TL_DESCR_DECLARE | ( | poolmach_events | , |
M0_EXTERN | |||
) |
M0_TL_DESCR_DEFINE | ( | poolmach_events | , |
"pool machine events list" | , | ||
M0_INTERNAL | , | ||
struct m0_poolmach_event_link | , | ||
pel_linkage | , | ||
pel_magic | , | ||
M0_POOL_EVENTS_LIST_MAGIC | , | ||
M0_POOL_EVENTS_HEAD_MAGIC | |||
) |
M0_TL_DESCR_DEFINE | ( | poolmach_equeue | , |
"pool machine events queue" | , | ||
static | , | ||
struct poolmach_equeue_link | , | ||
pel_linkage | , | ||
pel_magic | , | ||
100 | , | ||
101 | |||
) |
|
inlinestatic |
Definition at line 412 of file pool_machine.c.
|
static |
|
static |
Definition at line 160 of file pool_machine.c.
|
static |
Definition at line 203 of file pool_machine.c.
|
static |
Definition at line 479 of file pool_machine.c.
|
static |
Definition at line 983 of file pool_machine.c.
|
static |
Definition at line 365 of file pool_machine.c.
|
static |
Definition at line 1054 of file pool_machine.c.
|
static |
Definition at line 91 of file pool_machine.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 283 of file pool_machine.c.
|
static |
Definition at line 1166 of file pool_machine.c.
struct poolmach_equeue_link M0_XCA_DOMAIN |
enum m0_pool_nd_state M0_XCA_ENUM |