Motr  M0
domain.c File Reference
#include "lib/trace.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/string.h"
#include "lib/locality.h"
#include "module/instance.h"
#include "be/domain.h"
#include "be/seg0.h"
#include "be/seg.h"
#include "be/seg_internal.h"
#include "stob/stob.h"
#include "stob/domain.h"
Include dependency graph for domain.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_BE
 
#define BE_DOMAIN_LEVEL(level)
 

Functions

 M0_TL_DESCR_DEFINE (zt, "m0_be_domain::bd_0types", M0_INTERNAL, struct m0_be_0type, b0_linkage, b0_magic, M0_BE_0TYPE_MAGIC, M0_BE_0TYPE_MAGIC)
 
 M0_TL_DEFINE (zt, M0_INTERNAL, struct m0_be_0type)
 
 M0_TL_DESCR_DEFINE (seg, "m0_be_domain::bd_segs", M0_INTERNAL, struct m0_be_seg, bs_linkage, bs_magic, M0_BE_SEG_MAGIC, M0_BE_SEG_MAGIC)
 
 M0_TL_DEFINE (seg, static, struct m0_be_seg)
 
static void be_domain_lock (struct m0_be_domain *dom)
 
static void be_domain_unlock (struct m0_be_domain *dom)
 
static int m0_be_segobj_opt_iterate (struct m0_be_seg *dict, const struct m0_be_0type *objtype, struct m0_buf *opt, char **suffix, bool begin)
 
M0_INTERNAL int m0_be_segobj_opt_next (struct m0_be_seg *dict, const struct m0_be_0type *objtype, struct m0_buf *opt, char **suffix)
 
M0_INTERNAL int m0_be_segobj_opt_begin (struct m0_be_seg *dict, const struct m0_be_0type *objtype, struct m0_buf *opt, char **suffix)
 
static const char * id_cut (const char *prefix, const char *key)
 
static int _0types_visit (struct m0_be_domain *dom, bool init)
 
static int be_domain_stob_open (struct m0_be_domain *dom, uint64_t stob_key, const char *stob_create_cfg, struct m0_stob **out, bool create)
 
static int be_domain_seg_structs_create (struct m0_be_domain *dom, struct m0_be_tx *tx, struct m0_be_seg *seg)
 
static int be_domain_seg_close (struct m0_be_domain *dom, struct m0_be_seg *seg, bool destroy)
 
static int be_domain_seg_open (struct m0_be_domain *dom, struct m0_be_seg *seg, uint64_t stob_key)
 
static int be_domain_seg_destroy (struct m0_be_domain *dom, uint64_t seg_id)
 
static int be_domain_seg_create (struct m0_be_domain *dom, struct m0_be_tx *tx, struct m0_be_seg *seg, const struct m0_be_0type_seg_cfg *seg_cfg)
 
