Motr  M0
Storage objects with extent maps.

Data Structures

struct  ad_domain_init_cfg
 
struct  ad_domain_cfg
 
struct  stob_ad_write_ext
 
struct  stob_ad_wext_cursor
 
struct  m0_ad_balloc
 
struct  m0_ad_balloc_ops
 
struct  m0_stob_ad_domain
 
struct  ad_domain_map
 
struct  m0_stob_ad
 
struct  m0_stob_ad_io
 

Enumerations

enum  { AD_PATHLEN = 4096 }
 
enum  m0_stob_ad_domain_format_version { M0_STOB_AD_DOMAIN_FORMAT_VERSION_1 = 1, M0_STOB_AD_DOMAIN_FORMAT_VERSION = M0_STOB_AD_DOMAIN_FORMAT_VERSION_1 }
 
enum  { STOB_TYPE_AD = 0x02, BALLOC_FRAGS_MAX = 2 }
 
enum  stob_ad_allocation_extent_type { AET_MIN = M0_BINDEX_MAX - (1ULL << 32), AET_HOLE }
 

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)
 
struct m0_ad_balloc M0_XCA_DOMAIN (be)
 
 M0_BASSERT (sizeof(M0_FIELD_VALUE(struct m0_stob_ad_domain, sad_path)) % 8==0)
 
 M0_BASSERT (sizeof(bool)==1)
 

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
 
struct m0_ad_balloc_ops M0_XCA_DOMAIN
 
const struct m0_stob_type m0_stob_ad_type
 

Detailed Description

Storage object type based on Allocation Data (AD) stored in a data-base.

AD storage object type (m0_stob_ad_type) manages collections of storage objects with in an underlying storage object. The underlying storage object is specified per-domain by a call to m0_ad_stob_setup() function.

m0_stob_ad_type uses data-base (also specified as a parameter to m0_ad_stob_setup()) to store extent map (m0_emap) which keeps track of mapping between logical offsets in AD stobs and physical offsets within underlying stob.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AD_PATHLEN 

Definition at line 109 of file ad.h.

◆ anonymous enum

anonymous enum
Enumerator
STOB_TYPE_AD 
BALLOC_FRAGS_MAX 

Definition at line 158 of file ad.h.

◆ m0_stob_ad_domain_format_version

Enumerator
M0_STOB_AD_DOMAIN_FORMAT_VERSION_1 
M0_STOB_AD_DOMAIN_FORMAT_VERSION 

Current version, should point to the latest version present

Definition at line 147 of file ad.h.

◆ stob_ad_allocation_extent_type

Types of allocation extents.

Values of this enum are stored as "physical extent start" in allocation extents.

Enumerator
AET_MIN 

Minimal "special" extent type. All values less than this are valid start values of normal allocated extents.

AET_HOLE 

This value is used to tag a hole in the storage object.

Definition at line 181 of file ad.h.

Function Documentation

◆ ext_punch()

static int ext_punch ( struct m0_stob stob,
struct m0_dtx tx,
struct m0_ext todo 
)
static

Punches ad stob ext map and releases underlying storage object's extents.

Parameters

Definition at line 831 of file ad.c.

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

◆ M0_BASSERT() [1/2]

M0_BASSERT ( sizeof(M0_FIELD_VALUE(struct m0_stob_ad_domain, sad_path)) %  8 = =0)

◆ M0_BASSERT() [2/2]

M0_BASSERT ( sizeof(bool)  = =1)

◆ M0_BOB_DEFINE()

M0_BOB_DEFINE ( static  ,
stob_ad_domain_bob_type,
m0_stob_ad_domain   
)

◆ M0_FOL_FRAG_TYPE_DECLARE()

◆ m0_stob_ad_balloc_clear()

M0_INTERNAL void m0_stob_ad_balloc_clear ( struct m0_stob_io io)

Clears allocation context from previous IO.

Definition at line 2213 of file ad.c.

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

◆ m0_stob_ad_balloc_set()

M0_INTERNAL void m0_stob_ad_balloc_set ( struct m0_stob_io io,
uint64_t  flags 
)

Sets the flags associated with the balloc zones (spare/non-spare).

Definition at line 2204 of file ad.c.

Here is the caller graph for this function:

◆ m0_stob_ad_cfg_make()

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 
)

Definition at line 220 of file ad.c.

