Motr  M0
btree.h File Reference
#include "be/op.h"
#include "be/seg.h"
#include "be/seg_xc.h"
#include "format/format.h"
#include "format/format_xc.h"
#include "lib/buf.h"
#include "lib/cookie.h"
#include "lib/cookie_xc.h"
#include "fid/fid.h"
#include "fid/fid_xc.h"
Include dependency graph for btree.h:

Go to the source code of this file.

Data Structures

struct  m0_be_btree_backlink
 
struct  m0_be_btree
 
struct  m0_be_btree_kv_ops
 
struct  m0_be_btree_anchor
 
struct  m0_be_btree_cursor_stack_entry
 
struct  m0_be_btree_cursor
 

Macros

#define __MOTR_BE_BTREE_H__
 

Enumerations

enum  m0_be_btree_format_version { M0_BE_BTREE_FORMAT_VERSION_1 = 1, M0_BE_BTREE_FORMAT_VERSION = M0_BE_BTREE_FORMAT_VERSION_1 }
 
enum  m0_be_btree_type {
  M0_BBT_INVALID = 1, M0_BBT_BALLOC_GROUP_EXTENTS, M0_BBT_BALLOC_GROUP_DESC, M0_BBT_EMAP_EM_MAPPING,
  M0_BBT_CAS_CTG, M0_BBT_COB_NAMESPACE, M0_BBT_COB_OBJECT_INDEX, M0_BBT_COB_FILEATTR_BASIC,
  M0_BBT_COB_FILEATTR_EA, M0_BBT_COB_FILEATTR_OMG, M0_BBT_COB_BYTECOUNT, M0_BBT_CONFDB,
  M0_BBT_UT_KV_OPS, M0_BBT_NR
}
 
enum  m0_be_btree_op {
  M0_BBO_CREATE, M0_BBO_DESTROY, M0_BBO_INSERT, M0_BBO_DELETE,
  M0_BBO_UPDATE, M0_BBO_LOOKUP, M0_BBO_MAXKEY, M0_BBO_MINKEY,
  M0_BBO_CURSOR_GET, M0_BBO_CURSOR_NEXT, M0_BBO_CURSOR_PREV
}
 
enum  { BTREE_FAN_OUT = 128, BTREE_HEIGHT_MAX = 5 }
 

Functions

struct m0_be_allocator_call_stat M0_XCA_DOMAIN (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_fini (struct m0_be_btree *tree)
 
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 (struct m0_be_btree *tree, struct m0_be_tx *tx, struct m0_be_op *op)
 
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)
 
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_destroy_credit (struct m0_be_btree *tree, struct m0_be_tx_credit *accum)
 
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)
 
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_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 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)
 
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_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_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)
 
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_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)
 
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_lookup (struct m0_be_btree *tree, struct m0_be_op *op, const struct m0_buf *key, struct m0_buf *value)
 
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)
 
M0_INTERNAL void m0_be_btree_maxkey (struct m0_be_btree *tree, struct m0_be_op *op, struct m0_buf *out)
 
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_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_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)
 
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)
 
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_release (struct m0_be_tx *tx, struct m0_be_btree_anchor *anchor)
 
M0_INTERNAL void m0_be_btree_cursor_init (struct m0_be_btree_cursor *cur, struct m0_be_btree *btree)
 
M0_INTERNAL void m0_be_btree_cursor_fini (struct m0_be_btree_cursor *cursor)
 
M0_INTERNAL void m0_be_btree_cursor_get (struct m0_be_btree_cursor *cur, const struct m0_buf *key, bool slant)
 
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_btree_cursor_next (struct m0_be_btree_cursor *cur)
 
M0_INTERNAL int m0_be_btree_cursor_next_sync (struct m0_be_btree_cursor *cur)
 
M0_INTERNAL void m0_be_btree_cursor_prev (struct m0_be_btree_cursor *cur)
 
M0_INTERNAL int m0_be_btree_cursor_prev_sync (struct m0_be_btree_cursor *cur)
 
M0_INTERNAL int m0_be_btree_cursor_first_sync (struct m0_be_btree_cursor *cur)
 
M0_INTERNAL int m0_be_btree_cursor_last_sync (struct m0_be_btree_cursor *cur)
 
M0_INTERNAL void m0_be_btree_cursor_put (struct m0_be_btree_cursor *cursor)
 
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_be_btree_is_empty (struct m0_be_btree *tree)
 

Variables

struct m0_cookie bli_tree
 
uint64_t bli_type
 
uint64_t bli_gen
 
struct m0_fid bli_fid
 
struct m0_format_header bb_header
 
uint64_t bb_cookie_gen
 
struct m0_be_btree_backlink bb_backlink
 
struct m0_be_bnodebb_root
 
struct m0_format_footer bb_footer
 
struct m0_be_rwlock bb_lock
 
struct m0_be_segbb_seg
 
const struct m0_be_btree_kv_opsbb_ops
 
enum m0_be_btree_format_version M0_XCA_DOMAIN
 
enum m0_be_btree_type M0_XCA_ENUM
 
M0_EXTERN const struct m0_fid_type m0_btree_fid_type
 

Macro Definition Documentation

◆ __MOTR_BE_BTREE_H__

#define __MOTR_BE_BTREE_H__

Definition at line 24 of file btree.h.

Variable Documentation

◆ bb_backlink

struct m0_be_btree_backlink bb_backlink

Definition at line 60 of file btree.h.

◆ bb_cookie_gen

uint64_t bb_cookie_gen

Definition at line 59 of file btree.h.

◆ bb_footer

struct m0_format_footer bb_footer

Definition at line 63 of file btree.h.

◆ bb_header

struct m0_format_header bb_header

Definition at line 58 of file btree.h.

◆ bb_lock

struct m0_be_rwlock bb_lock

The lock to acquire when performing operations on the tree.

Definition at line 68 of file btree.h.

◆ bb_ops

const struct m0_be_btree_kv_ops* bb_ops

operation vector, treating keys and values, given by the user

Definition at line 72 of file btree.h.

◆ bb_root

struct m0_be_bnode* bb_root

Root node of the tree.

Definition at line 62 of file btree.h.

◆ bb_seg

struct m0_be_seg* bb_seg

The segment where we are stored.

Definition at line 70 of file btree.h.

◆ bli_fid

struct m0_fid bli_fid

Definition at line 58 of file btree.h.

◆ bli_gen

uint64_t bli_gen

Definition at line 57 of file btree.h.

◆ bli_tree

struct m0_cookie bli_tree

Definition at line 55 of file btree.h.

◆ bli_type

uint64_t bli_type

m0_be_btree_type

Definition at line 56 of file btree.h.