Motr  M0
Storage pools.

Data Structures

struct  m0_pool_device_to_service
 
struct  m0_pool
 
struct  m0_pool_version
 
struct  m0_pools_common
 
struct  m0_poolnode
 
struct  m0_pooldev
 
struct  m0_pool_spare_usage
 

Enumerations

enum  { POOL_DEVICE_INDEX_INVALID = -1 }
 
enum  {
  PM_DEFAULT_NR_NODES = 10, PM_DEFAULT_NR_DEV = 80, PM_DEFAULT_MAX_NODE_FAILURES = 1, PM_DEFAULT_MAX_DEV_FAILURES = 80,
  POOL_MAX_RPC_NR_IN_FLIGHT = 100
}
 
enum  map_type { IOS = 1, MDS }
 
enum  { PV_SNS_DIRTY = 1 << 0 }
 
enum  m0_poolnode_format_version { M0_POOLNODE_FORMAT_VERSION_1 = 1, M0_POOLNODE_FORMAT_VERSION = M0_POOLNODE_FORMAT_VERSION_1 }
 
enum  m0_pooldev_format_version { M0_POOLDEV_FORMAT_VERSION_1 = 1, M0_POOLDEV_FORMAT_VERSION = M0_POOLDEV_FORMAT_VERSION_1 }
 
enum  m0_pool_spare_usage_format_version { M0_POOL_SPARE_USAGE_FORMAT_VERSION_1 = 1, M0_POOL_SPARE_USAGE_FORMAT_VERSION = M0_POOL_SPARE_USAGE_FORMAT_VERSION_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)
 
 M0_TL_DESCR_DECLARE (pools_common_svc_ctx, M0_EXTERN)
 
 M0_TL_DECLARE (pools_common_svc_ctx, M0_EXTERN, struct m0_reqh_service_ctx)
 
 M0_TL_DESCR_DECLARE (pool_version, M0_EXTERN)
 
 M0_TL_DECLARE (pool_version, M0_EXTERN, struct m0_pool_version)
 
 M0_TL_DESCR_DECLARE (pools, M0_EXTERN)
 
 M0_TL_DECLARE (pools, M0_EXTERN, struct m0_pool)
 
 M0_TL_DESCR_DECLARE (pool_failed_devs, M0_EXTERN)
 
 M0_TL_DECLARE (pool_failed_devs, M0_EXTERN, struct m0_pooldev)
 
M0_INTERNAL int m0_pool_versions_init_by_conf (struct m0_pool *pool, struct m0_pools_common *pc, const struct m0_conf_pool *cp, struct m0_sm_group *sm_grp, struct m0_dtm *dtm)
 
 M0_BASSERT (sizeof(enum m0_pool_nd_state)==4)
 
struct m0_pool_spare_usage M0_XCA_DOMAIN (be)
 

Variables

static const struct m0_bob_type pver_bob
 
enum m0_pool_spare_usage_format_version M0_XCA_DOMAIN
 

Detailed Description

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
POOL_DEVICE_INDEX_INVALID 

Status "Device not found in Pool machine"

Definition at line 186 of file pool.c.

◆ anonymous enum

anonymous enum
Enumerator
PM_DEFAULT_NR_NODES 
PM_DEFAULT_NR_DEV 
PM_DEFAULT_MAX_NODE_FAILURES 
PM_DEFAULT_MAX_DEV_FAILURES 
POOL_MAX_RPC_NR_IN_FLIGHT 

Definition at line 55 of file pool.h.

◆ anonymous enum

anonymous enum
Enumerator
PV_SNS_DIRTY 

Definition at line 68 of file pool.h.

◆ m0_pool_spare_usage_format_version

Enumerator
M0_POOL_SPARE_USAGE_FORMAT_VERSION_1 
M0_POOL_SPARE_USAGE_FORMAT_VERSION 

Current version, should point to the latest version present

Definition at line 487 of file pool.h.

◆ m0_pooldev_format_version

Enumerator
M0_POOLDEV_FORMAT_VERSION_1 
M0_POOLDEV_FORMAT_VERSION 