Here is the caller graph for this function:

◆ m0_stob_ad_domain2balloc()

M0_INTERNAL struct m0_balloc * m0_stob_ad_domain2balloc ( const struct m0_stob_domain dom)

Definition at line 179 of file ad.c.

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

◆ m0_stob_ad_domain__invariant()

M0_INTERNAL bool m0_stob_ad_domain__invariant ( struct m0_stob_ad_domain adom)

Definition at line 371 of file ad.c.

Here is the caller graph for this function:

◆ m0_stob_ad_get_checksum_addr()

M0_INTERNAL void * m0_stob_ad_get_checksum_addr ( struct m0_stob_io io,
m0_bindex_t  off 
)

Calculates checksum address for a cob segment and unit size

TODO: Enable this once PARITY support is added ?
M0_ASSERT(cksum_addr != NULL);

Definition at line 333 of file ad.c.

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

◆ m0_stob_ad_init_cfg_make()

M0_INTERNAL void m0_stob_ad_init_cfg_make ( char **  str,
struct m0_be_domain dom 
)

Definition at line 212 of file ad.c.

Here is the caller graph for this function:

◆ m0_stob_ad_spares_calc()

M0_INTERNAL m0_bcount_t m0_stob_ad_spares_calc ( m0_bcount_t  grp)

Calculates the count of spare blocks to be reserved for a given group.

Definition at line 313 of file ad.c.

Here is the caller graph for this function:

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( ad_domains  ,
M0_INTERNAL  ,
struct ad_domain_map   
)

◆ M0_TL_DESCR_DEFINE()

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_XCA_DOMAIN()

struct m0_ad_balloc M0_XCA_DOMAIN ( be  )

◆ stob_ad_0type_fini()

static void stob_ad_0type_fini ( struct m0_be_domain dom,
const char *  suffix,
const struct m0_buf data 
)
static

Definition at line 140 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_0type_init()

static int stob_ad_0type_init ( struct m0_be_domain dom,
const char *  suffix,
const struct m0_buf data 
)
static

Definition at line 113 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_addr_open()

static void* stob_ad_addr_open ( const void *  buf,
uint32_t  shift 
)
static

Definition at line 1052 of file ad.c.

Here is the caller graph for this function:

◆ stob_ad_alloc()

static struct m0_stob* stob_ad_alloc ( struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)
static

Definition at line 663 of file ad.c.

◆ stob_ad_balloc()

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

Helper function to allocate a given number of blocks in the underlying storage object.

Definition at line 1064 of file ad.c.

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

◆ stob_ad_bfree()

static int stob_ad_bfree ( struct m0_stob_ad_domain adom,
struct m0_dtx tx,
struct m0_ext ext 
)
static

Helper function to free a given block extent in the underlying storage object.

Definition at line 1086 of file ad.c.

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

◆ stob_ad_block_shift()

static uint32_t stob_ad_block_shift ( struct m0_stob stob)
static

Definition at line 961 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_bstore()

static int stob_ad_bstore ( struct m0_stob_id stob_id,
struct m0_stob **  out 
)
static

Definition at line 381 of file ad.c.

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

◆ stob_ad_cfg_free()

static void stob_ad_cfg_free ( void *  cfg_create)
static

Definition at line 684 of file ad.c.

◆ stob_ad_cfg_parse()

static int stob_ad_cfg_parse ( const char *  str_cfg_create,
void **  cfg_create 
)
static

Definition at line 679 of file ad.c.

◆ stob_ad_create()

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

Definition at line 721 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_create_credit()

static void stob_ad_create_credit ( struct m0_stob_domain dom,
struct m0_be_tx_credit accum 
)
static

Definition at line 714 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_cursor()

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 
)

Definition at line 1101 of file ad.c.

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

◆ stob_ad_cursors_fini()

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

Finalizes the cursors that need finalisation.

Definition at line 1248 of file ad.c.

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

◆ stob_ad_cursors_init()

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

Initializes cursors at the beginning of a pass.

Definition at line 1224 of file ad.c.

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

◆ stob_ad_destroy()

static int stob_ad_destroy ( struct m0_stob stob,
struct m0_dtx tx 
)
static

Definition at line 914 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_destroy_credit()

static void stob_ad_destroy_credit ( struct m0_stob stob,
struct m0_be_tx_credit accum 
)
static

