Motr  M0
dir.c File Reference
#include "lib/trace.h"
#include "conf/objs/common.h"
Include dependency graph for dir.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CONF
 

Functions

static bool dir_check (const void *bob)
 
 M0_CONF__BOB_DEFINE (m0_conf_dir, M0_CONF_DIR_MAGIC, dir_check)
 
 M0_CONF__INVARIANT_DEFINE (dir_invariant, m0_conf_dir)
 
static int dir_decode (struct m0_conf_obj *dest M0_UNUSED, const struct m0_confx_obj *src M0_UNUSED)
 
static int dir_encode (struct m0_confx_obj *dest M0_UNUSED, const struct m0_conf_obj *src M0_UNUSED)
 
static bool dir_match (const struct m0_conf_obj *cached M0_UNUSED, const struct m0_confx_obj *flat M0_UNUSED)
 
static bool belongs (const struct m0_conf_obj *entry, const struct m0_conf_dir *dir)
 
static bool readdir_pre (const struct m0_conf_dir *dir, const struct m0_conf_obj *entry)
 
static bool readdir_post (int retval, const struct m0_conf_dir *dir, const struct m0_conf_obj *entry)
 
static int dir_readdir (const struct m0_conf_obj *dir, struct m0_conf_obj **pptr)
 
static int dir_lookup (const struct m0_conf_obj *parent, const struct m0_fid *name, struct m0_conf_obj **out)
 
static void dir_delete (struct m0_conf_obj *obj)
 
static struct m0_conf_objdir_create (void)
 

Variables

static const struct m0_conf_obj_ops dir_ops
 
const struct m0_conf_obj_type M0_CONF_DIR_TYPE
 
const struct m0_fid_type M0_CONF_RELFID_TYPE
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CONF

Definition at line 23 of file dir.c.

Function Documentation

◆ belongs()

static bool belongs ( const struct m0_conf_obj entry,
const struct m0_conf_dir dir 
)
static

Definition at line 64 of file dir.c.

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

◆ dir_check()

static bool dir_check ( const void *  bob)
static

Definition at line 28 of file dir.c.

Here is the call graph for this function:

◆ dir_create()

static struct m0_conf_obj* dir_create ( void  )
static

Definition at line 188 of file dir.c.

◆ dir_decode()

static int dir_decode ( struct m0_conf_obj *dest  M0_UNUSED,
const struct m0_confx_obj *src  M0_UNUSED 
)
static

Definition at line 42 of file dir.c.

◆ dir_delete()

static void dir_delete ( struct m0_conf_obj obj)
static

Definition at line 164 of file dir.c.

Here is the call graph for this function:

◆ dir_encode()

static int dir_encode ( struct m0_confx_obj *dest  M0_UNUSED,
const struct m0_conf_obj *src  M0_UNUSED 
)
static

Definition at line 49 of file dir.c.

◆ dir_lookup()

static int dir_lookup ( const struct m0_conf_obj parent,
const struct m0_fid name,
struct m0_conf_obj **  out 
)
static

Definition at line 145 of file dir.c.

Here is the call graph for this function:

◆ dir_match()

static bool dir_match ( const struct m0_conf_obj *cached  M0_UNUSED,
const struct m0_confx_obj *flat  M0_UNUSED 
)
static

Definition at line 56 of file dir.c.

◆ dir_readdir()

static int dir_readdir ( const struct m0_conf_obj dir,
struct m0_conf_obj **  pptr 
)
static

Definition at line 111 of file dir.c.

Here is the call graph for this function:

◆ M0_CONF__BOB_DEFINE()

M0_CONF__BOB_DEFINE ( m0_conf_dir  ,
M0_CONF_DIR_MAGIC  ,
dir_check   
)

◆ M0_CONF__INVARIANT_DEFINE()

M0_CONF__INVARIANT_DEFINE ( dir_invariant  ,
m0_conf_dir   
)

◆ readdir_post()

static bool readdir_post ( int  retval,
const struct m0_conf_dir dir,
const struct m0_conf_obj entry 
)
static

Postcondition for m0_conf_obj_ops::coo_readdir().

Parameters
retvalThe value returned by ->coo_readdir().
dirThe 1st argument of ->coo_readdir(), typecasted.
entryThe 2nd argument of ->coo_readdir(), dereferenced after the function is called (*pptr).
See also
m0_conf_obj_ops::coo_readdir()

Definition at line 99 of file dir.c.

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

◆ readdir_pre()

static bool readdir_pre ( const struct m0_conf_dir dir,
const struct m0_conf_obj entry 
)
static

Precondition for m0_conf_obj_ops::coo_readdir().

Parameters
dirThe 1st argument of ->coo_readdir(), typecasted.
entryThe 2nd argument of ->coo_readdir(), dereferenced before the function is called (*pptr).
See also
m0_conf_obj_ops::coo_readdir()

Definition at line 80 of file dir.c.

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

Variable Documentation

◆ dir_ops

const struct m0_conf_obj_ops dir_ops
static
Initial value:
= {
.coo_invariant = dir_invariant,
.coo_decode = dir_decode,
.coo_encode = dir_encode,
.coo_match = dir_match,
.coo_lookup = dir_lookup,
.coo_readdir = dir_readdir,
.coo_downlinks = NULL,
.coo_delete = dir_delete
}
#define NULL
Definition: misc.h:38
static int dir_decode(struct m0_conf_obj *dest M0_UNUSED, const struct m0_confx_obj *src M0_UNUSED)
Definition: dir.c:42
static void dir_delete(struct m0_conf_obj *obj)
Definition: dir.c:164
static int dir_lookup(const struct m0_conf_obj *parent, const struct m0_fid *name, struct m0_conf_obj **out)
Definition: dir.c:145
static int dir_readdir(const struct m0_conf_obj *dir, struct m0_conf_obj **pptr)
Definition: dir.c:111
static bool dir_match(const struct m0_conf_obj *cached M0_UNUSED, const struct m0_confx_obj *flat M0_UNUSED)
Definition: dir.c:56
static int dir_encode(struct m0_confx_obj *dest M0_UNUSED, const struct m0_conf_obj *src M0_UNUSED)
Definition: dir.c:49

Definition at line 177 of file dir.c.

◆ M0_CONF_DIR_TYPE

const struct m0_conf_obj_type M0_CONF_DIR_TYPE
Initial value:
= {
.cot_ftype = {
.ft_id = M0_CONF__DIR_FT_ID,
.ft_name = "conf_dir"
},
.cot_create = &dir_create,
.cot_magic = M0_CONF_DIR_MAGIC
}
static struct m0_conf_obj * dir_create(void)
Definition: dir.c:188

Definition at line 206 of file dir.c.