Current version, should point to the latest version present

Definition at line 459 of file pool.h.

◆ m0_poolnode_format_version

Enumerator
M0_POOLNODE_FORMAT_VERSION_1 
M0_POOLNODE_FORMAT_VERSION 

Current version, should point to the latest version present

Definition at line 409 of file pool.h.

◆ map_type

enum map_type
Enumerator
IOS 
MDS 

Definition at line 63 of file pool.h.

Function Documentation

◆ __service_ctx_create()

static int __service_ctx_create ( struct m0_pools_common pc,
struct m0_conf_service cs,
bool  services_connect 
)
static

Creates service contexts from given struct m0_conf_service. Creates service context for each endpoint in m0_conf_service::cs_endpoints.

Definition at line 891 of file pool.c.

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

◆ _nodes_count()

static int _nodes_count ( struct m0_conf_pver pver,
uint32_t *  nodes 
)
static

Definition at line 716 of file pool.c.

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

◆ _pool_create()

static int _pool_create ( struct m0_pool **  out,
const struct m0_conf_pool conf_pool 
)
static

Definition at line 1767 of file pool.c.

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

◆ abandoned_svc_ctxs_cleanup()

static void abandoned_svc_ctxs_cleanup ( struct m0_pools_common pc)
static

Destroys all service contexts kept in m0_pools_common::pc_abandoned_svc_ctxs list.

Definition at line 1579 of file pool.c.

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

◆ active_rm_ctx_create()

static int active_rm_ctx_create ( struct m0_pools_common pc,
bool  service_connect 
)
static

Definition at line 955 of file pool.c.

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

◆ active_rm_ctx_find()

static struct m0_reqh_service_ctx* active_rm_ctx_find ( struct m0_pools_common pc)
static

Definition at line 974 of file pool.c.

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

◆ disks_poolmach_state_update_cb()

static bool disks_poolmach_state_update_cb ( struct m0_clink cl)
static

Definition at line 1941 of file pool.c.

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

◆ dix_pool_setup()

static void dix_pool_setup ( struct m0_pools_common pc,
const struct m0_fid imeta_pver 
)
static

Definition at line 1782 of file pool.c.

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

◆ dix_pool_version_get_locked()

static int dix_pool_version_get_locked ( struct m0_pools_common pc,
struct m0_pool_version **  pv 
)
static

Definition at line 675 of file pool.c.

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

◆ is_actual_pver()

static bool is_actual_pver ( const struct m0_conf_obj obj)
static
Todo:
XXX filter only actual pool versions till formulaic pool version creation in place.

Definition at line 1630 of file pool.c.

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

◆ is_dix_pool()

static bool is_dix_pool ( const struct m0_pools_common pc,
const struct m0_pool pool 
)
static

Definition at line 624 of file pool.c.

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

◆ is_local_svc()

static bool is_local_svc ( const struct m0_conf_service svc,
enum m0_conf_service_type  stype 
)
static

Definition at line 935 of file pool.c.

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

◆ is_md_pool()

static bool is_md_pool ( const struct m0_pools_common pc,
const struct m0_pool pool 
)
static

Definition at line 617 of file pool.c.

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

◆ is_mds()

static bool is_mds ( const struct m0_conf_obj obj)
static

Definition at line 346 of file pool.c.

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

◆ m0__pools_common_init()

M0_INTERNAL int m0__pools_common_init ( struct m0_pools_common pc,
struct m0_rpc_machine rmach,
struct m0_conf_root root 
)

Definition at line 1437 of file pool.c.

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

◆ M0_BASSERT()