Definition at line 905 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain2ad()

M0_INTERNAL struct m0_stob_ad_domain* stob_ad_domain2ad ( const struct m0_stob_domain dom)

Definition at line 166 of file ad.c.

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

◆ stob_ad_domain_cfg_create_free()

static void stob_ad_domain_cfg_create_free ( void *  cfg_create)
static

Definition at line 366 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_cfg_create_parse()

static int stob_ad_domain_cfg_create_parse ( const char *  str_cfg_create,
void **  cfg_create 
)
static

Definition at line 258 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_cfg_init_free()

static void stob_ad_domain_cfg_init_free ( void *  cfg_init)
static

Definition at line 253 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_cfg_init_parse()

static int stob_ad_domain_cfg_init_parse ( const char *  str_cfg_init,
void **  cfg_init 
)
static

Definition at line 233 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_create()

static int stob_ad_domain_create ( struct m0_stob_type type,
const char *  location_data,
uint64_t  dom_key,
void *  cfg_create 
)
static

Definition at line 527 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_create_credit()

static void stob_ad_domain_create_credit ( struct m0_be_seg seg,
const char *  location_data,
struct m0_be_tx_credit accum 
)
static

Definition at line 497 of file ad.c.

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

◆ stob_ad_domain_destroy()

static int stob_ad_domain_destroy ( struct m0_stob_type type,
const char *  location_data 
)
static

Definition at line 625 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_destroy_credit()

static void stob_ad_domain_destroy_credit ( struct m0_be_seg seg,
const char *  location_data,
struct m0_be_tx_credit accum 
)
static

Definition at line 512 of file ad.c.

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

◆ stob_ad_domain_fini()

static void stob_ad_domain_fini ( struct m0_stob_domain dom)
static

Definition at line 485 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_init()

static int stob_ad_domain_init ( struct m0_stob_type type,
const char *  location_data,
void *  cfg_init,
struct m0_stob_domain **  out 
)
static

Definition at line 412 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_domain_locate()

static struct m0_stob_ad_domain* stob_ad_domain_locate ( const char *  location_data)
static

Definition at line 400 of file ad.c.

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

◆ stob_ad_endio()

static bool stob_ad_endio ( struct m0_clink link)
static

Definition at line 2120 of file ad.c.

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

◆ stob_ad_fini()

static void stob_ad_fini ( struct m0_stob stob)
static

Definition at line 710 of file ad.c.

◆ stob_ad_fol_frag_alloc()

static int stob_ad_fol_frag_alloc ( struct m0_fol_frag frag,
uint32_t  frags 
)
static

Definition at line 1771 of file ad.c.

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

◆ stob_ad_fol_frag_free()

static void stob_ad_fol_frag_free ( struct m0_fol_frag frag)
static

Definition at line 1792 of file ad.c.

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

◆ stob_ad_free()

static void stob_ad_free ( struct m0_stob_domain dom,
struct m0_stob stob 
)
static

Definition at line 672 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_get_checksum_for_fragment()

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

Definition at line 1299 of file ad.c.

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

◆ stob_ad_init()

static int stob_ad_init ( struct m0_stob stob,
struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)
static

Definition at line 688 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_io_fini()

static void stob_ad_io_fini ( struct m0_stob_io io)
static

Definition at line 1042 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_io_init()

static int stob_ad_io_init ( struct m0_stob stob,
struct m0_stob_io io 
)
static

Definition at line 1020 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_io_launch()

static int stob_ad_io_launch ( struct m0_stob_io io)
static

Launch asynchronous IO.

Call ad_write_prepare() or ad_read_prepare() to do the bulk of work, then launch back IO just constructed.

Sorts index vecs in incremental order.

Todo:
: Needs to check performance impact of sorting each stobio on ad stob.

Definition at line 2068 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_io_launch_prepare()

static int stob_ad_io_launch_prepare ( struct m0_stob_io io)
static

Definition at line 2013 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_io_release()

static void stob_ad_io_release ( struct m0_stob_ad_io aio)
static

Releases vectors allocated for back IO.

Note
that back->si_stob.ov_vec.v_count is not freed separately, as it is aliased to back->si_user.z_bvec.ov_vec.v_count.
See also
ad_vec_alloc()

Definition at line 1207 of file ad.c.

