38 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADSTOB 46 #include "stob/ad_private_xc.h" 126 rc = ad ==
NULL ? -ENOMEM : 0;
133 ad_domains_tlink_init_at_tail(ad, &module->
sam_domains);
154 ad_domains_tlink_del_fini(ad);
171 m0_stob_ad_domain_bob_check(adom);
240 if (str_cfg_init ==
NULL)
247 rc = sscanf(str_cfg_init,
"%p", (
void **)&cfg->
dic_dom);
250 return rc == 1 ? 0 : -EINVAL;
265 if (str_cfg_create ==
NULL)
276 rc =
rc == 6 ? 0 : -EINVAL;
291 grp_blocks = 1 <<
m0_log2(grp_blocks);
315 #ifdef __SPARE__SPACE__ 317 return grp_blocks % 5 == 0 ? grp_blocks / 5 : grp_blocks / 5 + 1;
336 void *cksum_addr =
NULL;
413 const char *location_data,
427 return M0_RC(-ENOENT);
455 #ifdef __SPARE_SPACE__
460 balloc_inited =
rc == 0;
470 m0_stob_ad_domain_bob_init(adom);
493 m0_stob_ad_domain_bob_fini(adom);
498 const char *location_data,
509 location_data, &
data, accum);
513 const char *location_data,
523 location_data, accum);
528 const char *location_data,
568 .ot_version = M0_STOB_AD_DOMAIN_FORMAT_VERSION,
569 .ot_type = M0_FORMAT_TYPE_STOB_AD_DOMAIN,
571 offsetof(struct m0_stob_ad_domain, sad_footer)
577 #ifdef __SPARE_SPACE__ 586 strcpy(adom->
sad_path, location_data);
599 .ot_version = M0_STOB_AD_0TYPE_REC_FORMAT_VERSION,
600 .ot_type = M0_FORMAT_TYPE_STOB_AD_0TYPE_REC,
601 .ot_footer_offset = offsetof(struct stob_ad_0type_rec, sa0_footer)
606 &tx, location_data, &seg0_data);
619 if (adom ==
NULL &&
rc == 0)
626 const char *location_data)
664 const struct m0_fid *stob_fid)
690 const struct m0_fid *stob_fid)
707 return rc == -ESRCH ? -ENOENT :
rc;
724 const struct m0_fid *stob_fid,
815 return M0_RC(-EBUSY);
1007 .ft_name =
"adstob",
1054 uint64_t
addr = (uint64_t)
buf;
1057 return (
void *)(
addr << shift);
1066 uint64_t alloc_type)
1129 M0_ENTRY(
"dom=%p bshift=%u babshift=%d pack=%#x", adom,
1149 M0_LEAVE(
"dom=%p frags=%u", adom, frags);
1322 memcpy(
dst,
src, checksum_nob);
1361 uint32_t frags_not_empty;
1380 EXT_P(&
seg->ee_ext), (
unsigned long long)
seg->ee_val);
1382 frags = frags_not_empty = 0;
1410 return M0_RC(eomap);
1418 if (frag_size > (
size_t)~0ULL)
1419 return M0_ERR(-EOVERFLOW);
1435 return M0_RC(eomap);
1441 (
int)frags, (
int)frags_not_empty);
1453 for (idx =
i = 0;
i < frags; ++
i) {
1463 return M0_RC(eomap);
1487 0, frag_size << bshift);
1496 (off -
seg->ee_ext.e_start);
1548 if (
count >= step) {
1633 const struct m0_ext *ext,
1665 const struct m0_ext *ext)
1678 (
unsigned long long)ext->
e_start);
1686 return M0_RC(result);
1722 M0_LOG(M0_DEBUG,
"del: val=0x%llx",
1723 (unsigned long long)seg->ee_val);
1724 M0_ASSERT_INFO(seg->ee_val != ext->e_start,
1725 "Delete of the same just allocated block");
1727 stob_ad_seg_free(io->si_tx, adom, seg,
1728 &seg->ee_ext, seg->ee_val);
1748 (ext->
e_end -
seg->ee_ext.e_start);
1829 M0_ENTRY(
"io=%p dom=%p frags=%u",
io, adom, frags);
1854 .ee_pre =
map->ct_it->ec_seg.ee_pre
1862 last_seg =
dst->ic_cur.vc_seg;
1876 if (last_seg !=
dst->ic_cur.vc_seg)
1924 uint32_t bfrags = 0;
2074 bool wentout =
false;
2192 (
unsigned long long)old_data[
i].
ee_val);
2232 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL struct m0_be_domain * m0_be_emap_seg_domain(const struct m0_be_emap *map)
M0_INTERNAL void m0_ivec_cursor_init(struct m0_ivec_cursor *cur, const struct m0_indexvec *ivec)
M0_INTERNAL struct m0_stob_domain * m0_stob_dom_get(struct m0_stob *stob)
#define M0_BE_ALLOC_CREDIT_PTR(ptr, seg, accum)
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)
struct m0_be_domain * bs_domain
struct m0_be_emap_seg * ps_old_data
#define M0_BE_ALLOC_PTR_SYNC(ptr, seg, tx)
#define M0_ALLOC_ARR(arr, nr)
enum m0_stob_io_flags si_flags
M0_INTERNAL m0_bcount_t m0_ext_length(const struct m0_ext *ext)
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 bool stob_ad_endio(struct m0_clink *link)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
static int stob_ad_rec_frag_undo_redo_op(struct m0_fol_frag *frag, struct m0_be_tx *tx)
M0_INTERNAL uint64_t m0_stob_domain__dom_key(const struct m0_fid *dom_id)
static uint32_t stob_ad_write_count(struct m0_vec_cursor *src, struct stob_ad_wext_cursor *wc)
void(* sto_register)(struct m0_stob_type *type)
M0_INTERNAL void m0_chan_broadcast_lock(struct m0_chan *chan)
M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find(const struct m0_fid *dom_id)
M0_INTERNAL void m0_stob_io_fini(struct m0_stob_io *io)
int(* bo_alloc)(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_zone)
M0_INTERNAL void m0_stob_domain__dom_id_make(struct m0_fid *dom_id, uint8_t type_id, uint64_t dom_container, uint64_t dom_key)
#define M0_FOL_FRAG_TYPE_INIT(frag, name)
int const char const void size_t int flags
struct m0_ad_balloc cb_ballroom
void m0_be_0type_add_credit(struct m0_be_domain *dom, const struct m0_be_0type *zt, const char *suffix, const struct m0_buf *data, struct m0_be_tx_credit *credit)
static int stob_ad_domain_init(struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL m0_bcount_t m0_be_emap_caret_step(const struct m0_be_emap_caret *car)
struct m0_be_seg * adg_seg
M0_INTERNAL m0_bcount_t m0_ivec_cursor_step(const struct m0_ivec_cursor *cur)
M0_INTERNAL int m0_stob_locate(struct m0_stob *stob)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
struct m0_fid si_domain_fid
const struct m0_stob_ops * so_ops
M0_INTERNAL void m0_stob_io_credit(const struct m0_stob_io *io, const struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
static void stob_ad_wext_fini(struct stob_ad_write_ext *wext)
static uint32_t stob_ad_block_shift(struct m0_stob *stob)
static void * stob_ad_addr_open(const void *buf, uint32_t shift)
static void stob_ad_domain_destroy_credit(struct m0_be_seg *seg, const char *location_data, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_fol_frag_type_register(struct m0_fol_frag_type *type)
struct m0_stob_ad_module i_stob_ad_module
static struct m0_sm_group * grp
struct m0_stob_io * ai_fore
#define M0_LOG(level,...)
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)
M0_INTERNAL const struct m0_fid * m0_stob_domain_id_get(const struct m0_stob_domain *dom)
void m0_be_0type_del_credit(struct m0_be_domain *dom, const struct m0_be_0type *zt, const char *suffix, struct m0_be_tx_credit *credit)
static int stob_ad_io_launch_prepare(struct m0_stob_io *io)
static void stob_ad_domain_cfg_init_free(void *cfg_init)
M0_INTERNAL void m0_be_tx_fini(struct m0_be_tx *tx)
M0_INTERNAL void m0_fol_frag_init(struct m0_fol_frag *frag, void *data, const struct m0_fol_frag_type *type)
static struct m0_uint128 prefix
int(* bo_init)(struct m0_ad_balloc *ballroom, struct m0_be_seg *db, uint32_t bshift, m0_bcount_t container_size, m0_bcount_t blocks_per_group, m0_bcount_t spare_blocks_per_group)
M0_INTERNAL bool m0_stob_ad_domain__invariant(struct m0_stob_ad_domain *adom)
static m0_bcount_t segs[NR *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_bfree(struct m0_stob_ad_domain *adom, struct m0_dtx *tx, struct m0_ext *ext)
M0_INTERNAL void m0_be_emap_destroy(struct m0_be_emap *map, struct m0_be_tx *tx, struct m0_be_op *op)
M0_INTERNAL void m0_be_emap_obj_insert(struct m0_be_emap *map, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_uint128 *prefix, uint64_t val)
m0_bcount_t sad_container_size
const struct m0_stob_io_op * si_op
M0_INTERNAL bool m0_stob_domain_is_of_type(const struct m0_stob_domain *dom, const struct m0_stob_type *dt)
struct m0_be_0type m0_stob_ad_0type
const struct m0_stob_type m0_stob_ad_type
const struct stob_ad_write_ext * wc_wext
static void stob_ad_type_deregister(struct m0_stob_type *type)
M0_INTERNAL uint8_t m0_stob_type_id_get(const struct m0_stob_type *type)
M0_INTERNAL void m0_be_emap_close(struct m0_be_emap_cursor *it)
static struct m0_be_emap_cursor it
static void stob_ad_io_release(struct m0_stob_ad_io *aio)
M0_INTERNAL void m0_stob_ad_balloc_set(struct m0_stob_io *io, uint64_t flags)
static void stob_ad_domain_fini(struct m0_stob_domain *dom)
M0_INTERNAL void m0_be_tx_prep(struct m0_be_tx *tx, const struct m0_be_tx_credit *credit)
const struct m0_ad_balloc_ops * ab_ops
#define M0_BE_TX_CAPTURE_PTR(seg, tx, ptr)
static void pack(struct m0_addb2_mach *mach)
char adm_path[MAXPATHLEN]
M0_INTERNAL struct m0 * m0_get(void)
M0_INTERNAL const struct m0_fid * m0_stob_fid_get(struct m0_stob *stob)
M0_INTERNAL void * m0_extent_get_checksum_addr(void *b_addr, m0_bindex_t off, m0_bindex_t base_off, m0_bindex_t unit_sz, m0_bcount_t cs_size)
M0_INTERNAL int m0_balloc_create(uint64_t cid, struct m0_be_seg *seg, struct m0_sm_group *grp, struct m0_balloc **out, const struct m0_fid *fid)
struct m0_be_emap_seg ec_seg
#define container_of(ptr, type, member)
void(* sdo_fini)(struct m0_stob_domain *dom)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_INTERNAL m0_bcount_t m0_extent_get_checksum_nob(m0_bindex_t ext_start, m0_bindex_t ext_length, m0_bindex_t unit_sz, m0_bcount_t cs_size)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
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)
M0_INTERNAL void m0_stob_ad_init_cfg_make(char **str, struct m0_be_domain *dom)
int(* sio_launch)(struct m0_stob_io *io)
static void stob_ad_wext_cursor_init(struct stob_ad_wext_cursor *wc, struct stob_ad_write_ext *wext)
static void stob_ad_io_fini(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_0type_fini(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
struct m0_stob_domain * so_domain
struct m0_buf ee_cksum_buf
static int stob_ad_init(struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
static int stob_ad_fol_frag_alloc(struct m0_fol_frag *frag, uint32_t frags)
static int head(struct m0_sm *mach)
#define M0_BE_TX_CREDIT(nr, size)
static uint32_t unit_size
struct m0_stob_ad_domain * adm_dom
struct m0_ad_balloc * sad_ballroom
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL bool m0_ext_equal(const struct m0_ext *a, const struct m0_ext *b)
M0_INTERNAL struct m0_be_engine * m0_be_domain_engine(struct m0_be_domain *dom)
struct m0_be_seg * sad_be_seg
M0_INTERNAL bool m0_vec_is_empty(const struct m0_vec *vec)
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)
M0_INTERNAL bool m0_ext_is_valid(const struct m0_ext *ext)
M0_INTERNAL int m0_be_emap_op_rc(const struct m0_be_emap_cursor *it)
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_be_emap_paste(struct m0_be_emap_cursor *it, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t val, void(*del)(struct m0_be_emap_seg *), void(*cut_left)(struct m0_be_emap_seg *, struct m0_ext *, uint64_t), void(*cut_right)(struct m0_be_emap_seg *, struct m0_ext *, uint64_t))
#define M0_BE_OP_SYNC_RET(op_obj, action, member)
static int stob_ad_cfg_parse(const char *str_cfg_create, void **cfg_create)
M0_INTERNAL void m0_be_emap_init(struct m0_be_emap *map, struct m0_be_seg *db)
static int stob_ad_vec_alloc(struct m0_stob *obj, struct m0_stob_io *back, uint32_t frags)
struct m0_format_header sa0_header
M0_INTERNAL int m0_stob_io_prepare_and_launch(struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
M0_INTERNAL const struct m0_stob_id * m0_stob_id_get(struct m0_stob *stob)
M0_INTERNAL void m0_vec_cursor_init(struct m0_vec_cursor *cur, const struct m0_vec *vec)
struct m0_indexvec si_stob
static struct m0_stob * stob
static m0_bcount_t stob_ad_wext_cursor_step(struct stob_ad_wext_cursor *wc)
static int stob_ad_destroy(struct m0_stob *stob, struct m0_dtx *tx)
struct m0_be_emap * ec_map
static void stob_ad_destroy_credit(struct m0_stob *stob, struct m0_be_tx_credit *accum)
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 struct m0_be_op * it_op
static void stob_ad_rec_frag_undo_redo_op_cred(const struct m0_fol_frag *frag, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_ext_init(struct m0_ext *ext)
struct m0_be_domain * dic_dom
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)
m0_time_t m0_time_now(void)
static struct m0_balloc * b2m0(const struct m0_ad_balloc *ballroom)
static int stob_ad_domain_destroy(struct m0_stob_type *type, const char *location_data)
M0_INTERNAL void m0_be_tx_credit_add(struct m0_be_tx_credit *c0, const struct m0_be_tx_credit *c1)
M0_INTERNAL void m0_be_emap_caret_init(struct m0_be_emap_caret *car, struct m0_be_emap_cursor *it, m0_bindex_t index)
M0_INTERNAL struct m0_be_seg * m0_be_domain_seg(const struct m0_be_domain *dom, const void *addr)
static struct m0_stob_domain * dom
M0_INTERNAL void m0_balloc_init(struct m0_balloc *cb)
M0_INTERNAL bool m0_be_emap_ext_is_last(const struct m0_ext *ext)
M0_INTERNAL void m0_be_emap_extent_update(struct m0_be_emap_cursor *it, struct m0_be_tx *tx, const struct m0_be_emap_seg *es)
M0_TL_DEFINE(ad_domains, M0_INTERNAL, struct ad_domain_map)
M0_INTERNAL struct m0_stob_ad_domain * stob_ad_domain2ad(const struct m0_stob_domain *dom)
static int stob_ad_0type_init(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
M0_INTERNAL void * m0_stob_ad_get_checksum_addr(struct m0_stob_io *io, m0_bindex_t off)
struct m0_be_op::@39::@40 u_emap
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
static int stob_ad_punch(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *tx)
M0_INTERNAL int m0_be_tx_exclusive_open_sync(struct m0_be_tx *tx)
struct m0_fol_frag * si_fol_frag
void(* bo_free_credit)(const struct m0_ad_balloc *ballroom, int nr, struct m0_be_tx_credit *accum)
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)
M0_INTERNAL void m0_be_emap_fini(struct m0_be_emap *map)
m0_bcount_t counts[SEGS_NR]
struct m0_stob_id sad_bstore_id
M0_INTERNAL void m0_be_emap_lookup(struct m0_be_emap *map, const struct m0_uint128 *prefix, m0_bindex_t offset, struct m0_be_emap_cursor *it)
struct m0_sm_group * lo_grp
enum m0_stob_io_state si_state
static m0_bindex_t offset
struct m0_fol_rec tx_fol_rec
M0_INTERNAL void m0_be_emap_obj_delete(struct m0_be_emap *map, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_uint128 *prefix)
static struct m0_stob_type_ops stob_ad_type_ops
int(* bo_free)(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)
M0_INTERNAL bool m0_ivec_cursor_move(struct m0_ivec_cursor *cur, m0_bcount_t count)
void(* bo_fini)(struct m0_ad_balloc *ballroom)
static int stob_ad_domain_cfg_create_parse(const char *str_cfg_create, void **cfg_create)
#define M0_BE_FREE_PTR_SYNC(ptr, seg, tx)
M0_INTERNAL bool m0_ext_is_in(const struct m0_ext *ext, m0_bindex_t index)
static const struct m0_stob_io_op stob_ad_io_op
static int stob_ad_domain_cfg_init_parse(const char *str_cfg_init, void **cfg_init)
static struct m0_stob_io io
static void stob_ad_fol_frag_free(struct m0_fol_frag *frag)
static struct m0_stob_domain_ops stob_ad_domain_ops
M0_INTERNAL m0_bcount_t m0_vec_count(const struct m0_vec *vec)
M0_INTERNAL bool m0_ext_is_empty(const struct m0_ext *ext)
m0_bcount_t adg_blocks_per_group
char sad_path[AD_PATHLEN]
static int stob_ad_io_init(struct m0_stob *stob, struct m0_stob_io *io)
static struct m0_be_emap * emap
struct m0_be_emap_cursor * ct_it
int m0_be_0type_add(struct m0_be_0type *zt, struct m0_be_domain *dom, struct m0_be_tx *tx, const char *suffix, const struct m0_buf *data)
m0_bcount_t adg_container_size
M0_INTERNAL void m0_be_tx_init(struct m0_be_tx *tx, uint64_t tid, struct m0_be_domain *dom, struct m0_sm_group *sm_group, m0_be_tx_cb_t persistent, m0_be_tx_cb_t discarded, void(*filler)(struct m0_be_tx *tx, void *payload), void *datum)
struct m0_stob * sad_bstore
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
M0_INTERNAL uint32_t m0_indexvec_pack(struct m0_indexvec *iv)
static bool stob_ad_wext_cursor_move(struct stob_ad_wext_cursor *wc, m0_bcount_t count)
static int stob_ad_io_launch(struct m0_stob_io *io)
struct m0_be_emap sad_adata
struct m0_pdclust_tgt_addr tgt
M0_INTERNAL enum m0_stob_state m0_stob_state_get(struct m0_stob *stob)
void(* sop_fini)(struct m0_stob *stob)
#define M0_MAGIX_OFFSET(type, field)
struct m0_stob_id arp_stob_id
M0_INTERNAL m0_bcount_t m0_vec_cursor_step(const struct m0_vec_cursor *cur)
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)
#define M0_BUF_INIT_PTR(p)
M0_INTERNAL void m0_stob_ad_balloc_clear(struct m0_stob_io *io)
m0_bcount_t sad_spare_blocks_per_group
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
struct m0_stob_ad_domain * sa0_ad_domain
static void stob_ad_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
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)
#define M0_FI_ENABLED(tag)
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 struct m0_stob_ad * stob_ad_stob2ad(const struct m0_stob *stob)
static const struct m0_bob_type stob_ad_domain_bob_type
int m0_be_0type_del(struct m0_be_0type *zt, struct m0_be_domain *dom, struct m0_be_tx *tx, const char *suffix)
#define M0_ALLOC_PTR(ptr)
static int stob_ad_bstore(struct m0_stob_id *stob_id, struct m0_stob **out)
M0_INTERNAL void m0_stob_iovec_sort(struct m0_stob_io *stob)
static struct m0_stob_ops stob_ad_ops
M0_INTERNAL void m0_fol_frag_add(struct m0_fol_rec *rec, struct m0_fol_frag *frag)
static int ext_punch(struct m0_stob *stob, struct m0_dtx *tx, struct m0_ext *todo)
M0_INTERNAL bool m0_vec_cursor_move(struct m0_vec_cursor *cur, m0_bcount_t count)
m0_time_t m0_time_sub(const m0_time_t t1, const m0_time_t t2)
struct stob_ad_write_ext * we_next
static void stob_ad_domain_cfg_create_free(void *cfg_create)
M0_INTERNAL void m0_be_op_fini(struct m0_be_op *op)
M0_INTERNAL m0_bindex_t m0_ivec_cursor_index(const struct m0_ivec_cursor *cur)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
M0_INTERNAL bool m0_be_should_break(struct m0_be_engine *eng, const struct m0_be_tx_credit *accum, const struct m0_be_tx_credit *delta)
M0_INTERNAL m0_bcount_t m0_stob_ad_spares_calc(m0_bcount_t grp_blocks)
struct m0_format_header sad_header
M0_INTERNAL int m0_be_emap_caret_move_sync(struct m0_be_emap_caret *car, m0_bcount_t count)
static struct m0_sm_group * stob_ad_sm_group(void)
M0_INTERNAL struct m0_balloc * m0_stob_ad_domain2balloc(const struct m0_stob_domain *dom)
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
static int stob_ad_domain_create(struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
M0_INTERNAL void m0_stob_io_init(struct m0_stob_io *io)
M0_INTERNAL int m0_stob_find(const struct m0_stob_id *id, struct m0_stob **out)
static struct m0_be_seg * seg
static void stob_ad_domain_create_credit(struct m0_be_seg *seg, const char *location_data, struct m0_be_tx_credit *accum)
#define M0_UINT128(hi, lo)
M0_INTERNAL void m0_fol_frag_type_deregister(struct m0_fol_frag_type *type)
const struct m0_stob_domain_ops * sd_ops
static unsigned m0_log2(uint64_t val)
m0_bcount_t si_cksum_nob_read
static struct m0_stob * stob_ad_alloc(struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
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)
struct stob_ad_rec_frag_seg arp_seg
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)
M0_INTERNAL void m0_be_emap_credit(struct m0_be_emap *map, enum m0_be_emap_optype optype, m0_bcount_t nr, struct m0_be_tx_credit *accum)
struct m0_buf ec_app_cksum_buf
const struct m0_stob_type_ops * st_ops
static void stob_ad_free(struct m0_stob_domain *dom, struct m0_stob *stob)
m0_bcount_t sad_blocks_per_group
struct m0_stob_io ai_back
#define m0_tl_find(name, var, head,...)
M0_INTERNAL void m0_be_op_init(struct m0_be_op *op)
void(* bo_alloc_credit)(const struct m0_ad_balloc *ballroom, int nr, struct m0_be_tx_credit *accum)
M0_BOB_DEFINE(static, &stob_ad_domain_bob_type, m0_stob_ad_domain)
struct m0_io_scope * si_scope
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)
struct m0_pdclust_src_addr src
M0_INTERNAL bool m0_be_op_is_done(struct m0_be_op *op)
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)
#define M0_BE_OP_SYNC_RET_WITH(op, action, member)
M0_INTERNAL void m0_be_emap_create(struct m0_be_emap *map, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_fid *fid)
M0_INTERNAL void m0_stob_put(struct m0_stob *stob)
m0_bcount_t adg_spare_blocks_per_group
#define M0_BE_FREE_CREDIT_PTR(ptr, seg, accum)
static void stob_ad_fini(struct m0_stob *stob)
static uint64_t max64u(uint64_t a, uint64_t b)
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)
M0_INTERNAL struct m0_be_emap_seg * m0_be_emap_seg_get(struct m0_be_emap_cursor *it)
static struct m0_stob_ad_domain * stob_ad_domain_locate(const char *location_data)
M0_INTERNAL void m0_be_tx_close_sync(struct m0_be_tx *tx)
static void stob_ad_type_register(struct m0_stob_type *type)
M0_INTERNAL void m0_be_emap_caret_fini(struct m0_be_emap_caret *car)
#define M0_IMPOSSIBLE(fmt,...)
enum m0_stob_io_opcode si_opcode
static void stob_ad_cfg_free(void *cfg_create)