M0_BASSERT ( sizeof(enum m0_pool_nd_state = =4)

◆ M0_BOB_DEFINE()

M0_BOB_DEFINE ( static  ,
pver_bob,
m0_pool_version   
)

◆ m0_dix_pool_version_get()

M0_INTERNAL int m0_dix_pool_version_get ( struct m0_pools_common pc,
struct m0_pool_version **  pv 
)

Definition at line 704 of file pool.c.

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

◆ m0_ha2pm_state_map()

M0_INTERNAL uint32_t m0_ha2pm_state_map ( enum m0_ha_obj_state  hastate)

Definition at line 1905 of file pool.c.

Here is the caller graph for this function:

◆ m0_pool_clean_pver_find()

M0_INTERNAL struct m0_pool_version * m0_pool_clean_pver_find ( const struct m0_pool pool)

Definition at line 556 of file pool.c.

Here is the caller graph for this function:

◆ m0_pool_dev_state_to_str()

M0_INTERNAL const char* m0_pool_dev_state_to_str ( enum m0_pool_nd_state  state)

Converts numeric device state to string representation.

Definition at line 290 of file pool.c.

Here is the caller graph for this function:

◆ m0_pool_device_reopen()

M0_INTERNAL int m0_pool_device_reopen ( struct m0_poolmach pm,
struct m0_reqh reqh 
)

Find out device ids of the REPAIRED devices in the given pool machine and call m0_motr_stob_reopen() on each of them.

Definition at line 2011 of file pool.c.

Here is the call graph for this function:

◆ m0_pool_device_state_update()

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 
)

Iterate over all pool versions and update corresponding poolmachines containing provided disk.

Definition at line 2068 of file pool.c.

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

◆ m0_pool_find()

M0_INTERNAL struct m0_pool* m0_pool_find ( struct m0_pools_common pc,
const struct m0_fid pool 
)

Definition at line 257 of file pool.c.

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

◆ m0_pool_fini()

M0_INTERNAL void m0_pool_fini ( struct m0_pool pool)

Definition at line 322 of file pool.c.

Here is the caller graph for this function:

◆ m0_pool_init()

M0_INTERNAL int m0_pool_init ( struct m0_pool pool,
const struct m0_fid id,
enum m0_pver_policy_code  pver_policy 
)

Definition at line 307 of file pool.c.

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

◆ m0_pool_version2layout_id()

M0_INTERNAL uint64_t m0_pool_version2layout_id ( const struct m0_fid pv_fid,
uint64_t  lid 
)

Generates layout id from pool version fid

Definition at line 1900 of file pool.c.

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

◆ m0_pool_version_append()

M0_INTERNAL int m0_pool_version_append ( struct m0_pools_common pc,
struct m0_conf_pver pver,
struct m0_pool_version **  pv 
)

Appends in-memory pool version to pool versions list. It dynamically generate new pool version using base pool version and current failed set.

Definition at line 1725 of file pool.c.

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

◆ m0_pool_version_device_map_init()

M0_INTERNAL int m0_pool_version_device_map_init ( struct m0_pool_version pv,
struct m0_conf_pver pver,
struct m0_pools_common pc 
)

Definition at line 447 of file pool.c.

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

◆ m0_pool_version_dix_get()

M0_INTERNAL struct m0_pool_version * m0_pool_version_dix_get ( const struct m0_pools_common pc)

Definition at line 833 of file pool.c.

Here is the caller graph for this function:

◆ m0_pool_version_find()

M0_INTERNAL struct m0_pool_version * m0_pool_version_find ( struct m0_pools_common pc,
const struct m0_fid id 
)

Definition at line 586 of file pool.c.

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

◆ m0_pool_version_fini()

M0_INTERNAL void m0_pool_version_fini ( struct m0_pool_version pv)

Definition at line 786 of file pool.c.

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

◆ m0_pool_version_get()

M0_INTERNAL int m0_pool_version_get ( struct m0_pools_common pc,
const struct m0_fid pool,
struct m0_pool_version **  pv 
)

Gets pool version from in-memory list of pools (pc->pc_pools).

Parameters
pool- if not NULL, get the version of it, otherwise, select the pool as per internally defined policy.
See also
m0_conf_pver_get(), m0_conf_pver_find()

Definition at line 662 of file pool.c.

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

◆ m0_pool_version_init()

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 
)

Definition at line 522 of file pool.c.

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

