Motr
M0
|
There are different kinds of configuration data: configuration of filesystems, services, nodes, storage devices, etc. Configuration data is contained in configuration objects of which there are following predefined types:
Some attributes are applicable to any type of configuration object. Such common attributes are put together into m0_conf_obj structure, which is embedded into concrete configuration objects.
DAG of configuration objects:
A configuration object exists in one of three states:
These values make up m0_conf_status enumeration.
Status field of a configuration object – m0_conf_obj::co_status – is accessed and modified by object's owner (confc or confd). Initial status is M0_CS_MISSING. Possible transitions are shown on the diagram below:
If object's reference counter – m0_conf_obj::co_nrefs – is non-zero, the object is said to be pinned. Stubs cannot be pinned, only M0_CS_READY objects can. Object's reference counter is used by confc and confd implementations and is not supposed to be accessed by a configuration consumer.
Only those fields of concrete configuration objects that follow "configuration data (for the application)" comment should ever be accessed by the application. The rest of fields are private property of confc and confd implementations.