Motr  M0
ad.c File Reference
#include "balloc/balloc.h"
#include "be/extmap.h"
#include "be/seg.h"
#include "be/seg0.h"
#include "dtm/dtm.h"
#include "fid/fid.h"
#include "lib/finject.h"
#include "lib/errno.h"
#include "lib/locality.h"
#include "lib/memory.h"
#include "lib/string.h"
#include "lib/cksum_utils.h"
#include "lib/trace.h"
#include "addb2/addb2.h"
#include "module/instance.h"
#include "stob/ad.h"
#include "stob/ad_private.h"
#include "stob/ad_private_xc.h"
#include "stob/addb2.h"
#include "stob/domain.h"
#include "stob/io.h"
#include "stob/module.h"
#include "stob/stob.h"
#include "stob/stob_internal.h"
#include "stob/type.h"
#include "be/domain.h"
Include dependency graph for ad.c:

Go to the source code of this file.

Data Structures

struct  ad_domain_init_cfg
 
struct  ad_domain_cfg
 
struct  stob_ad_write_ext
 
struct  stob_ad_wext_cursor
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADSTOB
 

Functions

 M0_BOB_DEFINE (static, &stob_ad_domain_bob_type, m0_stob_ad_domain)
 
static int stob_ad_io_init (struct m0_stob *stob, struct m0_stob_io *io)
 
static void stob_ad_write_credit (const struct m0_stob_domain *dom, const struct m0_stob_io *iv, struct m0_be_tx_credit *accum)
 
static void stob_ad_rec_frag_undo_redo_op_cred (const struct m0_fol_frag *frag, struct m0_be_tx_credit *accum)
 
static int stob_ad_rec_frag_undo_redo_op (struct m0_fol_frag *frag, struct m0_be_tx *tx)
 
 M0_FOL_FRAG_TYPE_DECLARE (stob_ad_rec_frag, static, stob_ad_rec_frag_undo_redo_op, stob_ad_rec_frag_undo_redo_op, stob_ad_rec_frag_undo_redo_op_cred, stob_ad_rec_frag_undo_redo_op_cred)
 
static int stob_ad_seg_free (struct m0_dtx *tx, struct m0_stob_ad_domain *adom, const struct m0_be_emap_seg *seg, const struct m0_ext *ext, uint64_t val)
 
static int stob_ad_punch (struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *tx)
 
 M0_TL_DESCR_DEFINE (ad_domains, "ad stob domains", M0_INTERNAL, struct ad_domain_map, adm_linkage, adm_magic, M0_AD_DOMAINS_MAGIC, M0_AD_DOMAINS_HEAD_MAGIC)
 
 M0_TL_DEFINE (ad_domains, M0_INTERNAL, struct ad_domain_map)
 