◆ m0_pool_version_init_by_conf()

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 
)

Initialises pool version from configuration data.

Definition at line 748 of file pool.c.

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

◆ m0_pool_version_lookup()

M0_INTERNAL struct m0_pool_version * m0_pool_version_lookup ( const struct m0_pools_common pc,
const struct m0_fid id 
)

Definition at line 568 of file pool.c.

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

◆ m0_pool_version_md_get()

M0_INTERNAL struct m0_pool_version * m0_pool_version_md_get ( const struct m0_pools_common pc)

Definition at line 841 of file pool.c.

Here is the caller graph for this function:

◆ m0_pool_versions_destroy()

M0_INTERNAL void m0_pool_versions_destroy ( struct m0_pools_common pc)

Definition at line 1876 of file pool.c.

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

◆ m0_pool_versions_fini()

M0_INTERNAL void m0_pool_versions_fini ( struct m0_pool pool)

Definition at line 801 of file pool.c.

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

◆ m0_pool_versions_init_by_conf()

M0_INTERNAL int m0_pool_versions_init_by_conf ( struct m0_pool pool,
struct m0_pools_common pc,
const struct m0_conf_pool cp,
struct m0_sm_group sm_grp,
struct m0_dtm dtm 
)

◆ m0_pool_versions_setup()

M0_INTERNAL int m0_pool_versions_setup ( struct m0_pools_common pc)

Definition at line 1640 of file pool.c.

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

◆ m0_pool_versions_stale_mark()

M0_INTERNAL void m0_pool_versions_stale_mark ( struct m0_pools_common pc,
struct m0_confc_update_state s 
)

Definition at line 811 of file pool.c.

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

◆ m0_pooldev_clink_add()

M0_INTERNAL void m0_pooldev_clink_add ( struct m0_clink link,
struct m0_chan chan 
)

Register clink of pooldev to disk conf object's wait channel to receive HA notifications.

Definition at line 1999 of file pool.c.

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

◆ m0_pooldev_clink_del()

M0_INTERNAL void m0_pooldev_clink_del ( struct m0_clink cl)

Delete clink of pooldev

Definition at line 1984 of file pool.c.

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

◆ m0_poolnode_clink_add()

M0_INTERNAL void m0_poolnode_clink_add ( struct m0_clink link,
struct m0_chan chan 
)

Register clink of poolnode to node conf object's wait channel to receive HA notifications.

Definition at line 1977 of file pool.c.

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

◆ m0_poolnode_clink_del()

M0_INTERNAL void m0_poolnode_clink_del ( struct m0_clink cl)

Delete clink of poolnode

Definition at line 1962 of file pool.c.

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

◆ m0_pools_common_active_rm_session()

M0_INTERNAL struct m0_rpc_session * m0_pools_common_active_rm_session ( struct m0_pools_common pc)

Creates service contexts from given struct m0_conf_service. Creates service context for each endpoint in m0_conf_service::cs_endpoints.

Definition at line 1074 of file pool.c.

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

◆ m0_pools_common_conf_ready_async_cb()

M0_INTERNAL bool m0_pools_common_conf_ready_async_cb ( struct m0_clink clink)

Callback called when new configuration is ready.

Todo:
XXX: See if we could do anything with the failed update here. But so far we just cross fingers and hope it succeeds.

Definition at line 1358 of file pool.c.

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

◆ m0_pools_common_fini()

M0_INTERNAL void m0_pools_common_fini ( struct m0_pools_common pc)

Definition at line 1549 of file pool.c.

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

◆ m0_pools_common_init()

M0_INTERNAL int m0_pools_common_init ( struct m0_pools_common pc,
struct m0_rpc_machine rmach 
)

Definition at line 1425 of file pool.c.

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

◆ m0_pools_common_service_ctx_connect_sync()

M0_INTERNAL void m0_pools_common_service_ctx_connect_sync ( struct m0_pools_common pc)

Definition at line 1608 of file pool.c.

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

◆ m0_pools_common_service_ctx_find()

