Motr  M0
helpers.h File Reference
#include "conf/obj.h"
Include dependency graph for helpers.h:

Go to the source code of this file.

Data Structures

struct  m0_confc_args
 

Macros

#define __MOTR_CONF_HELPERS_H__
 
#define M0_CONF_OBJ_GETTERS
 
#define X(type)
 

Functions

M0_INTERNAL int m0_conf_device_cid_to_fid (struct m0_confc *confc, uint64_t cid, struct m0_fid *out)
 
M0_INTERNAL int m0_conf_pver_get (struct m0_confc *confc, const struct m0_fid *pool, struct m0_conf_pver **out)
 
M0_INTERNAL int m0_conf_full_load (struct m0_conf_root *r)
 
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)
 
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 struct m0_reqhm0_conf_obj2reqh (const struct m0_conf_obj *obj)
 
M0_INTERNAL struct m0_reqhm0_confc2reqh (const struct m0_confc *confc)
 
M0_INTERNAL bool m0_conf_obj_is_pool (const struct m0_conf_obj *obj)
 
M0_INTERNAL struct m0_conf_pver ** m0_conf_pvers (const struct m0_conf_obj *obj)
 
M0_INTERNAL bool m0_conf_service_is_top_rms (const struct m0_conf_service *svc)
 
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)
 
M0_INTERNAL void m0_confc_ready_cb (struct m0_rconfc *rconfc)
 
M0_INTERNAL bool m0_conf_service_ep_is_known (const struct m0_conf_obj *svc_obj, const char *ep_addr)
 
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)
 
M0_INTERNAL int m0_conf_confc_ha_update (struct m0_confc *confc)
 
M0_INTERNAL int m0_conf_confc_ha_update_async (struct m0_confc *confc, struct m0_ha_nvec *nvec, struct m0_chan *chan)
 

Variables

 M0_CONF_OBJ_GETTERS
 

Macro Definition Documentation

◆ __MOTR_CONF_HELPERS_H__

#define __MOTR_CONF_HELPERS_H__

Definition at line 23 of file helpers.h.

◆ M0_CONF_OBJ_GETTERS

#define M0_CONF_OBJ_GETTERS
Value:
#define X(type)
Definition: helpers.h:71

Definition at line 66 of file helpers.h.

◆ X

#define X (   type)
Value:
M0_INTERNAL int type ## _get(struct m0_confc *confc, \
const struct m0_fid *fid, \
struct type **out)
struct m0_fid fid
Definition: di.c:46
static struct m0_confc * confc
Definition: file.c:94
Definition: fid.h:38
#define out(...)
Definition: gen.c:41
int type
Definition: dir.c:1031

Definition at line 71 of file helpers.h.

Function Documentation

◆ m0_conf_confc_ha_update()

M0_INTERNAL int m0_conf_confc_ha_update ( struct m0_confc confc)
Todo:
XXX RELOCATEME: This function belongs ha subsystem, not conf.

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.

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

◆ m0_conf_confc_ha_update_async()

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

Parameters
nvecshould 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.

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

◆ m0_conf_device_cid_to_fid()

M0_INTERNAL int m0_conf_device_cid_to_fid ( struct m0_confc confc,
uint64_t  cid,
struct m0_fid out 
)

Finds a device object using device index as a key.

Definition at line 100 of file helpers.c.

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

◆ m0_conf_devices_count()

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:

m0_is_disk_of_type(conf_obj, M0_BITS(M0_CST_IOS, M0_CST_CAS));
@encode
/
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);

Definition at line 450 of file helpers.c.

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

◆ m0_conf_full_load()

M0_INTERNAL int m0_conf_full_load ( struct m0_conf_root r)

Loads full configuration tree.

Definition at line 165 of file helpers.c.

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

◆ m0_conf_obj2reqh()

M0_INTERNAL struct m0_reqh* m0_conf_obj2reqh ( const struct m0_conf_obj obj)

Definition at line 351 of file helpers.c.

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

◆ m0_conf_obj_ha_update()

M0_INTERNAL int m0_conf_obj_ha_update ( const struct m0_fid obj_fid)
Todo:
XXX RELOCATEME: This function belongs ha subsystem, not conf.

Definition at line 587 of file helpers.c.

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

◆ m0_conf_obj_is_pool()

M0_INTERNAL bool m0_conf_obj_is_pool ( const struct m0_conf_obj obj)

Definition at line 66 of file helpers.c.

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

◆ m0_conf_objs_ha_update()

M0_INTERNAL int m0_conf_objs_ha_update ( struct m0_ha_nvec nvec)
Todo:
XXX RELOCATEME: This function belongs ha subsystem, not conf.

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.

Precondition
nvec->nv_nr <= M0_HA_STATE_UPDATE_LIMIT

Definition at line 557 of file helpers.c.

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

◆ m0_conf_process2service_get()

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 
)

Gets service fid of type stype from process with process_fid.

Definition at line 518 of file helpers.c.

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

◆ m0_conf_pver_get()

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.

Precondition
m0_conf_fid_type(pool) == &M0_CONF_POOL_TYPE
Note
The resulting conf object should be m0_confc_close()d eventually.
See also
m0_conf_pver_find()

Definition at line 71 of file helpers.c.

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

◆ m0_conf_pvers()

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.

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

◆ m0_conf_service_ep_is_known()

M0_INTERNAL bool m0_conf_service_ep_is_known ( const struct m0_conf_obj svc_obj,
const char *  ep_addr 
)

Finds out if service configuration includes the specified endpoint address, i.e. endpoint is known to service configuration.

Definition at line 197 of file helpers.c.

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

◆ m0_conf_service_is_top_rms()

M0_INTERNAL bool m0_conf_service_is_top_rms ( const struct m0_conf_service svc)

Definition at line 319 of file helpers.c.

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

◆ m0_confc2reqh()

M0_INTERNAL struct m0_reqh* m0_confc2reqh ( const struct m0_confc confc)

Definition at line 342 of file helpers.c.

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

◆ m0_confc_expired_cb()

M0_INTERNAL void m0_confc_expired_cb ( struct m0_rconfc rconfc)

Definition at line 465 of file helpers.c.

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

◆ m0_confc_profile_open()

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.

Parameters
confcInitialised confc instance.
fidFid of the profile to open.
outOutput parameter. Should be m0_confc_close()d by user.

Definition at line 234 of file helpers.c.

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

◆ m0_confc_ready_cb()

M0_INTERNAL void m0_confc_ready_cb ( struct m0_rconfc rconfc)

Definition at line 488 of file helpers.c.

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

◆ m0_confc_root_open()

M0_INTERNAL int m0_confc_root_open ( struct m0_confc confc,
struct m0_conf_root **  root 
)

Opens root configuration object.

Parameters
confcInitialised confc instance.
rootOutput parameter. Should be m0_confc_close()d by user.

Definition at line 219 of file helpers.c.

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

◆ m0_confc_service_find()

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.

Postcondition
ergo(rc == 0, *result == NULL || m0_conf_obj_type(*result) == &M0_CONF_SERVICE_TYPE)

Definition at line 304 of file helpers.c.

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

Variable Documentation

◆ M0_CONF_OBJ_GETTERS

M0_CONF_OBJ_GETTERS

Definition at line 75 of file helpers.h.