29 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_BTREE 59 .ft_name =
"btree fid",
73 btree->bb_root = new_root;
82 struct m0_be_op__btree *tree;
86 tree = &
op->bo_u.u_btree;
93 tree->t_anchor = anchor;
151 return ops->ko_ksize(
key);
163 const void *
key0,
const void *key1)
166 return ops->ko_compare(
key0, key1);
170 const void *
key0,
const void *key1)
176 const void *
key0,
const void *key1)
182 const void *
key0,
const void *key1)
209 const void *
key,
bool slant);
242 const uint64_t *parent)
249 _0C(parent == cookie) &&
266 _0C(
node->bt_header.hd_magic != 0) &&
269 &
btree->bb_cookie_gen)) &&
272 sizeof node->bt_backlink) == 0) &&
297 node->bt_kv_arr[
i].btree_key))));
315 node->bt_child_arr[
i]->
319 node->bt_child_arr[
i+1]->
323 node->bt_child_arr[
i],
327 node->bt_child_arr[
i])))
341 &
btree->bb_cookie_gen));
350 if (
node->bt_num_active_key > 0) {
352 sizeof(*
node->bt_kv_arr) *
node->bt_num_active_key);
354 sizeof(*
node->bt_child_arr) *
355 (
node->bt_num_active_key + 1));
377 const struct m0_fid *btree_fid)
380 .ot_version = M0_BE_BTREE_FORMAT_VERSION,
381 .ot_type = M0_FORMAT_TYPE_BE_BTREE,
382 .ot_footer_offset = offsetof(struct m0_be_btree, bb_footer)
386 btree->bb_backlink.bli_gen =
btree->bb_seg->bs_gen;
387 btree->bb_backlink.bli_type =
btree->bb_ops->ko_type;
388 btree->bb_backlink.bli_fid = *btree_fid;
397 unsigned int num_active_key,
425 .ot_version = M0_BE_BNODE_FORMAT_VERSION,
426 .ot_type = M0_FORMAT_TYPE_BE_BNODE,
427 .ot_footer_offset = offsetof(struct m0_be_bnode, bt_footer)
448 node->bt_header.hd_magic = 0;
535 int i =
node->bt_num_active_key - 1;
537 while (!
node->bt_isleaf)
544 if (
node->bt_child_arr[
i]->bt_num_active_key ==
KV_NR) {
550 i =
node->bt_num_active_key - 1;
558 node->bt_kv_arr[
i + 1] = *kv;
559 node->bt_num_active_key++;
586 old_root =
btree->bb_root;
627 node->bt_num_active_key - 1 : 0;
650 unsigned int start_index,
651 unsigned int key_src_offset,
652 unsigned int key_dest_offset,
653 unsigned int child_src_offset,
654 unsigned int child_dest_offset,
655 unsigned int stop_index)
657 unsigned int i = start_index;
658 while (
i < stop_index)
660 dest->bt_kv_arr[
i + key_dest_offset] =
661 src->bt_kv_arr[
i + key_src_offset];
662 dest->bt_child_arr[
i + child_dest_offset ] =
663 src->bt_child_arr[
i + child_src_offset];
804 M0_ENTRY(
"n=%p i=%d dir=%d", parent, idx, pos);
846 if (
bnode->bt_isleaf) {
852 bnode->bt_kv_arr[idx] =
bnode->bt_kv_arr[idx+1];
868 bnode->bt_num_active_key--;
916 bool outerloop =
true;
935 if (
bnode->bt_num_active_key == 0) {
945 bnode->bt_kv_arr[iter].btree_key))
956 if (
bnode->bt_isleaf) {
971 }
else if (iter == 0) {
986 }
else if (leftsib &&
991 }
else if (leftsib &&
999 }
else if (righsib &&
1015 !!
bnode->bt_isleaf,
bnode->bt_num_active_key, idx);
1024 if (
bnode->bt_isleaf &&
1038 if (
bnode->bt_child_arr[idx]->bt_num_active_key >
1043 idx, &child,
false);
1045 }
else if (
bnode->bt_child_arr[idx + 1]->bt_num_active_key >
1072 se = &
it->bc_stack[
it->bc_stack_pos++];
1082 if (
it->bc_stack_pos > 0) {
1083 se = &
it->bc_stack[--
it->bc_stack_pos];
1109 it->bc_stack_pos = 0;
1129 if (
bnode->bt_isleaf) {
1163 if (!
head->bt_isleaf) {
1216 while (
node !=
NULL && limit > 0) {
1218 if (!
node->bt_isleaf) {
1220 i =
node->bt_num_active_key;
1223 if (!
node->bt_isleaf)
1226 while (
node->bt_num_active_key > 0 && limit > 0) {
1228 node->bt_num_active_key--;
1229 i =
node->bt_num_active_key;
1233 if (
node->bt_num_active_key > 0)
1246 if (parent !=
NULL) {
1269 if (parent ==
btree->bb_root &&
1324 if (
node.bnp_node->bt_num_active_key == 0)
1327 return node.bnp_node->bt_kv_arr[
node.bnp_index].btree_key;
1343 if (
node.bnp_node->bt_num_active_key == 0)
1346 return node.bnp_node->bt_kv_arr[0].btree_key;
1378 bool val_overflow =
false;
1402 if (anchor !=
NULL) {
1430 val_overflow =
true;
1449 (cur_kv ==
NULL || val_overflow)) {
1453 mem_alloc(tree, tx, ksz + vsz, zonemask);
1515 const struct m0_fid *btree_fid)
1646 ksize =
m0_align(ksize,
sizeof(
void*));
1679 bool use_current_height)
1684 if (use_current_height)
1815 while (
rc != -ENOENT) {
1817 if (
key.b_nob > *ksize)
1819 if (
val.b_nob > *vsize)
1849 nodes_nr, items_nr, (
int)ksize, (
int)vsize);
1877 nodes_nr, items_nr, (
int)ksize, (
int)vsize);
1881 *records_nr = items_nr;
1987 const struct m0_buf *key_in,
1997 M0_ENTRY(
"tree=%p key_in=%p key_out=%p value=%p",
1998 tree, key_in, key_out,
value);
2008 key_out ==
NULL ?
false :
true);
2013 if (vsize < value->
b_nob)
2014 value->b_nob = vsize;
2018 if (key_out !=
NULL) {
2020 if (ksize < key_out->
b_nob)
2021 key_out->
b_nob = ksize;
2212 for (
i = 0;
i <
node->bt_num_active_key; ++
i) {
2213 void *
key =
node->bt_kv_arr[
i].btree_key;
2214 void *
val =
node->bt_kv_arr[
i].btree_val;
2216 if (
node->bt_isleaf)
2218 (
char *)
key, (
char *)
val);
2223 if (!
node->bt_isleaf)
2233 unsigned int current_level;
2246 current_level =
node->bt_level;
2253 if (
head->bt_level < current_level) {
2254 current_level =
head->bt_level;
2261 if (!
head->bt_isleaf) {
2262 for (
i = 0;
i <
head->bt_num_active_key + 1;
i++) {
2263 child =
head->bt_child_arr[
i];
2264 tail->bt_next = child;
2287 cur->bc_stack_pos = 0;
2318 kv = &
cur->bc_node->bt_kv_arr[
cur->bc_pos];
2338 bo_u.u_btree.t_rc));
2343 const struct m0_buf kbuf =
2378 if (
node->bt_isleaf) {
2379 while (
node &&
cur->bc_pos >=
node->bt_num_active_key)
2386 if (
node->bt_isleaf)
2401 kv = &
node->bt_kv_arr[
cur->bc_pos];
2426 if (
node->bt_isleaf) {
2428 while (
node &&
cur->bc_pos < 0) {
2436 if (
node->bt_isleaf) {
2437 cur->bc_pos =
node->bt_num_active_key - 1;
2440 cur->bc_pos =
node->bt_num_active_key;
2454 kv = &
cur->bc_node->bt_kv_arr[
cur->bc_pos];
2513 return &
op->bo_u.u_btree;
2522 #undef M0_TRACE_SUBSYSTEM static void 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, bool use_current_height)
static void btree_node_update(struct m0_be_bnode *node, const struct m0_be_btree *btree, struct m0_be_tx *tx)
static bool btree_backlink_invariant(const struct m0_be_btree_backlink *h, const struct m0_be_seg *seg, const uint64_t *parent)
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)
static void ptr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
M0_INTERNAL void m0_be_btree_cursor_next(struct m0_be_btree_cursor *cur)
static struct m0_addb2_philter p
static int key_gt(const struct m0_be_btree *btree, const void *key0, const void *key1)
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)
static int key_eq(const struct m0_be_btree *btree, const void *key0, const void *key1)
static bool btree_node_invariant(const struct m0_be_btree *btree, const struct m0_be_bnode *node, bool root)
static void be_btree_lookup(struct m0_be_btree *tree, struct m0_be_op *op, const struct m0_buf *key_in, struct m0_buf *key_out, struct m0_buf *value)
static void btree_truncate(struct m0_be_btree *btree, struct m0_be_tx *tx, m0_bcount_t limit)
struct be_btree_key_val bt_kv_arr[KV_NR]
static void * be_btree_get_min_key(struct m0_be_btree *tree)
static void be_btree_split_child(struct m0_be_btree *btree, struct m0_be_tx *tx, struct m0_be_bnode *parent, unsigned int index)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
M0_INTERNAL const struct m0_fid_type m0_btree_fid_type
M0_INTERNAL void m0_be_btree_clear_credit(struct m0_be_btree *tree, struct m0_be_tx_credit *fixed_part, struct m0_be_tx_credit *single_record, m0_bcount_t *records_nr)
union m0_be_rwlock::@198 bl_u
struct m0_be_bnode * bb_root
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)
struct m0_be_btree * ba_tree
static void be_btree_insert_into_nonfull(struct m0_be_btree *btree, struct m0_be_tx *tx, struct m0_be_bnode *node, struct be_btree_key_val *kv)
M0_INTERNAL void m0_be_btree_save_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, bool overwrite, uint64_t zonemask)
#define M0_LOG(level,...)
struct m0_be_bnode * bs_node
static void 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, struct m0_be_btree_anchor *anchor, enum btree_save_optype optype, uint64_t zonemask)
enum m0_trace_level level
static struct m0_be_allocator * tree_allocator(const struct m0_be_btree *btree)
struct m0_be_seg * bb_seg
static struct net_test_cmd_node * node
#define M0_BE_OP_SYNC(op_obj, action)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
M0_INTERNAL void m0_rwlock_write_lock(struct m0_rwlock *lock)
static m0_bcount_t be_btree_vsize(const struct m0_be_btree *btree, const void *data)
static void btree_pair_release(struct m0_be_btree *btree, struct m0_be_tx *tx, struct be_btree_key_val *kv)
int const char const void * value
static void btree_rebalance_credit(const struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
M0_INTERNAL uint8_t m0_fid_tget(const struct m0_fid *fid)
static struct m0_be_emap_cursor it
#define M0_BE_TX_CAPTURE_PTR(seg, tx, ptr)
static void be_btree_move_parent_key(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_bnode *node, enum position_t pos, unsigned int index)
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_node_child_delete(struct m0_be_btree *btree, struct m0_be_tx *tx, struct m0_be_bnode *node, unsigned index, struct btree_node_pos *child, bool left)
struct m0_be_bnode * bnp_node
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)
#define M0_BE_TX_CREDIT_TYPE(type)
M0_INTERNAL void m0_be_alloc_aligned(struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void **ptr, m0_bcount_t size, unsigned shift, uint64_t zonemask)
M0_INTERNAL void m0_be_btree_destroy_credit(struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
#define M0_BE_CREDIT_DEC(cr_user, tx)
#define M0_BE_REG(seg, size, addr)
M0_INTERNAL void m0_be_btree_cursor_put(struct m0_be_btree_cursor *cursor)
static struct be_btree_key_val * be_btree_search(struct m0_be_btree *btree, void *key)
static struct m0_be_op__btree * op_tree(struct m0_be_op *op)
static void be_btree_shift_key_vals(struct m0_be_bnode *dest, struct m0_be_bnode *src, unsigned int start_index, unsigned int key_src_offset, unsigned int key_dest_offset, unsigned int child_src_offset, unsigned int child_dest_offset, unsigned int stop_index)
static int iter_prepare(struct m0_be_bnode *node, bool print)
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)
M0_INTERNAL void m0_rwlock_init(struct m0_rwlock *lock)
static void be_btree_destroy(struct m0_be_btree *btree, struct m0_be_tx *tx)
static int key_lt(const struct m0_be_btree *btree, const void *key0, const void *key1)
M0_INTERNAL int m0_be_btree_cursor_next_sync(struct m0_be_btree_cursor *cur)
static int head(struct m0_sm *mach)
static int btree(struct scanner *s, struct rectype *r, char *buf)
#define M0_BE_TX_CREDIT(nr, size)
static int btree_cursor_seek(struct m0_be_btree_cursor *cur, void *key)
struct m0_be_bnode * bc_node
static M0_UNUSED void print(struct m0_be_list *list)
static void btree_credit(const struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
struct m0_conf_root * root
static void print_single_node(struct m0_be_bnode *node)
static void btree_node_free(struct m0_be_bnode *node, const struct m0_be_btree *btree, struct m0_be_tx *tx)
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)
struct be_btree_key_val bt_kv_arr[KV_NR]
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)
struct m0_be_bnode * bt_child_arr[KV_NR+1]
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)
static void be_btree_delete_key_from_node(struct m0_be_btree *tree, struct m0_be_tx *tx, struct btree_node_pos *node_pos)
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)
static void btree_create(struct m0_be_btree *btree, struct m0_be_tx *tx, const struct m0_fid *btree_fid)
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)
static void btree_root_set(struct m0_be_btree *btree, struct m0_be_bnode *new_root)
M0_INTERNAL void m0_be_tx_credit_mac(struct m0_be_tx_credit *c, const struct m0_be_tx_credit *c1, m0_bcount_t k)
M0_INTERNAL void m0_be_btree_update_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)
M0_INTERNAL void m0_be_btree_destroy(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op)
struct m0_cookie bli_tree
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)
M0_INTERNAL void m0_be_tx_credit_mul(struct m0_be_tx_credit *c, m0_bcount_t k)
struct m0_be_bnode * bt_child_arr[KV_NR+1]
M0_INTERNAL struct m0_be_allocator * m0_be_seg_allocator(struct m0_be_seg *seg)
static struct m0_be_bnode * node_pop(struct m0_be_btree_cursor *it, int *idx)
M0_INTERNAL void m0_be_tx_credit_add(struct m0_be_tx_credit *c0, const struct m0_be_tx_credit *c1)
static int be_btree_delete_key(struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_bnode *bnode, void *key)
M0_INTERNAL int m0_be_btree_cursor_prev_sync(struct m0_be_btree_cursor *cur)
static bool btree_invariant(const struct m0_be_btree *btree)
static void kv_delete_credit(const struct m0_be_btree *tree, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
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)
static struct m0_rwlock * btree_rwlock(struct m0_be_btree *tree)
M0_INTERNAL void m0_cookie_init(struct m0_cookie *cookie, const uint64_t *obj)
static void 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)
M0_INTERNAL void m0_be_op_done(struct m0_be_op *op)
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 void m0_rwlock_write_unlock(struct m0_rwlock *lock)
M0_INTERNAL int m0_be_btree_cursor_first_sync(struct m0_be_btree_cursor *cur)
static void * be_btree_get_max_key(struct m0_be_btree *tree)
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
static bool btree_node_subtree_invariant(const struct m0_be_btree *btree, const struct m0_be_bnode *node)
static void btree_mem_free_credit(const struct m0_be_btree *btree, m0_bcount_t size, struct m0_be_tx_credit *accum)
static void be_btree_get_max_key_pos(struct m0_be_bnode *node, struct btree_node_pos *pos)
M0_INTERNAL bool m0_be_seg_contains(const struct m0_be_seg *seg, const void *addr)
struct m0_be_bnode * bt_next
static void btree_op_fill(struct m0_be_op *op, struct m0_be_btree *btree, struct m0_be_tx *tx, enum m0_be_btree_op optype, struct m0_be_btree_anchor *anchor)
static void node_push(struct m0_be_btree_cursor *it, struct m0_be_bnode *node, int idx)
M0_INTERNAL void m0_be_btree_cursor_kv_get(struct m0_be_btree_cursor *cur, struct m0_buf *key, struct m0_buf *val)
static int be_btree_compare(const struct m0_be_btree *btree, const void *key0, const void *key1)
static void btree_node_alloc_credit(const struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
#define m0_forall(var, nr,...)
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)
static void kv_insert_credit(const struct m0_be_btree *tree, m0_bcount_t ksize, m0_bcount_t vsize, struct m0_be_tx_credit *accum)
static void be_btree_move_parent_key_to_right_child(struct m0_be_bnode *parent, struct m0_be_bnode *lch, struct m0_be_bnode *rch, unsigned int idx)
struct m0_be_btree * bc_tree
M0_INTERNAL void m0_be_btree_lookup_slant(struct m0_be_btree *tree, struct m0_be_op *op, struct m0_buf *key, struct m0_buf *value)
static struct m0_be_bnode * be_btree_merge_siblings(struct m0_be_tx *tx, struct m0_be_btree *tree, struct m0_be_bnode *parent, unsigned int idx)
static void be_btree_insert_newkey(struct m0_be_btree *btree, struct m0_be_tx *tx, struct be_btree_key_val *kv)
M0_INTERNAL void m0_be_op_active(struct m0_be_op *op)
static void btree_node_keyval_update(struct m0_be_bnode *node, const struct m0_be_btree *btree, struct m0_be_tx *tx, unsigned int index)
#define M0_FI_ENABLED(tag)
static struct btree_node_pos be_btree_get_btree_node(struct m0_be_btree_cursor *it, const void *key, bool slant)
M0_INTERNAL void m0_be_btree_cursor_get(struct m0_be_btree_cursor *cur, const struct m0_buf *key, bool slant)
struct m0_be_rwlock bb_lock
M0_INTERNAL void m0_be_btree_cursor_prev(struct m0_be_btree_cursor *cur)
#define M0_BE_OP_SYNC_WITH(op, action)
static void * mem_alloc(const struct m0_be_btree *btree, struct m0_be_tx *tx, m0_bcount_t size, uint64_t zonemask)
struct m0_format_header bb_header
M0_INTERNAL void m0_cookie_new(uint64_t *gen)
static int start(struct m0_fom *fom)
static void mem_update(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr, m0_bcount_t size)
M0_INTERNAL void m0_rwlock_read_lock(struct m0_rwlock *lock)
M0_INTERNAL void m0_be_free_aligned(struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void *ptr)
M0_INTERNAL void m0_rwlock_fini(struct m0_rwlock *lock)
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)
unsigned int bt_num_active_key
static int btree_count_items(struct m0_be_btree *tree, m0_bcount_t *ksize, m0_bcount_t *vsize)
static void be_btree_get_min_key_pos(struct m0_be_bnode *node, struct btree_node_pos *pos)
static struct m0_be_seg * seg
static void btree_mem_alloc_credit(const struct m0_be_btree *btree, m0_bcount_t size, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_be_btree_cursor_get_sync(struct m0_be_btree_cursor *cur, const struct m0_buf *key, bool slant)
M0_INTERNAL void m0_be_tx_capture(struct m0_be_tx *tx, const struct m0_be_reg *reg)
M0_INTERNAL void m0_rwlock_read_unlock(struct m0_rwlock *lock)
static void 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, struct m0_be_btree_anchor *anchor, uint64_t zonemask)
M0_INTERNAL void m0_be_allocator_credit(struct m0_be_allocator *a, enum m0_be_allocator_op optype, m0_bcount_t size, unsigned shift, struct m0_be_tx_credit *accum)
static void be_btree_set_node_params(struct m0_be_bnode *p_node, unsigned int num_active_key, unsigned int level, bool isleaf)
static void btree_node_split_child_credit(const struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_be_btree_cursor_last_sync(struct m0_be_btree_cursor *cur)
static void btree_node_update_credit(struct m0_be_tx_credit *accum, m0_bcount_t nr)
#define M0_BUF_INIT(size, data)
#define M0_BE_CREDIT_INC(n, cr_user, credit)
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)
struct m0_pdclust_src_addr src
static struct m0_be_bnode * be_btree_node_alloc(const struct m0_be_btree *btree, struct m0_be_tx *tx)
M0_INTERNAL bool m0_be_op_is_done(struct m0_be_op *op)
#define offsetof(typ, memb)
static uint64_t m0_align(uint64_t val, uint64_t alignment)
static m0_bcount_t be_btree_ksize(const struct m0_be_btree *btree, const void *key)
#define M0_BE_OP_SYNC_RET_WITH(op, action, member)
static int bnode(struct scanner *s, struct rectype *r, char *buf)
const struct m0_be_btree_kv_ops * bb_ops
static struct m0_addb2_frame_header last
static void be_btree_move_parent_key_to_left_child(struct m0_be_bnode *parent, struct m0_be_bnode *lch, struct m0_be_bnode *rch, unsigned int idx)
static int tail(struct m0_sm *mach)
unsigned int bt_num_active_key
M0_INTERNAL int m0_cookie_dereference(const struct m0_cookie *cookie, uint64_t **addr)
static void btree_node_free_credit(const struct m0_be_btree *tree, struct m0_be_tx_credit *accum)