Motr  M0
pool.c File Reference
#include "lib/trace.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/assert.h"
#include "lib/hash.h"
#include "lib/string.h"
#include "conf/confc.h"
#include "conf/schema.h"
#include "conf/diter.h"
#include "conf/obj_ops.h"
#include "conf/pvers.h"
#include "conf/cache.h"
#include "conf/helpers.h"
#include "reqh/reqh_service.h"
#include "reqh/reqh.h"
#include "rpc/rpc_machine.h"
#include "ha/entrypoint.h"
#include "ha/ha.h"
#include "module/instance.h"
#include "pool/pool.h"
#include "pool/pool_fops.h"
#include "fd/fd.h"
#include "motr/setup.h"
#include "lib/finject.h"
Include dependency graph for pool.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_POOL
 

Enumerations

enum  { POOL_DEVICE_INDEX_INVALID = -1 }
 

Functions

 M0_TL_DESCR_DEFINE (pools_common_svc_ctx, "Service contexts", M0_INTERNAL, struct m0_reqh_service_ctx, sc_link, sc_magic, M0_REQH_SVC_CTX_MAGIC, M0_POOL_SVC_CTX_HEAD_MAGIC)
 
 M0_TL_DEFINE (pools_common_svc_ctx, M0_INTERNAL, struct m0_reqh_service_ctx)
 
 M0_TL_DESCR_DEFINE (pools, "pools", M0_INTERNAL, struct m0_pool, po_linkage, po_magic, M0_POOL_MAGIC, M0_POOLS_HEAD_MAGIC)
 
 M0_TL_DEFINE (pools, M0_INTERNAL, struct m0_pool)
 
 M0_TL_DESCR_DEFINE (pool_version, "pool versions", M0_INTERNAL, struct m0_pool_version, pv_linkage, pv_magic, M0_POOL_VERSION_MAGIC, M0_POOL_VERSION_HEAD_MAGIC)
 
 M0_TL_DEFINE (pool_version, M0_INTERNAL, struct m0_pool_version)
 
 M0_TL_DESCR_DEFINE (pool_failed_devs, "pool failed devices", M0_INTERNAL, struct m0_pooldev, pd_fail_linkage, pd_magic, M0_POOL_DEV_MAGIC, M0_POOL_DEVICE_HEAD_MAGIC)
 
 M0_TL_DEFINE (pool_failed_devs, M0_INTERNAL, struct m0_pooldev)
 
 M0_BOB_DEFINE (static, &pver_bob, m0_pool_version)
 
static int pools_common_refresh_locked (struct m0_pools_common *pc)
 
static int pools_common__dev2ios_build (struct m0_pools_common *pc)
 
static int pool_version_get_locked (struct m0_pools_common *pc, const struct m0_fid *pool, struct m0_pool_version **pv)
 
static void pool_version__layouts_evict (struct m0_pool_version *pv, struct m0_layout_domain *ldom)
 
static struct m0_poolpool_find (struct m0_pools_common *pc, const struct m0_fid *pool)
 
M0_INTERNAL struct m0_poolm0_pool_find (struct m0_pools_common *pc, const struct m0_fid *pool)
 
static void pool__layouts_evict (struct m0_pool *pool, struct m0_layout_domain *ldom)
 
M0_INTERNAL int m0_pools_init (void)
 
M0_INTERNAL void m0_pools_fini (void)
 
M0_INTERNAL const char * m0_pool_dev_state_to_str (enum m0_pool_nd_state state)
 
M0_INTERNAL int m0_pool_init (struct m0_pool *pool, const struct m0_fid *id, enum m0_pver_policy_code pver_policy)
 
M0_INTERNAL void m0_pool_fini (struct m0_pool *pool)
 
static bool pools_common_invariant (const struct m0_pools_common *pc)
 
static bool pool_version_invariant (const struct m0_pool_version *pv)
 
static bool obj_is_service (const struct m0_conf_obj *obj)
 
static bool is_mds (const struct m0_conf_obj *obj)
 
static int mds_map_fill (struct m0_pools_common *pc, const struct m0_conf_enclosure *encl)
 
static bool obj_is_enclosurev (const struct m0_conf_obj *obj)
 
