Motr  M0
Conf_dir

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CONF
 

Functions

 M0_TL_DESCR_DEFINE (m0_conf_dir, "m0_conf_dir::cd_items", M0_INTERNAL, struct m0_conf_obj, co_dir_link, co_gen_magic, M0_CONF_OBJ_MAGIC, M0_CONF_DIR_MAGIC)
 
 M0_TL_DEFINE (m0_conf_dir, M0_INTERNAL, struct m0_conf_obj)
 
M0_INTERNAL void m0_conf_dir_add (struct m0_conf_dir *dir, struct m0_conf_obj *obj)
 
M0_INTERNAL void m0_conf_dir_del (struct m0_conf_dir *dir, struct m0_conf_obj *obj)
 
M0_INTERNAL bool m0_conf_dir_elems_match (const struct m0_conf_dir *dir, const struct m0_fid_arr *fids)
 
static void conf_dir_id_build (struct m0_fid *out, const struct m0_fid *parent, const struct m0_conf_obj_type *children_type)
 
static int conf_dir_new (struct m0_conf_cache *cache, const struct m0_fid *parent, const struct m0_fid *relfid, const struct m0_conf_obj_type *children_type, const struct m0_fid_arr *children_ids, struct m0_conf_dir **out)
 
M0_INTERNAL int m0_conf_dir_new (struct m0_conf_obj *parent, const struct m0_fid *relfid, const struct m0_conf_obj_type *children_type, const struct m0_fid_arr *children_ids, struct m0_conf_dir **out)
 
 M0_TL_DESCR_DECLARE (m0_conf_dir, M0_EXTERN)
 
 M0_TL_DECLARE (m0_conf_dir, M0_INTERNAL, struct m0_conf_obj)
 
static uint32_t m0_conf_dir_len (const struct m0_conf_dir *dir)
 

Detailed Description

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CONF

Definition at line 28 of file dir.c.

Function Documentation

◆ conf_dir_id_build()

static void conf_dir_id_build ( struct m0_fid out,
const struct m0_fid parent,
const struct m0_conf_obj_type children_type 
)
static

Constructs directory identifier.

Todo:
This would produce non-unique identifier, if an object has two different directories with the same children types. Perhaps relation fid should be factored in somehow.

Definition at line 80 of file dir.c.

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

◆ conf_dir_new()

static int conf_dir_new ( struct m0_conf_cache cache,
const struct m0_fid parent,
const struct m0_fid relfid,
const struct m0_conf_obj_type children_type,
const struct m0_fid_arr children_ids,
struct m0_conf_dir **  out 
)
static

Definition at line 93 of file dir.c.

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

◆ m0_conf_dir_add()

M0_INTERNAL void m0_conf_dir_add ( struct m0_conf_dir dir,
struct m0_conf_obj obj 
)

Adds object to directory.

Precondition
obj->co_status == M0_CS_READY
m0_conf_obj_type(obj) == dir->cd_item_type

Definition at line 43 of file dir.c.

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

◆ m0_conf_dir_del()

M0_INTERNAL void m0_conf_dir_del ( struct m0_conf_dir dir,
struct m0_conf_obj obj 
)

Deletes object from directory.

Precondition
obj->co_status == M0_CS_READY
m0_conf_obj_type(obj) == dir->cd_item_type

Definition at line 53 of file dir.c.

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

◆ m0_conf_dir_elems_match()

M0_INTERNAL bool m0_conf_dir_elems_match ( const struct m0_conf_dir dir,
const struct m0_fid_arr fids 
)

Compares fids with directory entries.

Definition at line 63 of file dir.c.

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

◆ m0_conf_dir_len()

static uint32_t m0_conf_dir_len ( const struct m0_conf_dir dir)
inlinestatic

Definition at line 59 of file dir.h.

Here is the caller graph for this function:

◆ m0_conf_dir_new()

M0_INTERNAL int m0_conf_dir_new ( struct m0_conf_obj parent,
const struct m0_fid relfid,
const struct m0_conf_obj_type children_type,
const struct m0_fid_arr children_ids,
struct m0_conf_dir **  out 
)

Creates new m0_conf_dir, populates it with stub objects, and links to parent.

Parameters
parentParent of this directory.
children_typeType of entries.
children_ids[optional] Identifiers of the entries.
[out]outResulting pointer.

m0_conf_dir_new() is transactional: if it fails, the configuration cache (both DAG of objects and m0_conf_cache registry) is left unchanged.

XXX

Todo:
UT transactional property of m0_conf_dir_new().

Definition at line 159 of file dir.c.

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

◆ M0_TL_DECLARE()

M0_TL_DECLARE ( m0_conf_dir  ,
M0_INTERNAL  ,
struct m0_conf_obj   
)

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( m0_conf_dir  ,
M0_INTERNAL  ,
struct m0_conf_obj   
)

◆ M0_TL_DESCR_DECLARE()

M0_TL_DESCR_DECLARE ( m0_conf_dir  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( m0_conf_dir  ,
"m0_conf_dir::cd_items"  ,
M0_INTERNAL  ,
struct m0_conf_obj  ,
co_dir_link  ,
co_gen_magic  ,
M0_CONF_OBJ_MAGIC  ,
M0_CONF_DIR_MAGIC   
)