M0_INTERNAL struct m0_reqh_service_ctx * m0_pools_common_service_ctx_find ( const struct m0_pools_common pc,
const struct m0_fid id,
enum m0_conf_service_type  type 
)

Definition at line 1095 of file pool.c.

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

◆ m0_pools_destroy()

M0_INTERNAL void m0_pools_destroy ( struct m0_pools_common pc)

Definition at line 1887 of file pool.c.

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

◆ m0_pools_fini()

M0_INTERNAL void m0_pools_fini ( void  )

Definition at line 283 of file pool.c.

Here is the call graph for this function:

◆ m0_pools_init()

M0_INTERNAL int m0_pools_init ( void  )

Definition at line 273 of file pool.c.

Here is the call graph for this function:

◆ m0_pools_is_locked()

M0_INTERNAL bool m0_pools_is_locked ( struct m0_pools_common pc)

Definition at line 2115 of file pool.c.

Here is the call graph for this function:

◆ m0_pools_lock()

M0_INTERNAL void m0_pools_lock ( struct m0_pools_common pc)

Definition at line 2105 of file pool.c.

Here is the call graph for this function:

◆ m0_pools_service_ctx_create()

M0_INTERNAL int m0_pools_service_ctx_create ( struct m0_pools_common pc)

Definition at line 1535 of file pool.c.

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

◆ m0_pools_service_ctx_destroy()

M0_INTERNAL void m0_pools_service_ctx_destroy ( struct m0_pools_common pc)

Definition at line 1617 of file pool.c.

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

◆ m0_pools_setup()

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 
)

Setups pools at . If is NULL - use all pools available in configuration. Otherwise, only those that belongs to the specified .

Note
clients should specify .

Definition at line 1810 of file pool.c.

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

◆ m0_pools_unlock()

M0_INTERNAL void m0_pools_unlock ( struct m0_pools_common pc)

Definition at line 2110 of file pool.c.

Here is the call graph for this function:

◆ M0_TL_DECLARE() [1/4]

M0_TL_DECLARE ( pools_common_svc_ctx  ,
M0_EXTERN  ,
struct m0_reqh_service_ctx   
)

◆ M0_TL_DECLARE() [2/4]

M0_TL_DECLARE ( pool_version  ,
M0_EXTERN  ,
struct m0_pool_version   
)

◆ M0_TL_DECLARE() [3/4]

M0_TL_DECLARE ( pools  ,
M0_EXTERN  ,
struct m0_pool   
)

◆ M0_TL_DECLARE() [4/4]

M0_TL_DECLARE ( pool_failed_devs  ,
M0_EXTERN  ,
struct m0_pooldev   
)

◆ M0_TL_DEFINE() [1/4]

M0_TL_DEFINE ( pools_common_svc_ctx  ,
M0_INTERNAL  ,
struct m0_reqh_service_ctx   
)

◆ M0_TL_DEFINE() [2/4]

M0_TL_DEFINE ( pools  ,
M0_INTERNAL  ,
struct m0_pool   
)

◆ M0_TL_DEFINE() [3/4]

M0_TL_DEFINE ( pool_version  ,
M0_INTERNAL  ,
struct m0_pool_version   
)

◆ M0_TL_DEFINE() [4/4]

M0_TL_DEFINE ( pool_failed_devs  ,
M0_INTERNAL  ,
struct m0_pooldev   
)

◆ M0_TL_DESCR_DECLARE() [1/4]