Here is the caller graph for this function:

◆ stob_ad_punch()

static int stob_ad_punch ( struct m0_stob stob,
struct m0_indexvec range,
struct m0_dtx tx 
)
static

Truncates ad stob ext map and releases underlying storage object's extents.

Stob is punched at location spanned by the 'range'.

Definition at line 937 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_punch_credit()

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

Function to calculate credit required for punch operation. Iterate the stob extents from the want indexvec which provides range for punch and accumulate the credits required. Once all extents are iterated, indexvec contains granted credits that are used for punch operation. The credits are calculated only for the range of segments provided by user which is a vector of extents to be punched. If not all but part of the credits are granted, user is responsible to handle the transaction break and request for the remaining credits in the next transaction to complete the corresponding punch operation. Note: It is the responsibility of user to free indexvec.

Parameters
wantrange provided by the user.
gotrange for which credits are granted.

Definition at line 756 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_read_prepare()

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

Constructs back IO for read.

This is done in two passes:

- first, calculate number of fragments, taking holes into account. This
  pass iterates over user buffers list (src), target extents list (dst)
  and extents map (map). Once this pass is completed, back IO vectors can
  be allocated;

- then, iterate over the same sequences again. For holes, call memset()
  immediately, for other fragments, fill back IO vectors with the
  fragment description.
Note
assumes that allocation data can not change concurrently.
memset() could become a bottleneck here.
cursors and fragment sizes are measured in blocks.

Definition at line 1350 of file ad.c.

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

◆ stob_ad_rec_frag_undo_redo_op()

static int stob_ad_rec_frag_undo_redo_op ( struct m0_fol_frag frag,
struct m0_be_tx tx 
)
static

Implementation of m0_fol_frag_ops::rpo_undo and m0_fol_frag_ops::rpo_redo ().

Definition at line 2167 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_rec_frag_undo_redo_op_cred()

static void stob_ad_rec_frag_undo_redo_op_cred ( const struct m0_fol_frag frag,
struct m0_be_tx_credit accum 
)
static

Implementation of m0_fol_frag_ops::rpo_undo_credit and m0_fol_frag_ops::rpo_redo_credit().

Definition at line 2151 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_seg_free()

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

Helper function used by ad_write_map_ext() to free sub-segment "ext" from allocated segment "seg".

Definition at line 1630 of file ad.c.

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

◆ stob_ad_sm_group()

static struct m0_sm_group* stob_ad_sm_group ( void  )
static

Definition at line 376 of file ad.c.

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

◆ stob_ad_stob2ad()

static struct m0_stob_ad* stob_ad_stob2ad ( const struct m0_stob stob)
static

Definition at line 186 of file ad.c.

Here is the caller graph for this function:

◆ stob_ad_type_deregister()

static void stob_ad_type_deregister ( struct m0_stob_type type)
static

Definition at line 203 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_type_register()

static void stob_ad_type_register ( struct m0_stob_type type)
static

Definition at line 191 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_vec_alloc()

static int stob_ad_vec_alloc ( struct m0_stob obj,
struct m0_stob_io back,
uint32_t  frags 
)
static

Allocates back IO buffers after number of fragments has been calculated.

See also
stob_ad_io_release()

Definition at line 1262 of file ad.c.

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

◆ stob_ad_wext_cursor_init()

static void stob_ad_wext_cursor_init ( struct stob_ad_wext_cursor wc,
struct stob_ad_write_ext wext 
)
static

Definition at line 1526 of file ad.c.

Here is the caller graph for this function:

◆ stob_ad_wext_cursor_move()

static bool stob_ad_wext_cursor_move ( struct stob_ad_wext_cursor wc,
m0_bcount_t  count 
)
static

Definition at line 1541 of file ad.c.

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

◆ stob_ad_wext_cursor_step()

static m0_bcount_t stob_ad_wext_cursor_step ( struct stob_ad_wext_cursor wc)
static

Definition at line 1533 of file ad.c.

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

◆ stob_ad_wext_fini()

static void stob_ad_wext_fini ( struct stob_ad_write_ext wext)
static

Frees wext list.

Definition at line 1893 of file ad.c.

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

◆ stob_ad_write_back_fill()

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

Fills back IO request with information about fragments.

Definition at line 1593 of file ad.c.

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

◆ stob_ad_write_count()

