|
| M0_TL_DESCR_DEFINE (m0_conf_cache, "registered m0_conf_obj-s",, struct m0_conf_obj, co_cache_link, co_gen_magic, M0_CONF_OBJ_MAGIC, M0_CONF_CACHE_MAGIC) |
|
| M0_TL_DEFINE (m0_conf_cache, M0_INTERNAL, struct m0_conf_obj) |
|
M0_INTERNAL void | m0_conf_cache_lock (struct m0_conf_cache *cache) |
|
M0_INTERNAL void | m0_conf_cache_unlock (struct m0_conf_cache *cache) |
|
M0_INTERNAL bool | m0_conf_cache_is_locked (const struct m0_conf_cache *cache) |
|
M0_INTERNAL void | m0_conf_cache_init (struct m0_conf_cache *cache, struct m0_mutex *lock) |
|
M0_INTERNAL int | m0_conf_cache_add (struct m0_conf_cache *cache, struct m0_conf_obj *obj) |
|
M0_INTERNAL bool | m0_conf_cache_contains (struct m0_conf_cache *cache, const struct m0_fid *fid) |
|
M0_INTERNAL struct m0_conf_obj * | m0_conf_cache_lookup (const struct m0_conf_cache *cache, const struct m0_fid *id) |
|
static void | _obj_del (struct m0_conf_obj *obj) |
|
M0_INTERNAL void | m0_conf_cache_del (const struct m0_conf_cache *cache, struct m0_conf_obj *obj) |
|
static void | conf_cache_clean (struct m0_conf_cache *cache, const struct m0_conf_obj_type *type, bool gc) |
|
M0_INTERNAL void | m0_conf_cache_clean (struct m0_conf_cache *cache, const struct m0_conf_obj_type *type) |
|
M0_INTERNAL void | m0_conf_cache_gc (struct m0_conf_cache *cache) |
|
M0_INTERNAL void | m0_conf_cache_fini (struct m0_conf_cache *cache) |
|
static int | conf_encode (struct m0_confx *enc, const struct m0_conf_obj *obj, bool debug) |
|
static int | conf_cache_encode (const struct m0_conf_cache *cache, struct m0_confx *dest, bool debug) |
|
M0_INTERNAL int | m0_conf_cache_to_string (struct m0_conf_cache *cache, char **str, bool debug) |
|
M0_INTERNAL int | m0_conf_cache_from_string (struct m0_conf_cache *cache, const char *str) |
|
M0_INTERNAL int | m0_conf_version (struct m0_conf_cache *cache) |
|
M0_INTERNAL struct m0_conf_obj * | m0_conf_cache_pinned (const struct m0_conf_cache *cache) |
|
The implementation of m0_conf_cache::ca_registry is based on linked list data structure.
- See also
- DLD of configuration caching, Logical Specification
◆ _obj_del()
◆ conf_cache_clean()
◆ conf_cache_encode()
◆ conf_encode()
◆ m0_conf_cache_add()
Adds configuration object to the cache.
- Precondition
- m0_conf_cache_is_locked(cache)
-
!m0_conf_cache_tlink_is_in(obj)
Definition at line 79 of file cache.c.
◆ m0_conf_cache_clean()
Deletes registered objects of specific type or, if ‘type’ is NULL, all registered configuration objects.
Note that m0_conf_cache_clean(cache, NULL) does not finalise configuration cache.
- Precondition
- m0_conf_cache_is_locked(cache)
- See also
- m0_conf_cache_fini(), m0_conf_obj_delete()
Definition at line 168 of file cache.c.
◆ m0_conf_cache_contains()
M0_INTERNAL bool m0_conf_cache_contains |
( |
struct m0_conf_cache * |
cache, |
|
|
const struct m0_fid * |
fid |
|
) |
| |
Checks if an object with given fid exists in conf cache.
Definition at line 94 of file cache.c.
◆ m0_conf_cache_del()
Unregisters and m0_conf_obj_delete()s configuration object.
- Precondition
- m0_conf_cache_is_locked(cache)
-
m0_conf_cache_tlist_contains(&cache->ca_registry, obj)
Definition at line 124 of file cache.c.
◆ m0_conf_cache_fini()
M0_INTERNAL void m0_conf_cache_fini |
( |
struct m0_conf_cache * |
cache | ) |
|
◆ m0_conf_cache_from_string()
M0_INTERNAL int m0_conf_cache_from_string |
( |
struct m0_conf_cache * |
cache, |
|
|
const char * |
str |
|
) |
| |
◆ m0_conf_cache_gc()
M0_INTERNAL void m0_conf_cache_gc |
( |
struct m0_conf_cache * |
cache | ) |
|
Deletes registered objects with m0_conf_cache::co_deleted flag set.
- Precondition
- m0_conf_cache_is_locked(cache)
Definition at line 176 of file cache.c.
◆ m0_conf_cache_init()
Initialises configuration cache.
Definition at line 66 of file cache.c.
◆ m0_conf_cache_is_locked()
M0_INTERNAL bool m0_conf_cache_is_locked |
( |
const struct m0_conf_cache * |
cache | ) |
|
◆ m0_conf_cache_lock()
M0_INTERNAL void m0_conf_cache_lock |
( |
struct m0_conf_cache * |
cache | ) |
|
◆ m0_conf_cache_lookup()
Searches for a configuration object given its identity (type & id).
Returns NULL if there is no such object in the cache.
Definition at line 106 of file cache.c.
◆ m0_conf_cache_pinned()
Searches the configuration cache for a pinned object. Returns NULL if none is found.
- Precondition
- m0_conf_cache_is_locked(cache)
Definition at line 320 of file cache.c.
◆ m0_conf_cache_to_string()
M0_INTERNAL int m0_conf_cache_to_string |
( |
struct m0_conf_cache * |
cache, |
|
|
char ** |
str, |
|
|
bool |
debug |
|
) |
| |
Creates conf string representation of all objects in the cache, except m0_conf_dir objects.
If ‘debug’ is true, the checking of conf objects' invariants will be skipped.
- Note
- If the call succeeds, the user is responsible for freeing allocated memory with m0_confx_string_free(*str).
- See also
- m0_conf_cache_from_string()
Definition at line 257 of file cache.c.
◆ m0_conf_cache_unlock()
M0_INTERNAL void m0_conf_cache_unlock |
( |
struct m0_conf_cache * |
cache | ) |
|
◆ m0_conf_version()
◆ M0_TL_DEFINE()
◆ M0_TL_DESCR_DEFINE()