M0_TL_DESCR_DECLARE ( pools_common_svc_ctx  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [2/4]

M0_TL_DESCR_DECLARE ( pool_version  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [3/4]

M0_TL_DESCR_DECLARE ( pools  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [4/4]

M0_TL_DESCR_DECLARE ( pool_failed_devs  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DEFINE() [1/4]

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   
)

tlist descriptor for list of m0_reqh_service_ctx objects placed in m0_pools_common::pc_svc_ctxs list using sc_link.

◆ M0_TL_DESCR_DEFINE() [2/4]

M0_TL_DESCR_DEFINE ( pools  ,
"pools"  ,
M0_INTERNAL  ,
struct m0_pool  ,
po_linkage  ,
po_magic  ,
M0_POOL_MAGIC  ,
M0_POOLS_HEAD_MAGIC   
)

tlist descriptor for list of m0_pool objects placed in m0t1fs_sb::csb_pools list using sc_link.

◆ M0_TL_DESCR_DEFINE() [3/4]

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_DESCR_DEFINE() [4/4]

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_XCA_DOMAIN()

struct m0_pool_spare_usage M0_XCA_DOMAIN ( be  )

◆ mds_map_fill()

static int mds_map_fill ( struct m0_pools_common pc,
const struct m0_conf_enclosure encl 
)
static

Fills pc->pc_mds_map[] with service contexts (m0_reqh_service_ctx) of the meta-data services run on the node associated with encl.

Definition at line 356 of file pool.c.

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

◆ node_poolmach_state_update_cb()

static bool node_poolmach_state_update_cb ( struct m0_clink cl)
static

Definition at line 1920 of file pool.c.

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

◆ obj_is_enclosurev()

static bool obj_is_enclosurev ( const struct m0_conf_obj obj)
static

Definition at line 387 of file pool.c.

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

◆ obj_is_ios_cas_diskv()

static bool obj_is_ios_cas_diskv ( const struct m0_conf_obj obj)
static

Definition at line 440 of file pool.c.

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

◆ obj_is_service()

static bool obj_is_service ( const struct m0_conf_obj obj)
static

Definition at line 341 of file pool.c.

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

◆ pool__layouts_evict()

static void pool__layouts_evict ( struct m0_pool pool,
struct m0_layout_domain ldom 
)
static

Definition at line 1296 of file pool.c.

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

◆ pool_device_index()

static int pool_device_index ( const struct m0_poolmach pm,
const struct m0_fid fid 
)
static

Definition at line 2034 of file pool.c.

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

◆ pool_device_state_last_revert()

static void pool_device_state_last_revert ( struct m0_pools_common pc,
struct m0_fid dev_fid,
struct m0_poolmach pm_stop 
)
static

Definition at line 2043 of file pool.c.

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

◆ pool_find()

static struct m0_pool* pool_find ( struct m0_pools_common pc,
const struct m0_fid pool 
)
static

Definition at line 240 of file pool.c.

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

◆ pool_from_virtual_pver()

static int pool_from_virtual_pver ( const struct m0_conf_pver virtual,
struct m0_confc confc,
struct m0_conf_pool **  out 
)
static

Definition at line 1703 of file pool.c.

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

◆ pool_mds_map_init()

static int pool_mds_map_init ( struct m0_pools_common pc)
static

Definition at line 394 of file pool.c.

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

◆ pool_version__layouts_evict()

static void pool_version__layouts_evict ( struct m0_pool_version pv,
struct m0_layout_domain ldom 
)
static

Definition at line 1308 of file pool.c.

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

◆ pool_version_get_locked()

static int pool_version_get_locked ( struct m0_pools_common pc,
const struct m0_fid pool,
struct m0_pool_version **  pv 
)
static

Definition at line 631 of file pool.c.

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

◆ pool_version_invariant()

static bool pool_version_invariant ( const struct m0_pool_version pv)
static

Definition at line 335 of file pool.c.

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

◆ pools_common__ctx_subscribe_or_abandon()

static void pools_common__ctx_subscribe_or_abandon ( struct m0_pools_common pc)
static

Every previously existing reqh service context must be checked for being known to new conf and remained unchanged. During this check the unchanged service context is subscribed to HA notifications. Otherwise the context is abandoned and ultimately instructed to disconnect.

Definition at line 1223 of file pool.c.

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

◆ pools_common__dev2ios_build()

static int pools_common__dev2ios_build ( struct m0_pools_common pc)
static

Definition at line 1408 of file pool.c.

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

◆ pools_common__md_pool_cleanup()

static void pools_common__md_pool_cleanup ( struct m0_pools_common pc)
static

Definition at line 1249 of file pool.c.

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

◆ pools_common__pools_update_or_cleanup()

static void pools_common__pools_update_or_cleanup ( struct m0_pools_common pc)
static

Definition at line 1257 of file pool.c.

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

◆ pools_common__update_by_conf()

static int pools_common__update_by_conf ( struct m0_pools_common pc)
static

Definition at line 1333 of file pool.c.

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

◆ pools_common_conf_expired_cb()

static bool pools_common_conf_expired_cb ( struct m0_clink clink)
static

Callback called on configuration expiration detected by rconfc. In the course of handling all existing reqh service contexts are unsubscribed from HA notifications. This lets conf cache be drained.

Note
The context connection state remains unchanged.

Definition at line 1110 of file pool.c.

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

◆ pools_common_invariant()

static bool pools_common_invariant ( const struct m0_pools_common pc)
static

Definition at line 330 of file pool.c.

Here is the caller graph for this function:

◆ pools_common_refresh()

static int pools_common_refresh ( struct m0_pools_common pc)
static

Definition at line 1525 of file pool.c.

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

◆ pools_common_refresh_locked()

static int pools_common_refresh_locked ( struct m0_pools_common pc)
static

Refreshing m0_pools_common implies:

Definition at line 1494 of file pool.c.

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

◆ profile_has_pool()

static bool profile_has_pool ( const struct m0_conf_profile profile,
const struct m0_fid pool 
)
static

Definition at line 1803 of file pool.c.

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

◆ reqh_service_ctx_abandon()

static void reqh_service_ctx_abandon ( struct m0_reqh_service_ctx ctx)
static

Moves reqh service context from m0_pools_common::pc_svc_ctx list to m0_reqh::rh_abandoned_svc_ctxs list. Once abandoned the context appears unlinked from rconfc events and instructed to disconnect itself asynchronously.

Definition at line 1179 of file pool.c.

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

◆ reqh_service_ctx_is_matching()

static bool reqh_service_ctx_is_matching ( const struct m0_reqh_service_ctx ctx,
const struct m0_conf_obj svc 
)
static

Service context is matching to current configuration only when 1) respective service object is found in conf, i.e. not NULL, 2) belongs to the process with originally known and not changed fid, and 3) has its rpc connection endpoint in the conf.