static int be_0type_seg_init (struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
 
static void be_0type_seg_fini (struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
 
M0_INTERNAL void be_domain_log_cleanup (const char *stob_domain_location, struct m0_be_log_cfg *log_cfg, bool create)
 
static int be_domain_mkfs_seg0 (struct m0_be_domain *dom, const struct m0_be_0type_seg_cfg *seg0_cfg)
 
static void be_domain_ldsc_sync (struct m0_be_log_discard *ld, struct m0_be_op *op, struct m0_be_log_discard_item *ldi)
 
M0_INTERNAL void m0_be_domain_cleanup_by_location (const char *stob_domain_location)
 
M0_INTERNAL struct m0_be_txm0_be_domain_tx_find (struct m0_be_domain *dom, uint64_t id)
 
M0_INTERNAL struct m0_be_enginem0_be_domain_engine (struct m0_be_domain *dom)
 
M0_INTERNAL struct m0_be_segm0_be_domain_seg0_get (struct m0_be_domain *dom)
 
M0_INTERNAL struct m0_be_logm0_be_domain_log (struct m0_be_domain *dom)
 
M0_INTERNAL struct m0_be_segm0_be_domain_seg (const struct m0_be_domain *dom, const void *addr)
 
M0_INTERNAL struct m0_be_segm0_be_domain_seg_first (const struct m0_be_domain *dom)
 
M0_INTERNAL struct m0_be_segm0_be_domain_seg_by_id (const struct m0_be_domain *dom, uint64_t id)
 
static void be_domain_seg_suffix_make (const struct m0_be_domain *dom, uint64_t seg_id, char *str, size_t str_size)
 
M0_INTERNAL void m0_be_domain_seg_create_credit (struct m0_be_domain *dom, const struct m0_be_0type_seg_cfg *seg_cfg, struct m0_be_tx_credit *cred)
 
M0_INTERNAL void m0_be_domain_seg_destroy_credit (struct m0_be_domain *dom, struct m0_be_seg *seg, struct m0_be_tx_credit *cred)
 
M0_INTERNAL int m0_be_domain_seg_create (struct m0_be_domain *dom, struct m0_be_tx *tx, const struct m0_be_0type_seg_cfg *seg_cfg, struct m0_be_seg **out)
 
M0_INTERNAL int m0_be_domain_seg_destroy (struct m0_be_domain *dom, struct m0_be_tx *tx, struct m0_be_seg *seg)
 
M0_INTERNAL bool m0_be_domain_is_locked (const struct m0_be_domain *dom)
 
M0_INTERNAL void m0_be_domain__0type_register (struct m0_be_domain *dom, struct m0_be_0type *type)
 
M0_INTERNAL void m0_be_domain__0type_unregister (struct m0_be_domain *dom, struct m0_be_0type *type)
 
static int be_domain_level_enter (struct m0_module *module)
 
static void be_domain_level_leave (struct m0_module *module)
 
M0_INTERNAL void m0_be_domain_module_setup (struct m0_be_domain *dom, const struct m0_be_domain_cfg *cfg)
 
M0_INTERNAL void m0_be_domain_tx_size_max (struct m0_be_domain *dom, struct m0_be_tx_credit *cred, m0_bcount_t *payload_size)
 
M0_INTERNAL void m0_be_domain__group_limits (struct m0_be_domain *dom, uint32_t *group_nr, uint32_t *tx_per_group)
 
M0_INTERNAL bool m0_be_domain_is_stob_log (struct m0_be_domain *dom, const struct m0_stob_id *stob_id)
 
M0_INTERNAL bool m0_be_domain_is_stob_seg (struct m0_be_domain *dom, const struct m0_stob_id *stob_id)
 
M0_INTERNAL struct m0_be_segm0_be_domain_seg_by_addr (struct m0_be_domain *dom, void *addr)
 
M0_INTERNAL bool m0_be_domain_seg_is_valid (struct m0_be_domain *dom, struct m0_be_seg *seg)
 

Variables

static const struct m0_be_0type m0_be_0type_seg
 
static const struct m0_modlev levels_be_domain []
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_BE

Definition at line 23 of file domain.c.

Function Documentation

◆ M0_TL_DEFINE() [1/2]

M0_TL_DEFINE ( zt  ,
M0_INTERNAL  ,
struct m0_be_0type   
)

◆ M0_TL_DEFINE() [2/2]

M0_TL_DEFINE ( seg  ,
static  ,
struct m0_be_seg   
)

◆ M0_TL_DESCR_DEFINE() [1/2]

M0_TL_DESCR_DEFINE ( zt  ,
"m0_be_domain::bd_0types"  ,
M0_INTERNAL  ,
struct m0_be_0type  ,
b0_linkage  ,
b0_magic  ,
M0_BE_0TYPE_MAGIC  ,
M0_BE_0TYPE_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [2/2]

M0_TL_DESCR_DEFINE ( seg  ,
"m0_be_domain::bd_segs"  ,
M0_INTERNAL  ,
struct m0_be_seg  ,
bs_linkage  ,
bs_magic  ,
M0_BE_SEG_MAGIC  ,
M0_BE_SEG_MAGIC   
)