84 bool use_small_credits)
93 if (use_small_credits) {
185 for (
i = 0;
i <
NR; ++
i) {
314 bool is_local_tx =
false;
427 bool credit_is_enough =
false;
437 for (
i = 0;
i <
nr; ++
i) {
457 credit_is_enough =
true;
467 if (!credit_is_enough)
474 for (
i = 0;
i <
nr;
i++) {
505 for (
i = 0;
i <
NR/2; ++
i) {
513 for (
i = 0;
i <
NR; ++
i) {
521 for (
i = 0;
i <
NR; ++
i)
535 for (
i = 1;
i <=
NR; ++
i)
538 for (
i = 1;
i <=
NR; ++
i) {
541 for (j = 0; j <
i; ++j) {
556 for (
i = 1;
i <=
NR; ++
i) {
560 for (j = 0; j <
i; ++j) {
653 { .ub_name =
"write-prime",
657 { .ub_name =
"write",
M0_INTERNAL struct m0_stob_domain * m0_stob_dom_get(struct m0_stob *stob)
void m0_be_ut_seg_fini(struct m0_be_ut_seg *ut_seg)
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
static char * zero_buf[NR]
enum m0_stob_io_flags si_flags
void m0_stob_ut_adieu_ad(void)
int(* sop_punch)(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
static void test_ad_rw_unordered()
M0_INTERNAL int m0_be_ut_backend_init_cfg(struct m0_be_ut_backend *ut_be, const struct m0_be_domain_cfg *cfg, bool mkfs)
static struct m0_dtx g_tx
M0_INTERNAL void m0_stob_io_fini(struct m0_stob_io *io)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
int(* rpo_undo)(struct m0_fol_frag *frag, struct m0_be_tx *tx)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
static void punch_test(void)
M0_INTERNAL int m0_stob_locate(struct m0_stob *stob)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static int mock_balloc_init(struct m0_ad_balloc *ballroom, struct m0_be_seg *seg, uint32_t bshift, m0_bindex_t container_size, m0_bcount_t groupsize, m0_bcount_t spare_reserve)
struct m0_ub_set m0_ad_ub
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)
#define M0_UB_ASSERT(cond)
const struct m0_fol_frag_ops * rp_ops
void m0_stob_ut_ad_init(struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg, bool use_small_credits)
static struct m0_sm_group * grp
struct m0_ad_balloc mb_ballroom
static void ub_fini(void)
M0_INTERNAL int m0_stob_domain_destroy(struct m0_stob_domain *dom)
struct m0_be_seg * bus_seg
static char * user_buf[NR]
M0_INTERNAL void m0_dtx_init(struct m0_dtx *tx, struct m0_be_domain *be_domain, struct m0_sm_group *sm_group)
static char * read_cksm_buf[NR]
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 void m0_be_emap_close(struct m0_be_emap_cursor *it)
static struct m0_be_emap_cursor it
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
M0_INTERNAL void m0_stob_ad_balloc_set(struct m0_stob_io *io, uint64_t flags)
struct m0_be_ut_seg ut_seg
void m0_be_ut_seg_init(struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be, m0_bcount_t size)
void(* rpo_undo_credit)(const struct m0_fol_frag *frag, struct m0_be_tx_credit *accum)
struct m0_be_emap_seg ec_seg
#define container_of(ptr, type, member)
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)
struct m0_be_tx_credit bec_tx_size_max
static void test_ad_undo(void)
M0_INTERNAL void m0_stob_ad_init_cfg_make(char **str, struct m0_be_domain *dom)
static void mock_balloc_fini(struct m0_ad_balloc *ballroom)
M0_INTERNAL int m0_dtx_done_sync(struct m0_dtx *tx)
static struct m0_stob_domain * dom_back
static void test_read(int nr)
static int malloc_reserve_extent(struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
static struct m0_stob * obj_fore
struct m0_buf ee_cksum_buf
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
static void ub_read(int i)
#define M0_BE_TX_CREDIT(nr, size)
M0_INTERNAL int m0_stob_domain_create(const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out)
void m0_be_ut_backend_cfg_default(struct m0_be_domain_cfg *cfg)
struct m0_be_ut_backend ut_be
static const struct m0_ad_balloc_ops mock_balloc_ops
static int mock_balloc_free(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)
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)
static m0_bindex_t stob_vi[NR]
struct m0_indexvec si_stob
M0_INTERNAL void m0_ext_init(struct m0_ext *ext)
static void ub_write(int i)
static void test_punch(int nr)
static void test_ad(void)
static void test_write(int nr, struct m0_dtx *tx)
M0_INTERNAL void m0_stob_id_make(uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
M0_INTERNAL void * m0_stob_addr_pack(const void *buf, uint32_t shift)
M0_INTERNAL struct m0_stob_ad_domain * stob_ad_domain2ad(const struct m0_stob_domain *dom)
M0_INTERNAL int m0_stob_io_private_setup(struct m0_stob_io *io, struct m0_stob *obj)
struct m0_be_tx_credit tx_betx_cred
void * m0_alloc(size_t size)
struct m0_fol_frag * si_fol_frag
M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx)
struct m0_sm_group * m0_be_ut_backend_sm_group_lookup(struct m0_be_ut_backend *ut_be)
static char * user_cksm_buf[NR]
static struct m0_stob_domain * dom_fore
struct m0_fol_rec tx_fol_rec
static uint64_t min64u(uint64_t a, uint64_t b)
static struct m0_stob_io io
struct m0_be_domain but_dom
static int test_ad_init(bool use_small_credits)
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
M0_INTERNAL int m0_stob_punch_credit(struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
static char * read_bufs[NR]
#define M0_ALLOC_PTR(ptr)
static int mock_balloc_alloc(struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_type)
static m0_bcount_t user_vc[NR]
static char * read_buf[NR]
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
void m0_be_ut_backend_fini(struct m0_be_ut_backend *ut_be)
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)
M0_INTERNAL int m0_dtx_open_sync(struct m0_dtx *tx)
static struct m0_be_seg * seg
static int test_ad_fini(void)
static char * user_bufs[NR]
static uint32_t block_shift
M0_INTERNAL int m0_ut_stob_create(struct m0_stob *stob, const char *str_cfg, struct m0_be_domain *be_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)
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
void m0_stob_ut_ad_fini(struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg)
static int ub_init(const char *opts M0_UNUSED)
struct m0_be_engine_cfg bc_engine
static struct m0_stob * obj_back
M0_INTERNAL void m0_stob_put(struct m0_stob *stob)
static struct m0_clink clink
static m0_bcount_t stob_vc[NR]
static struct mock_balloc * b2mock(struct m0_ad_balloc *ballroom)
enum m0_stob_io_opcode si_opcode