Definition at line 1161 of file pool.c.

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

◆ reqh_svc_ctx_is_in_pools()

static bool reqh_svc_ctx_is_in_pools ( struct m0_pools_common pc,
struct m0_conf_service cs 
)
static

Definition at line 880 of file pool.c.

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

◆ service_ctx_find_by_type()

static struct m0_reqh_service_ctx* service_ctx_find_by_type ( const struct m0_pools_common pc,
enum m0_conf_service_type  type 
)
static

Definition at line 1087 of file pool.c.

Here is the caller graph for this function:

◆ service_ctx_ha_entrypoint_cb()

static bool service_ctx_ha_entrypoint_cb ( struct m0_clink clink)
static

Definition at line 1044 of file pool.c.

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

◆ service_ctxs_create()

static int service_ctxs_create ( struct m0_pools_common pc,
bool  service_connect 
)
static
Todo:
: This needs to be converted to process (m0d) context since it connects to specific process endpoint.

Definition at line 985 of file pool.c.

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

◆ service_ctxs_destroy()

static void service_ctxs_destroy ( struct m0_pools_common pc)
static

Definition at line 848 of file pool.c.

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

Variable Documentation

◆ M0_XCA_DOMAIN

◆ pver_bob

const struct m0_bob_type pver_bob
static
Initial value:
= {
.bt_name = "m0_pool_version",
.bt_magix_offset = M0_MAGIX_OFFSET(struct m0_pool_version, pv_magic),
.bt_magix = M0_POOL_VERSION_MAGIC,
.bt_check = NULL
}
#define NULL
Definition: misc.h:38
#define M0_MAGIX_OFFSET(type, field)
Definition: misc.h:356

Definition at line 224 of file pool.c.