static int pool_mds_map_init (struct m0_pools_common *pc)
 
static bool obj_is_ios_cas_diskv (const struct m0_conf_obj *obj)
 
M0_INTERNAL int m0_pool_version_device_map_init (struct m0_pool_version *pv, struct m0_conf_pver *pver, struct m0_pools_common *pc)
 
M0_INTERNAL int m0_pool_version_init (struct m0_pool_version *pv, const struct m0_fid *id, struct m0_pool *pool, uint32_t pool_width, uint32_t nr_nodes, uint32_t nr_data, uint32_t nr_failures, uint32_t nr_spare)
 
M0_INTERNAL struct m0_pool_versionm0_pool_clean_pver_find (const struct m0_pool *pool)
 
M0_INTERNAL struct m0_pool_versionm0_pool_version_lookup (const struct m0_pools_common *pc, const struct m0_fid *id)
 
M0_INTERNAL struct m0_pool_versionm0_pool_version_find (struct m0_pools_common *pc, const struct m0_fid *id)
 
static bool is_md_pool (const struct m0_pools_common *pc, const struct m0_pool *pool)
 
static bool is_dix_pool (const struct m0_pools_common *pc, const struct m0_pool *pool)
 
M0_INTERNAL int m0_pool_version_get (struct m0_pools_common *pc, const struct m0_fid *pool, struct m0_pool_version **pv)
 
static int dix_pool_version_get_locked (struct m0_pools_common *pc, struct m0_pool_version **pv)
 
M0_INTERNAL int m0_dix_pool_version_get (struct m0_pools_common *pc, struct m0_pool_version **pv)
 
static int _nodes_count (struct m0_conf_pver *pver, uint32_t *nodes)
 
M0_INTERNAL int m0_pool_version_init_by_conf (struct m0_pool_version *pv, struct m0_conf_pver *pver, struct m0_pool *pool, struct m0_pools_common *pc)
 
M0_INTERNAL void m0_pool_version_fini (struct m0_pool_version *pv)
 
M0_INTERNAL void m0_pool_versions_fini (struct m0_pool *pool)
 
M0_INTERNAL void m0_pool_versions_stale_mark (struct m0_pools_common *pc, struct m0_confc_update_state *s)
 
M0_INTERNAL struct m0_pool_versionm0_pool_version_dix_get (const struct m0_pools_common *pc)
 
M0_INTERNAL struct m0_pool_versionm0_pool_version_md_get (const struct m0_pools_common *pc)
 
static void service_ctxs_destroy (struct m0_pools_common *pc)
 
static bool reqh_svc_ctx_is_in_pools (struct m0_pools_common *pc, struct m0_conf_service *cs)
 
static int __service_ctx_create (struct m0_pools_common *pc, struct m0_conf_service *cs, bool services_connect)
 
static bool is_local_svc (const struct m0_conf_service *svc, enum m0_conf_service_type stype)
 
static int active_rm_ctx_create (struct m0_pools_common *pc, bool service_connect)
 
static struct m0_reqh_service_ctxactive_rm_ctx_find (struct m0_pools_common *pc)
 
static int service_ctxs_create (struct m0_pools_common *pc, bool service_connect)
 
static bool service_ctx_ha_entrypoint_cb (struct m0_clink *clink)
 
M0_INTERNAL struct m0_rpc_sessionm0_pools_common_active_rm_session (struct m0_pools_common *pc)
 
static struct m0_reqh_service_ctxservice_ctx_find_by_type (const struct m0_pools_common *pc, enum m0_conf_service_type type)
 
M0_INTERNAL struct m0_reqh_service_ctxm0_pools_common_service_ctx_find (const struct m0_pools_common *pc, const struct m0_fid *id, enum m0_conf_service_type type)
 
static bool pools_common_conf_expired_cb (struct m0_clink *clink)
 
static bool reqh_service_ctx_is_matching (const struct m0_reqh_service_ctx *ctx, const struct m0_conf_obj *svc)
 
static void reqh_service_ctx_abandon (struct m0_reqh_service_ctx *ctx)
 
static void pools_common__ctx_subscribe_or_abandon (struct m0_pools_common *pc)
 