static uint32_t stob_ad_write_count ( struct m0_vec_cursor src,
struct stob_ad_wext_cursor wc 
)
static

Calculates how many fragments this IO request contains.

Note
extent map and dst are not used here, because write allocates new space for data, ignoring existing allocations in the overwritten extent of the file.

Definition at line 1567 of file ad.c.

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

◆ stob_ad_write_credit()

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

Definition at line 1153 of file ad.c.

Here is the call graph for this function:

◆ stob_ad_write_map()

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

Updates extent map, inserting newly allocated extents into it.

Parameters
dst- target extents in AD storage object;
wc- allocated extents.

Total size of extents in dst and wc is the same, but their boundaries not necessary match. Iterate over both sequences at the same time, mapping contiguous chunks of AD stob name-space to contiguous chunks of the underlying object name-space.

Definition at line 1811 of file ad.c.

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

◆ stob_ad_write_map_count()

static uint32_t stob_ad_write_map_count ( struct m0_stob_ad_domain adom,
struct m0_indexvec iv,
bool  pack 
)
static

Definition at line 1120 of file ad.c.

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

◆ stob_ad_write_map_ext()

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

Inserts allocated extent into AD storage object allocation map, possibly overwriting a number of existing extents.

Parameters
offset- an offset in AD stob name-space;
ext- an extent in the underlying object name-space.

This function updates extent mapping of AD storage to map an extent in its logical name-space, starting with offset to an extent ext in the underlying storage object name-space.

Definition at line 1661 of file ad.c.

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

◆ stob_ad_write_prepare()

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

Constructs back IO for write.

  • allocates space for data to be written (first loop);
  • calculates number of fragments (ad_write_count());
  • constructs back IO (ad_write_back_fill());
  • updates extent map for this AD object with allocated extents (ad_write_map()).
Parameters
src- Cursor for buffer-extent (object data)

Definition at line 1918 of file ad.c.

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

Variable Documentation

◆ m0_stob_ad_0type

