Motr
M0
|
#include "lib/trace.h"
#include "conf/helpers.h"
#include "conf/obj_ops.h"
#include "conf/confc.h"
#include "conf/dir.h"
#include "conf/diter.h"
#include "conf/pvers.h"
#include "ha/note.h"
#include "reqh/reqh.h"
#include "lib/string.h"
#include "lib/memory.h"
#include "lib/finject.h"
#include "fis/fi_service.h"
Go to the source code of this file.
Macros | |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CONF |
#define | X(type) |
#define | conf_objs_count(confc, filter, arg, count, ...) |
Enumerations | |
enum | { CACHE_LOCALITY = 1 } |
Functions | |
static int | confc_obj_get (struct m0_confc *confc, const struct m0_fid *fid, struct m0_conf_obj **result) |
M0_INTERNAL bool | m0_conf_obj_is_pool (const struct m0_conf_obj *obj) |
M0_INTERNAL int | m0_conf_pver_get (struct m0_confc *confc, const struct m0_fid *pool, struct m0_conf_pver **out) |
static bool | conf_obj_is_sdev (const struct m0_conf_obj *obj) |
M0_INTERNAL int | m0_conf_device_cid_to_fid (struct m0_confc *confc, uint64_t cid, struct m0_fid *fid) |
static int | _conf_load (struct m0_conf_root *root, const struct m0_fid *path, uint32_t nr_levels) |
M0_INTERNAL int | m0_conf_full_load (struct m0_conf_root *r) |
M0_INTERNAL bool | m0_conf_service_ep_is_known (const struct m0_conf_obj *svc_obj, const char *ep_addr) |
M0_INTERNAL int | m0_confc_root_open (struct m0_confc *confc, struct m0_conf_root **root) |
M0_INTERNAL int | m0_confc_profile_open (struct m0_confc *confc, const struct m0_fid *fid, struct m0_conf_profile **out) |
static bool | conf_obj_is_service (const struct m0_conf_obj *obj) |
static int | confc_service_find (struct m0_confc *confc, enum m0_conf_service_type stype, const char *ep, struct m0_conf_obj **result) |
M0_INTERNAL int | m0_confc_service_find (struct m0_confc *confc, enum m0_conf_service_type stype, const char *ep, struct m0_conf_obj **result) |
M0_INTERNAL bool | m0_conf_service_is_top_rms (const struct m0_conf_service *svc) |
static struct m0_confc * | conf_obj2confc (const struct m0_conf_obj *obj) |
M0_INTERNAL struct m0_reqh * | m0_confc2reqh (const struct m0_confc *confc) |
M0_INTERNAL struct m0_reqh * | m0_conf_obj2reqh (const struct m0_conf_obj *obj) |
static int | conf__objs_count (struct m0_confc *confc, bool(*filter)(const struct m0_conf_obj *obj, void *arg), void *arg, uint32_t *count, int level, const struct m0_fid *path) |
M0_INTERNAL struct m0_conf_pver ** | m0_conf_pvers (const struct m0_conf_obj *obj) |
M0_INTERNAL bool | m0_disk_is_of_type (const struct m0_conf_obj *obj, uint64_t svc_types) |
M0_INTERNAL bool | m0_is_ios_disk (const struct m0_conf_obj *obj) |
M0_INTERNAL bool | m0_is_cas_disk (const struct m0_conf_obj *obj) |
static bool | dev_has_type (const struct m0_conf_obj *obj, void *arg) |
M0_INTERNAL int | m0_conf_devices_count (struct m0_confc *confc, uint64_t svc_types, uint32_t *nr_devices) |
M0_INTERNAL void | m0_confc_expired_cb (struct m0_rconfc *rconfc) |
static void | confc_ready_async_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
M0_INTERNAL void | m0_confc_ready_cb (struct m0_rconfc *rconfc) |
M0_INTERNAL int | m0_conf_process2service_get (struct m0_confc *confc, const struct m0_fid *process_fid, enum m0_conf_service_type stype, struct m0_fid *sfid) |
M0_INTERNAL int | m0_conf_objs_ha_update (struct m0_ha_nvec *nvec) |
M0_INTERNAL int | m0_conf_obj_ha_update (const struct m0_fid *obj_fid) |
static void | __ha_nvec_reset (struct m0_ha_nvec *nvec, int32_t total) |
M0_INTERNAL int | m0_conf_confc_ha_update_async (struct m0_confc *confc, struct m0_ha_nvec *nvec, struct m0_chan *chan) |
M0_INTERNAL int | m0_conf_confc_ha_update (struct m0_confc *confc) |
Variables | |
enum { ... } | M0_XCA_DOMAIN |
M0_CONF_OBJ_GETTERS | |
Returns the number of conf objects located along the path.
confc | Initialised confc. | |
filter | Returns true for objects of interest. | |
[out] | count | Output parameter. |
... | Configuration path. |
#define X | ( | type | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Asynchronous part of conf ready event processing. Intended to run clink callbacks registered with m0_reqh::rh_conf_cache_ready_async channel.
Definition at line 478 of file helpers.c.
|
static |
|
static |
M0_INTERNAL int m0_conf_confc_ha_update | ( | struct m0_confc * | confc | ) |
Update configuration objects ha state from ha service. Fetches HA state of configuration objects from HA service and updates local configuration cache.
Definition at line 658 of file helpers.c.
M0_INTERNAL int m0_conf_confc_ha_update_async | ( | struct m0_confc * | confc, |
struct m0_ha_nvec * | nvec, | ||
struct m0_chan * | chan | ||
) |
Asynchronous version of m0_conf_confc_ha_update().
nvec | should be preserved until the update completion. nvec->nv_note array will be allocated, user is responsible to free it. |
Definition at line 606 of file helpers.c.
M0_INTERNAL int m0_conf_devices_count | ( | struct m0_confc * | confc, |
uint64_t | svc_types, | ||
uint32_t * | nr_devices | ||
) |
Checks that 'obj' is of type M0_CONF_DRIVE_TYPE and this disk is attached to a service of one of types specified in 'svc_types' bitmask.
Example:
Definition at line 450 of file helpers.c.
M0_INTERNAL int m0_conf_full_load | ( | struct m0_conf_root * | r | ) |
M0_INTERNAL struct m0_reqh* m0_conf_obj2reqh | ( | const struct m0_conf_obj * | obj | ) |
M0_INTERNAL int m0_conf_obj_ha_update | ( | const struct m0_fid * | obj_fid | ) |
M0_INTERNAL bool m0_conf_obj_is_pool | ( | const struct m0_conf_obj * | obj | ) |
M0_INTERNAL int m0_conf_objs_ha_update | ( | struct m0_ha_nvec * | nvec | ) |
Update configuration objects ha state from ha service according to provided HA note vector.
The difference from m0_conf_confc_ha_state_update() is dealing with an arbitrary note vector. Client may fill in the vector following any logic that suits its needs. All the status results which respective conf objects exist in the provided confc instance cache will be applied to all HA clients currently registered with HA global context.
Definition at line 557 of file helpers.c.
M0_INTERNAL int m0_conf_process2service_get | ( | struct m0_confc * | confc, |
const struct m0_fid * | process_fid, | ||
enum m0_conf_service_type | stype, | ||
struct m0_fid * | sfid | ||
) |
M0_INTERNAL int m0_conf_pver_get | ( | struct m0_confc * | confc, |
const struct m0_fid * | pool, | ||
struct m0_conf_pver ** | out | ||
) |
Obtains a pool version that consists of online elements only.
Definition at line 71 of file helpers.c.
M0_INTERNAL struct m0_conf_pver** m0_conf_pvers | ( | const struct m0_conf_obj * | obj | ) |
Obtains m0_conf_pver array from rack/enclousure/controller.
Definition at line 400 of file helpers.c.
M0_INTERNAL bool m0_conf_service_ep_is_known | ( | const struct m0_conf_obj * | svc_obj, |
const char * | ep_addr | ||
) |
M0_INTERNAL bool m0_conf_service_is_top_rms | ( | const struct m0_conf_service * | svc | ) |
M0_INTERNAL void m0_confc_expired_cb | ( | struct m0_rconfc * | rconfc | ) |
M0_INTERNAL int m0_confc_profile_open | ( | struct m0_confc * | confc, |
const struct m0_fid * | fid, | ||
struct m0_conf_profile ** | out | ||
) |
Opens profile configuration object.
confc | Initialised confc instance. |
fid | Fid of the profile to open. |
out | Output parameter. Should be m0_confc_close()d by user. |
Definition at line 234 of file helpers.c.
M0_INTERNAL void m0_confc_ready_cb | ( | struct m0_rconfc * | rconfc | ) |
M0_INTERNAL int m0_confc_root_open | ( | struct m0_confc * | confc, |
struct m0_conf_root ** | root | ||
) |
Opens root configuration object.
confc | Initialised confc instance. |
root | Output parameter. Should be m0_confc_close()d by user. |
Definition at line 219 of file helpers.c.
M0_INTERNAL int m0_confc_service_find | ( | struct m0_confc * | confc, |
enum m0_conf_service_type | stype, | ||
const char * | ep, | ||
struct m0_conf_obj ** | result | ||
) |
Tries to find m0_conf_service object by service type and endpoint address.
Definition at line 304 of file helpers.c.
M0_INTERNAL bool m0_disk_is_of_type | ( | const struct m0_conf_obj * | obj, |
uint64_t | svc_types | ||
) |
M0_INTERNAL bool m0_is_cas_disk | ( | const struct m0_conf_obj * | obj | ) |
M0_INTERNAL bool m0_is_ios_disk | ( | const struct m0_conf_obj * | obj | ) |
enum { ... } M0_XCA_DOMAIN |