Motr  M0
Configuration Cache

Configuration cache comprises a set of dynamically allocated configuration objects, interconnected into directed acyclic graph (DAG). The cache is represented by m0_conf_cache structure.

A registry of cached configuration objects – m0_con_cache::ca_registry – performs the following functions:

  • maps object identities to memory addresses of these objects;
  • ensures uniqueness of configuration objects in the cache. After an object has been added to the registry, any attempt to add another one with similar identity will fail;
  • simplifies erasing of configuration cache. m0_conf_cache_fini() frees all configuration objects that are registered. No sophisticated DAG traversal is needed.
Note
Configuration consumers should not #include "conf/cache.h". This is "internal" API, used by confc and confd implementations.

Concurrency control

m0_conf_cache::ca_lock should be acquired prior to modifying cached configuration objects.

See also
Detailed Functional Specification