struct m0_be_0type m0_stob_ad_0type
Initial value:
= {
.b0_name = "M0_BE:AD",
.b0_init = stob_ad_0type_init,
.b0_fini = stob_ad_0type_fini
}
static void stob_ad_0type_fini(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
Definition: ad.c:140
static int stob_ad_0type_init(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
Definition: ad.c:113

Definition at line 159 of file ad.c.

◆ m0_stob_ad_type [1/2]

const struct m0_stob_type m0_stob_ad_type

Definition at line 1003 of file ad.c.

◆ m0_stob_ad_type [2/2]

const struct m0_stob_type m0_stob_ad_type
Initial value:
= {
.st_ops = &stob_ad_type_ops,
.st_fidt = {
.ft_id = STOB_TYPE_AD,
.ft_name = "adstob",
},
}
static struct m0_stob_type_ops stob_ad_type_ops
Definition: ad.c:969

Definition at line 1003 of file ad.c.

◆ M0_XCA_DOMAIN

struct ad_domain_map M0_XCA_DOMAIN

◆ stob_ad_domain_bob_type

const struct m0_bob_type stob_ad_domain_bob_type
static
Initial value:
= {
.bt_name = "m0_stob_ad_domain",
.bt_magix_offset = M0_MAGIX_OFFSET(struct m0_stob_ad_domain, sad_magix),
}
#define M0_MAGIX_OFFSET(type, field)
Definition: misc.h:356
uint64_t sad_magix
Definition: ad.h:1547

Definition at line 75 of file ad.c.

◆ stob_ad_domain_ops

static struct m0_stob_domain_ops stob_ad_domain_ops
static
Initial value:
= {
.sdo_fini = &stob_ad_domain_fini,
.sdo_stob_alloc = &stob_ad_alloc,
.sdo_stob_free = &stob_ad_free,
.sdo_stob_cfg_parse = &stob_ad_cfg_parse,
.sdo_stob_cfg_free = &stob_ad_cfg_free,
.sdo_stob_init = &stob_ad_init,
.sdo_stob_create_credit = &stob_ad_create_credit,
.sdo_stob_create = &stob_ad_create,
.sdo_stob_write_credit = &stob_ad_write_credit,
}
static void stob_ad_domain_fini(struct m0_stob_domain *dom)
Definition: ad.c:485
static void stob_ad_write_credit(const struct m0_stob_domain *dom, const struct m0_stob_io *iv, struct m0_be_tx_credit *accum)
Definition: ad.c:1153
static int stob_ad_init(struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
Definition: ad.c:688
static int stob_ad_cfg_parse(const char *str_cfg_create, void **cfg_create)
Definition: ad.c:679
static void stob_ad_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
Definition: ad.c:714
static struct m0_stob * stob_ad_alloc(struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
Definition: ad.c:663
static void stob_ad_free(struct m0_stob_domain *dom, struct m0_stob *stob)
Definition: ad.c:672
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)
Definition: ad.c:721
static void stob_ad_cfg_free(void *cfg_create)
Definition: ad.c:684

Definition at line 82 of file ad.c.

◆ stob_ad_io_op

static const struct m0_stob_io_op stob_ad_io_op
static
Initial value:
= {
.sio_launch = stob_ad_io_launch,
.sio_prepare = stob_ad_io_launch_prepare,
.sio_fini = stob_ad_io_fini,
}
static int stob_ad_io_launch_prepare(struct m0_stob_io *io)
Definition: ad.c:2013
static void stob_ad_io_fini(struct m0_stob_io *io)
Definition: ad.c:1042
static int stob_ad_io_launch(struct m0_stob_io *io)
Definition: ad.c:2068

Definition at line 1015 of file ad.c.

◆ stob_ad_ops

static struct m0_stob_ops stob_ad_ops
static
Initial value:
= {
.sop_fini = &stob_ad_fini,
.sop_destroy_credit = &stob_ad_destroy_credit,
.sop_destroy = &stob_ad_destroy,
.sop_punch_credit = &stob_ad_punch_credit,
.sop_punch = &stob_ad_punch,
.sop_io_init = &stob_ad_io_init,
.sop_block_shift = &stob_ad_block_shift,
}
static uint32_t stob_ad_block_shift(struct m0_stob *stob)
Definition: ad.c:961
static int stob_ad_destroy(struct m0_stob *stob, struct m0_dtx *tx)
Definition: ad.c:914
static void stob_ad_destroy_credit(struct m0_stob *stob, struct m0_be_tx_credit *accum)
Definition: ad.c:905
static int stob_ad_punch(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *tx)
Definition: ad.c:937
static int stob_ad_io_init(struct m0_stob *stob, struct m0_stob_io *io)
Definition: ad.c:1020
static int stob_ad_punch_credit(struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
Definition: ad.c:756
static void stob_ad_fini(struct m0_stob *stob)
Definition: ad.c:710

Definition at line 83 of file ad.c.

◆ stob_ad_type_ops

struct m0_stob_type_ops stob_ad_type_ops
static
Initial value:
= {
.sto_register = &stob_ad_type_register,
.sto_deregister = &stob_ad_type_deregister,
.sto_domain_cfg_init_parse = &stob_ad_domain_cfg_init_parse,
.sto_domain_cfg_init_free = &stob_ad_domain_cfg_init_free,
.sto_domain_cfg_create_parse = &stob_ad_domain_cfg_create_parse,
.sto_domain_cfg_create_free = &stob_ad_domain_cfg_create_free,
.sto_domain_init = &stob_ad_domain_init,
.sto_domain_create = &stob_ad_domain_create,
.sto_domain_destroy = &stob_ad_domain_destroy,
}
static int stob_ad_domain_init(struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
Definition: ad.c:412
static void stob_ad_domain_cfg_init_free(void *cfg_init)
Definition: ad.c:253
static void stob_ad_type_deregister(struct m0_stob_type *type)
Definition: ad.c:203
static int stob_ad_domain_destroy(struct m0_stob_type *type, const char *location_data)
Definition: ad.c:625
static int stob_ad_domain_cfg_create_parse(const char *str_cfg_create, void **cfg_create)
Definition: ad.c:258
static int stob_ad_domain_cfg_init_parse(const char *str_cfg_init, void **cfg_init)
Definition: ad.c:233
static void stob_ad_domain_cfg_create_free(void *cfg_create)
Definition: ad.c:366
static int stob_ad_domain_create(struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
Definition: ad.c:527
static void stob_ad_type_register(struct m0_stob_type *type)
Definition: ad.c:191

Definition at line 969 of file ad.c.