23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT 46 return strcmp(
key0, key1);
51 return kv !=
NULL ? strlen(kv) + 1 : 0;
169 if (--
nr == 0 || nr_left == 0) {
219 if (--
nr == 0 || nr_left == 0) {
256 if (--
nr == 0 || nr_left == 0) {
273 for (
i = 0;
i <
n - 1; ++
i)
322 if ((rand_keys[
i] & 1) == 0) {
351 if ((rand_keys[
i] & 1) == 0) {
387 struct m0_buf *v,
bool overwrite)
453 M0_LOG(
M0_INFO,
"Save existing key without overwrite flag...");
588 snprintf(v2,
sizeof v2,
"%s",
"ABCDEFGHI");
714 sscanf(
key.b_addr,
"%d", &v);
740 sscanf(
key.b_addr,
"%d", &v);
884 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL void m0_be_btree_insert_inplace(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key, struct m0_be_btree_anchor *anchor, uint64_t zonemask)
void m0_be_ut_seg_fini(struct m0_be_ut_seg *ut_seg)
#define M0_BE_ALLOC_CREDIT_PTR(ptr, seg, accum)
static int btree_insert(struct m0_be_btree *t, struct m0_buf *k, struct m0_buf *v, int nr_left)
M0_INTERNAL void m0_be_btree_cursor_next(struct m0_be_btree_cursor *cur)
struct m0_be_op::@39::m0_be_op__btree u_btree
#define M0_BE_ALLOC_PTR_SYNC(ptr, seg, tx)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL void m0_be_btree_delete_credit(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
void m0_be_ut_seg_reload(struct m0_be_ut_seg *ut_seg)
static m0_bcount_t tree_kv_size(const void *kv)
static struct m0_be_btree * create_tree(void)
M0_INTERNAL void m0_be_btree_lookup(struct m0_be_btree *tree, struct m0_be_op *op, const struct m0_buf *key, struct m0_buf *value)
#define M0_LOG(level,...)
struct m0_be_seg * bus_seg
M0_INTERNAL void m0_be_tx_fini(struct m0_be_tx *tx)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
M0_INTERNAL void m0_be_tx_prep(struct m0_be_tx *tx, const struct m0_be_tx_credit *credit)
void m0_be_ut_seg_init(struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be, m0_bcount_t size)
M0_INTERNAL void m0_be_btree_maxkey(struct m0_be_btree *tree, struct m0_be_op *op, struct m0_buf *out)
M0_INTERNAL bool m0_be_btree_is_empty(struct m0_be_btree *tree)
static void btree_delete_test(struct m0_be_btree *tree, struct m0_be_tx *tx)
M0_INTERNAL void m0_be_btree_create(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_fid *btree_fid)
M0_INTERNAL void m0_be_btree_destroy_credit(struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
struct m0_be_btree_backlink bb_backlink
M0_INTERNAL void m0_be_btree_delete(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key)
M0_INTERNAL void m0_be_btree_cursor_fini(struct m0_be_btree_cursor *cursor)
#define M0_BE_TX_CREDIT(nr, size)
static void truncate_tree(struct m0_be_btree *tree)
M0_INTERNAL void m0_be_btree_update_credit(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_be_btree_insert_credit2(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
M0_INTERNAL uint64_t m0_rnd(uint64_t max, uint64_t *seed)
M0_INTERNAL void m0_be_btree_create_credit(const struct m0_be_btree *tree, m0_bcount_t nr, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_be_btree_insert(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key, const struct m0_buf *val)
#define M0_FID_TINIT(type, container, key)
M0_INTERNAL void m0_be_btree_save(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key, const struct m0_buf *val, bool overwrite)
M0_INTERNAL void m0_be_btree_lookup_inplace(struct m0_be_btree *tree, struct m0_be_op *op, const struct m0_buf *key, struct m0_be_btree_anchor *anchor)
M0_INTERNAL void m0_be_btree_insert_credit(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
M0_INTERNAL void m0_be_btree_destroy(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op)
M0_INTERNAL void btree_dbg_print(struct m0_be_btree *tree)
M0_INTERNAL void m0_be_btree_release(struct m0_be_tx *tx, struct m0_be_btree_anchor *anchor)
static struct m0_thread t[8]
static struct m0_be_ut_backend * ut_be
M0_INTERNAL int m0_be_tx_open_sync(struct m0_be_tx *tx)
void m0_be_ut_backend_init(struct m0_be_ut_backend *ut_be)
M0_INTERNAL void m0_be_btree_fini(struct m0_be_btree *tree)
M0_INTERNAL void m0_be_btree_minkey(struct m0_be_btree *tree, struct m0_be_op *op, struct m0_buf *out)
M0_INTERNAL void m0_be_btree_update_credit2(const struct m0_be_btree *tree, m0_bcount_t nr, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_be_btree_cursor_first_sync(struct m0_be_btree_cursor *cur)
static const struct m0_be_btree_kv_ops kv_ops
#define M0_BE_FREE_PTR_SYNC(ptr, seg, tx)
M0_INTERNAL void m0_be_btree_cursor_kv_get(struct m0_be_btree_cursor *cur, struct m0_buf *key, struct m0_buf *val)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL void m0_be_btree_update(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, const struct m0_buf *key, const struct m0_buf *val)
void m0_be_ut_btree_create_truncate(void)
static void check(struct m0_be_btree *tree)
static int tree_cmp(const void *key0, const void *key1)
#define M0_ALLOC_PTR(ptr)
static int btree_insert_inplace(struct m0_be_btree *t, struct m0_buf *k, int v, int nr_left)
M0_INTERNAL void m0_be_btree_cursor_prev(struct m0_be_btree_cursor *cur)
#define M0_BE_OP_SYNC_WITH(op, action)
void m0_be_ut_tx_init(struct m0_be_tx *tx, struct m0_be_ut_backend *ut_be)
M0_INTERNAL void m0_be_op_fini(struct m0_be_op *op)
static int start(struct m0_fom *fom)
void m0_be_ut_backend_fini(struct m0_be_ut_backend *ut_be)
M0_INTERNAL void m0_be_btree_init(struct m0_be_btree *tree, struct m0_be_seg *seg, const struct m0_be_btree_kv_ops *ops)
M0_INTERNAL void m0_be_btree_cursor_init(struct m0_be_btree_cursor *cur, struct m0_be_btree *btree)
static struct m0_be_seg * seg
M0_INTERNAL int m0_be_btree_cursor_get_sync(struct m0_be_btree_cursor *cur, const struct m0_buf *key, bool slant)
void m0_be_ut_btree_create_destroy(void)
static int btree_delete(struct m0_be_btree *t, struct m0_buf *k, int nr_left)
static int btree_save(struct m0_be_btree *tree, struct m0_buf *k, struct m0_buf *v, bool overwrite)
static struct m0_be_ut_seg * ut_seg
static void btree_save_test(struct m0_be_btree *tree)
M0_INTERNAL void m0_be_op_init(struct m0_be_op *op)
static struct m0_addb2_source * s
M0_INTERNAL int m0_be_btree_cursor_last_sync(struct m0_be_btree_cursor *cur)
#define M0_BUF_INIT(size, data)
static void destroy_tree(struct m0_be_btree *tree)
M0_INTERNAL void m0_be_btree_truncate(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op, m0_bcount_t limit)
static void shuffle_array(int a[], size_t n)
#define M0_BE_OP_SYNC_RET_WITH(op, action, member)
#define M0_BE_FREE_CREDIT_PTR(ptr, seg, accum)
M0_INTERNAL void m0_be_op_wait(struct m0_be_op *op)
static void cursor_test(struct m0_be_btree *tree)
M0_INTERNAL void m0_be_tx_close_sync(struct m0_be_tx *tx)