static int stob_ad_0type_init (struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
 
static void stob_ad_0type_fini (struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
 
M0_INTERNAL struct m0_stob_ad_domainstob_ad_domain2ad (const struct m0_stob_domain *dom)
 
M0_INTERNAL struct m0_ballocm0_stob_ad_domain2balloc (const struct m0_stob_domain *dom)
 
static struct m0_stob_adstob_ad_stob2ad (const struct m0_stob *stob)
 
static void stob_ad_type_register (struct m0_stob_type *type)
 
static void stob_ad_type_deregister (struct m0_stob_type *type)
 
M0_INTERNAL void m0_stob_ad_init_cfg_make (char **str, struct m0_be_domain *dom)
 
M0_INTERNAL void m0_stob_ad_cfg_make (char **str, const struct m0_be_seg *seg, const struct m0_stob_id *bstore_id, const m0_bcount_t size)
 
static int stob_ad_domain_cfg_init_parse (const char *str_cfg_init, void **cfg_init)
 
static void stob_ad_domain_cfg_init_free (void *cfg_init)
 
static int stob_ad_domain_cfg_create_parse (const char *str_cfg_create, void **cfg_create)
 
M0_INTERNAL m0_bcount_t m0_stob_ad_spares_calc (m0_bcount_t grp_blocks)
 
M0_INTERNAL void * m0_stob_ad_get_checksum_addr (struct m0_stob_io *io, m0_bindex_t off)
 
static void stob_ad_domain_cfg_create_free (void *cfg_create)
 
M0_INTERNAL bool m0_stob_ad_domain__invariant (struct m0_stob_ad_domain *adom)
 
static struct m0_sm_groupstob_ad_sm_group (void)
 
static int stob_ad_bstore (struct m0_stob_id *stob_id, struct m0_stob **out)
 
static struct m0_stob_ad_domainstob_ad_domain_locate (const char *location_data)
 
static int stob_ad_domain_init (struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
 
static void stob_ad_domain_fini (struct m0_stob_domain *dom)
 
static void stob_ad_domain_create_credit (struct m0_be_seg *seg, const char *location_data, struct m0_be_tx_credit *accum)
 
static void stob_ad_domain_destroy_credit (struct m0_be_seg *seg, const char *location_data, struct m0_be_tx_credit *accum)
 
static int stob_ad_domain_create (struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
 
static int stob_ad_domain_destroy (struct m0_stob_type *type, const char *location_data)
 
static struct m0_stobstob_ad_alloc (struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
static void stob_ad_free (struct m0_stob_domain *dom, struct m0_stob *stob)
 
static int stob_ad_cfg_parse (const char *str_cfg_create, void **cfg_create)
 
static void stob_ad_cfg_free (void *cfg_create)
 
static int stob_ad_init (struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
static void stob_ad_fini (struct m0_stob *stob)
 
static void stob_ad_create_credit (struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
 
static int stob_ad_create (struct m0_stob *stob, struct m0_stob_domain *dom, struct m0_dtx *dtx, const struct m0_fid *stob_fid, void *cfg)
 
static int stob_ad_punch_credit (struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
 
static int ext_punch (struct m0_stob *stob, struct m0_dtx *tx, struct m0_ext *todo)
 
static void stob_ad_destroy_credit (struct m0_stob *stob, struct m0_be_tx_credit *accum)
 
static int stob_ad_destroy (struct m0_stob *stob, struct m0_dtx *tx)
 
static uint32_t stob_ad_block_shift (struct m0_stob *stob)
 
static bool stob_ad_endio (struct m0_clink *link)
 
static void stob_ad_io_release (struct m0_stob_ad_io *aio)
 
static void stob_ad_io_fini (struct m0_stob_io *io)
 
static void * stob_ad_addr_open (const void *buf, uint32_t shift)
 
static int stob_ad_balloc (struct m0_stob_ad_domain *adom, struct m0_dtx *tx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_type)
 
static int stob_ad_bfree (struct m0_stob_ad_domain *adom, struct m0_dtx *tx, struct m0_ext *ext)
 
M0_INTERNAL int stob_ad_cursor (struct m0_stob_ad_domain *adom, struct m0_stob *obj, uint64_t offset, struct m0_be_emap_cursor *it)
 
static uint32_t stob_ad_write_map_count (struct m0_stob_ad_domain *adom, struct m0_indexvec *iv, bool pack)
 
static int stob_ad_cursors_init (struct m0_stob_io *io, struct m0_stob_ad_domain *adom, struct m0_be_emap_cursor *it, struct m0_vec_cursor *src, struct m0_vec_cursor *dst, struct m0_be_emap_caret *map)
 
static void stob_ad_cursors_fini (struct m0_be_emap_cursor *it, struct m0_vec_cursor *src, struct m0_vec_cursor *dst, struct m0_be_emap_caret *map)
 
static int stob_ad_vec_alloc (struct m0_stob *obj, struct m0_stob_io *back, uint32_t frags)
 
static void stob_ad_get_checksum_for_fragment (struct m0_stob_io *io, struct m0_be_emap_cursor *it, m0_bindex_t off, m0_bindex_t frag_sz)
 
static int stob_ad_read_prepare (struct m0_stob_io *io, struct m0_stob_ad_domain *adom, struct m0_vec_cursor *src, struct m0_vec_cursor *dst, struct m0_be_emap_caret *car)
 
static void stob_ad_wext_cursor_init (struct stob_ad_wext_cursor *wc, struct stob_ad_write_ext *wext)
 
static m0_bcount_t stob_ad_wext_cursor_step (struct stob_ad_wext_cursor *wc)
 
static bool stob_ad_wext_cursor_move (struct stob_ad_wext_cursor *wc, m0_bcount_t count)
 
static uint32_t stob_ad_write_count (struct m0_vec_cursor *src, struct stob_ad_wext_cursor *wc)
 
static void stob_ad_write_back_fill (struct m0_stob_io *io, struct m0_stob_io *back, struct m0_vec_cursor *src, struct stob_ad_wext_cursor *wc)
 
static int stob_ad_write_map_ext (struct m0_stob_io *io, struct m0_stob_ad_domain *adom, m0_bindex_t off, struct m0_be_emap_cursor *orig, const struct m0_ext *ext)
 
static int stob_ad_fol_frag_alloc (struct m0_fol_frag *frag, uint32_t frags)
 
static void stob_ad_fol_frag_free (struct m0_fol_frag *frag)
 
static int stob_ad_write_map (struct m0_stob_io *io, struct m0_stob_ad_domain *adom, struct m0_ivec_cursor *dst, struct m0_be_emap_caret *map, struct stob_ad_wext_cursor *wc, uint32_t frags)
 
static void stob_ad_wext_fini (struct stob_ad_write_ext *wext)
 
static int stob_ad_write_prepare (struct m0_stob_io *io, struct m0_stob_ad_domain *adom, struct m0_vec_cursor *src, struct m0_be_emap_caret *map)
 
static int stob_ad_io_launch_prepare (struct m0_stob_io *io)
 
static int stob_ad_io_launch (struct m0_stob_io *io)
 
M0_INTERNAL void m0_stob_ad_balloc_set (struct m0_stob_io *io, uint64_t flags)
 
M0_INTERNAL void m0_stob_ad_balloc_clear (struct m0_stob_io *io)
 

Variables

static const struct m0_bob_type stob_ad_domain_bob_type
 
static struct m0_stob_domain_ops stob_ad_domain_ops
 
static struct m0_stob_ops stob_ad_ops
 
struct m0_be_0type m0_stob_ad_0type
 
static struct m0_stob_type_ops stob_ad_type_ops
 
const struct m0_stob_type m0_stob_ad_type
 
static const struct m0_stob_io_op stob_ad_io_op
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADSTOB

Definition at line 38 of file ad.c.