Motr  M0
pool_machine.c File Reference
#include "lib/trace.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "pool/pool.h"
#include "reqh/reqh.h"
#include "conf/confc.h"
#include "conf/diter.h"
#include "conf/obj_ops.h"
#include "conf/helpers.h"
#include "ioservice/fid_convert.h"
#include "ha/failvec.h"
#include "lib/finject.h"
Include dependency graph for pool_machine.c:

Go to the source code of this file.

Data Structures

struct  poolmach_equeue_link
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_POOL
 
#define POOL_TRACE_LEVEL   M0_DEBUG
 

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_clinkpoolnode_clink (struct m0_poolnode *pnode)
 
static struct m0_clinkpooldev_clink (struct m0_pooldev *pdev)
 
static struct m0_clinkexp_clink (struct m0_poolmach_state *state)
 
static struct m0_clinkready_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)
 

Variables

struct poolmach_equeue_link M0_XCA_DOMAIN
 
static int lno = 0
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_POOL

Definition at line 22 of file pool_machine.c.