static void pools_common__md_pool_cleanup (struct m0_pools_common *pc)
 
static void pools_common__pools_update_or_cleanup (struct m0_pools_common *pc)
 
static int pools_common__update_by_conf (struct m0_pools_common *pc)
 
M0_INTERNAL bool m0_pools_common_conf_ready_async_cb (struct m0_clink *clink)
 
M0_INTERNAL int m0_pools_common_init (struct m0_pools_common *pc, struct m0_rpc_machine *rmach)
 
M0_INTERNAL int m0__pools_common_init (struct m0_pools_common *pc, struct m0_rpc_machine *rmach, struct m0_conf_root *root)
 
static int pools_common_refresh (struct m0_pools_common *pc)
 
M0_INTERNAL int m0_pools_service_ctx_create (struct m0_pools_common *pc)
 
M0_INTERNAL void m0_pools_common_fini (struct m0_pools_common *pc)
 
static void abandoned_svc_ctxs_cleanup (struct m0_pools_common *pc)
 
M0_INTERNAL void m0_pools_common_service_ctx_connect_sync (struct m0_pools_common *pc)
 
M0_INTERNAL void m0_pools_service_ctx_destroy (struct m0_pools_common *pc)
 
static bool is_actual_pver (const struct m0_conf_obj *obj)
 
M0_INTERNAL int m0_pool_versions_setup (struct m0_pools_common *pc)
 
static int pool_from_virtual_pver (const struct m0_conf_pver *virtual, struct m0_confc *confc, struct m0_conf_pool **out)
 
M0_INTERNAL int m0_pool_version_append (struct m0_pools_common *pc, struct m0_conf_pver *pver, struct m0_pool_version **pv)
 
static int _pool_create (struct m0_pool **out, const struct m0_conf_pool *conf_pool)
 
static void dix_pool_setup (struct m0_pools_common *pc, const struct m0_fid *imeta_pver)
 
static bool profile_has_pool (const struct m0_conf_profile *profile, const struct m0_fid *pool)
 
M0_INTERNAL int m0_pools_setup (struct m0_pools_common *pc, const struct m0_fid *profile, struct m0_sm_group *sm_grp, struct m0_dtm *dtm)
 
M0_INTERNAL void m0_pool_versions_destroy (struct m0_pools_common *pc)
 
M0_INTERNAL void m0_pools_destroy (struct m0_pools_common *pc)
 
M0_INTERNAL uint64_t m0_pool_version2layout_id (const struct m0_fid *pv_fid, uint64_t lid)
 
M0_INTERNAL uint32_t m0_ha2pm_state_map (enum m0_ha_obj_state hastate)
 
static bool node_poolmach_state_update_cb (struct m0_clink *cl)
 
static bool disks_poolmach_state_update_cb (struct m0_clink *cl)
 
M0_INTERNAL void m0_poolnode_clink_del (struct m0_clink *cl)
 
M0_INTERNAL void m0_poolnode_clink_add (struct m0_clink *link, struct m0_chan *chan)
 
M0_INTERNAL void m0_pooldev_clink_del (struct m0_clink *cl)
 
M0_INTERNAL void m0_pooldev_clink_add (struct m0_clink *link, struct m0_chan *chan)
 
M0_INTERNAL int m0_pool_device_reopen (struct m0_poolmach *pm, struct m0_reqh *reqh)
 
static int pool_device_index (const struct m0_poolmach *pm, const struct m0_fid *fid)
 
static void pool_device_state_last_revert (struct m0_pools_common *pc, struct m0_fid *dev_fid, struct m0_poolmach *pm_stop)
 
M0_INTERNAL int m0_pool_device_state_update (struct m0_reqh *reqh, struct m0_be_tx *tx, struct m0_fid *dev_fid, enum m0_pool_nd_state new_state)
 
M0_INTERNAL void m0_pools_lock (struct m0_pools_common *pc)
 
M0_INTERNAL void m0_pools_unlock (struct m0_pools_common *pc)
 
M0_INTERNAL bool m0_pools_is_locked (struct m0_pools_common *pc)
 

Variables

static const struct m0_bob_type pver_bob
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_POOL

Definition at line 22 of file pool.c.