Motr  M0
confd Internals

Functions

static int confd_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
 
static int confd_cache_preload (struct m0_conf_cache *cache, const char *str)
 
M0_INTERNAL int m0_confd_register (void)
 
M0_INTERNAL void m0_confd_unregister (void)
 
static int confd_start (struct m0_reqh_service *service)
 
static void confd_stop (struct m0_reqh_service *service)
 
static void confd_fini (struct m0_reqh_service *service)
 
M0_INTERNAL int m0_confd_cache_create (struct m0_conf_cache **out, struct m0_mutex *cache_lock, const char *confstr)
 
M0_INTERNAL void m0_confd_cache_destroy (struct m0_conf_cache *cache)
 
static bool nil (const char *s)
 
M0_INTERNAL int m0_confd_service_to_filename (struct m0_reqh_service *service, char **dbpath)
 
static int conf_fetch_tick (struct m0_fom *fom)
 
static int conf_update_tick (struct m0_fom *fom)
 
static int confx_populate (struct m0_confx *dest, const struct m0_fid *origin, const struct m0_fid_arr *path, struct m0_conf_cache *cache)
 
static size_t confd_fom_locality (const struct m0_fom *fom)
 
static void confd_fom_fini (struct m0_fom *fom)
 
M0_INTERNAL int m0_confd_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
static int _count (size_t *n, struct m0_confx *enc M0_UNUSED, const struct m0_conf_obj *obj M0_UNUSED)
 
static int _encode (size_t *n, struct m0_confx *enc, const struct m0_conf_obj *obj)
 
static int readiness_check (const struct m0_conf_obj *obj)
 
static int confd_path_walk (struct m0_conf_obj *cur, const struct m0_fid_arr *path, int(*apply)(size_t *n, struct m0_confx *enc, const struct m0_conf_obj *obj), size_t *n, struct m0_confx *enc)
 
static struct m0_conf_objconfd_cache_lookup (const struct m0_conf_cache *cache, const struct m0_fid *fid)
 
static void cache_ver_update (struct m0_conf_cache *cache)
 

Variables

const struct m0_bob_type m0_confd_bob
 
static const struct m0_reqh_service_type_ops confd_stype_ops
 
struct m0_reqh_service_type m0_confd_stype
 
static const struct m0_reqh_service_ops confd_ops
 
static const struct m0_fom_ops conf_fetch_fom_ops
 
static const struct m0_fom_ops conf_update_fom_ops
 

Detailed Description

See also
DLD of configuration caching, Logical Specification of confd

Function Documentation

◆ _count()

static int _count ( size_t *  n,
struct m0_confx *enc  M0_UNUSED,
const struct m0_conf_obj *obj  M0_UNUSED 
)
static

Definition at line 149 of file confd_fom.c.

Here is the caller graph for this function:

◆ _encode()

static int _encode ( size_t *  n,
struct m0_confx enc,
const struct m0_conf_obj obj 
)
static

Definition at line 158 of file confd_fom.c.

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

◆ cache_ver_update()

static void cache_ver_update ( struct m0_conf_cache cache)
static

Definition at line 255 of file confd_fom.c.

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

◆ conf_fetch_tick()

static int conf_fetch_tick ( struct m0_fom fom)
static

Definition at line 110 of file confd_fom.c.

Here is the call graph for this function:

◆ conf_update_tick()

static int conf_update_tick ( struct m0_fom fom)
static

Definition at line 141 of file confd_fom.c.

Here is the call graph for this function:

◆ confd_allocate()

static int confd_allocate ( struct m0_reqh_service **  service,
const struct m0_reqh_service_type stype 
)
static

Allocates and initialises confd service.

Definition at line 482 of file confd.c.

Here is the call graph for this function:

◆ confd_cache_lookup()

static struct m0_conf_obj* confd_cache_lookup ( const struct m0_conf_cache cache,
const struct m0_fid fid 
)
static

Definition at line 242 of file confd_fom.c.

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

◆ confd_cache_preload()

static int confd_cache_preload ( struct m0_conf_cache cache,
const char *  str 
)
static

Definition at line 578 of file confd.c.

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

◆ confd_fini()

static void confd_fini ( struct m0_reqh_service service)
static

Finalises and deallocates confd service.

Definition at line 501 of file confd.c.

Here is the call graph for this function:

◆ confd_fom_fini()

static void confd_fom_fini ( struct m0_fom fom)
static

Definition at line 55 of file confd_fom.c.

Here is the call graph for this function:

◆ confd_fom_locality()

static size_t confd_fom_locality ( const struct m0_fom fom)
static

Definition at line 50 of file confd_fom.c.

Here is the call graph for this function:

◆ confd_path_walk()

static int confd_path_walk ( struct m0_conf_obj cur,
const struct m0_fid_arr path,
int(*)(size_t *n, struct m0_confx *enc, const struct m0_conf_obj *obj apply,
size_t *  n,
struct m0_confx enc 
)
static

Traverses the DAG of configuration objects. Starts at ‘cur’ and follows the ‘path’, applying given function.

Parameters
curPath origin.
pathSequence of path components as requested by confc.
applyThe action to perform.
nAddress of the counter to be used by apply().
encEncoded configuration data to be used by apply().

Definition at line 191 of file confd_fom.c.

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

◆ confd_start()

static int confd_start ( struct m0_reqh_service service)
static

Definition at line 544 of file confd.c.

Here is the call graph for this function:

◆ confd_stop()

static void confd_stop ( struct m0_reqh_service service)
static

Definition at line 567 of file confd.c.

Here is the call graph for this function:

◆ confx_populate()

static int confx_populate ( struct m0_confx dest,
const struct m0_fid origin,
const struct m0_fid_arr path,
struct m0_conf_cache cache 
)
static

Definition at line 267 of file confd_fom.c.

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

◆ m0_confd_cache_create()

M0_INTERNAL int m0_confd_cache_create ( struct m0_conf_cache **  out,
struct m0_mutex cache_lock,
const char *  confstr 
)

Allocates conf cache and populates it using provided configuration string.

Definition at line 513 of file confd.c.

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

◆ m0_confd_cache_destroy()

M0_INTERNAL void m0_confd_cache_destroy ( struct m0_conf_cache cache)

Finalises conf cache, releases memory.

Definition at line 536 of file confd.c.

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

◆ m0_confd_fom_create()

M0_INTERNAL int m0_confd_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)

Definition at line 73 of file confd_fom.c.

Here is the call graph for this function:

◆ m0_confd_register()

M0_INTERNAL int m0_confd_register ( void  )

Definition at line 460 of file confd.c.

Here is the call graph for this function:

◆ m0_confd_service_to_filename()

M0_INTERNAL int m0_confd_service_to_filename ( struct m0_reqh_service service,
char **  dbpath 
)

Definition at line 624 of file confd.c.

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

◆ m0_confd_unregister()

M0_INTERNAL void m0_confd_unregister ( void  )

Definition at line 465 of file confd.c.

Here is the call graph for this function:

◆ nil()

static bool nil ( const char *  s)
static

Definition at line 619 of file confd.c.

Here is the caller graph for this function:

◆ readiness_check()

static int readiness_check ( const struct m0_conf_obj obj)
static

Definition at line 171 of file confd_fom.c.

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

Variable Documentation

◆ conf_fetch_fom_ops

const struct m0_fom_ops conf_fetch_fom_ops
static
Initial value:
= {
.fo_home_locality = confd_fom_locality,
.fo_tick = conf_fetch_tick,
.fo_fini = confd_fom_fini
}
static size_t confd_fom_locality(const struct m0_fom *fom)
Definition: confd_fom.c:50
static int conf_fetch_tick(struct m0_fom *fom)
Definition: confd_fom.c:110
static void confd_fom_fini(struct m0_fom *fom)
Definition: confd_fom.c:55

Definition at line 61 of file confd_fom.c.

◆ conf_update_fom_ops

const struct m0_fom_ops conf_update_fom_ops
static
Initial value:
= {
.fo_home_locality = confd_fom_locality,
.fo_tick = conf_update_tick,
.fo_fini = confd_fom_fini
}
static size_t confd_fom_locality(const struct m0_fom *fom)
Definition: confd_fom.c:50
static int conf_update_tick(struct m0_fom *fom)
Definition: confd_fom.c:141
static void confd_fom_fini(struct m0_fom *fom)
Definition: confd_fom.c:55

Definition at line 67 of file confd_fom.c.

◆ confd_ops

const struct m0_reqh_service_ops confd_ops
static
Initial value:
= {
.rso_start = confd_start,
.rso_stop = confd_stop,
.rso_fini = confd_fini
}
static void confd_stop(struct m0_reqh_service *service)
Definition: confd.c:567
static int confd_start(struct m0_reqh_service *service)
Definition: confd.c:544
int m0_reqh_service_async_start_simple(struct m0_reqh_service_start_async_ctx *asc)
Definition: reqh_service.c:601
static void confd_fini(struct m0_reqh_service *service)
Definition: confd.c:501

Definition at line 474 of file confd.c.

◆ confd_stype_ops

const struct m0_reqh_service_type_ops confd_stype_ops
static
Initial value:
= {
.rsto_service_allocate = confd_allocate
}
static int confd_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: confd.c:482

Definition at line 449 of file confd.c.

◆ m0_confd_bob

const struct m0_bob_type m0_confd_bob
Initial value:
= {
.bt_name = "m0_confd",
.bt_magix_offset = M0_MAGIX_OFFSET(struct m0_confd, d_magic),
.bt_magix = M0_CONFD_MAGIC
}
#define M0_MAGIX_OFFSET(type, field)
Definition: misc.h:356

Definition at line 443 of file confd.c.

◆ m0_confd_stype

struct m0_reqh_service_type m0_confd_stype
Initial value:
= {
.rst_name = "M0_CST_CONFD",
.rst_ops = &confd_stype_ops,
.rst_level = M0_RS_LEVEL_NORMAL,
.rst_typecode = M0_CST_CONFD,
}
static const struct m0_reqh_service_type_ops confd_stype_ops
Definition: confd.c:449

Definition at line 453 of file confd.c.