Motr  M0
ctg_store.h File Reference
#include "fop/fom_generic.h"
#include "fop/fom_long_lock.h"
#include "be/op.h"
#include "be/btree.h"
#include "be/btree_xc.h"
#include "be/tx_credit.h"
#include "format/format.h"
#include "cas/cas.h"
#include "motr/setup.h"
Include dependency graph for ctg_store.h:

Go to the source code of this file.

Data Structures

struct  m0_cas_ctg
 
struct  m0_cas_state
 
struct  m0_ctg_op
 

Macros

#define __MOTR_CAS_CTG_STORE_H__
 
#define CTG_OP_COMBINE(opc, ct)   (((uint64_t)(opc)) | ((ct) << 16))
 

Enumerations

enum  m0_cas_ctg_format_version { M0_CAS_CTG_FORMAT_VERSION_1 = 1, M0_CAS_CTG_FORMAT_VERSION_2, M0_CAS_CTG_FORMAT_VERSION = M0_CAS_CTG_FORMAT_VERSION_2 }
 
enum  m0_cas_state_format_version { M0_CAS_STATE_FORMAT_VERSION_1 = 1, M0_CAS_STATE_FORMAT_VERSION = M0_CAS_STATE_FORMAT_VERSION_1 }
 
enum  { M0_CAS_CTG_VAL_HDR_SIZE = sizeof(uint64_t) + sizeof(uint64_t), M0_CAS_CTG_KEY_HDR_SIZE = sizeof(uint64_t) }
 

Functions

struct m0_cas_ctg M0_XCA_DOMAIN (be)
 
M0_INTERNAL int m0_ctg_store_init (struct m0_be_domain *dom)
 
M0_INTERNAL void m0_ctg_store_fini (void)
 
M0_INTERNAL struct m0_cas_ctgm0_ctg_meta (void)
 
M0_INTERNAL struct m0_cas_ctgm0_ctg_dead_index (void)
 
M0_INTERNAL struct m0_cas_ctgm0_ctg_ctidx (void)
 
M0_INTERNAL void m0_ctg_op_init (struct m0_ctg_op *ctg_op, struct m0_fom *fom, uint32_t flags)
 
M0_INTERNAL int m0_ctg_op_rc (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL void m0_ctg_op_fini (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL int m0_ctg_meta_insert (struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
 
M0_INTERNAL int m0_ctg_gc_wait (struct m0_ctg_op *ctg_op, int next_phase)
 
M0_INTERNAL int m0_ctg_dead_index_insert (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
 
M0_INTERNAL int m0_ctg_meta_lookup (struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
 
M0_INTERNAL struct m0_cas_ctgm0_ctg_meta_lookup_result (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL int m0_ctg_meta_delete (struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
 
M0_INTERNAL int m0_ctg_insert (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, const struct m0_buf *val, int next_phase)
 
M0_INTERNAL int m0_ctg_lookup_delete (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, struct m0_buf *val, int flags, int next_phase)
 
M0_INTERNAL int m0_ctg_delete (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, int next_phase)
 
M0_INTERNAL int m0_ctg_lookup (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, const struct m0_buf *key, int next_phase)
 
M0_INTERNAL void m0_ctg_lookup_result (struct m0_ctg_op *ctg_op, struct m0_buf *buf)
 
M0_INTERNAL void m0_ctg_op_get_ver (struct m0_ctg_op *ctg_op, struct m0_crv *out)
 
M0_INTERNAL int m0_ctg_minkey (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
 
M0_INTERNAL int m0_ctg_truncate (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, m0_bcount_t limit, int next_phase)
 
M0_INTERNAL int m0_ctg_drop (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg, int next_phase)
 
M0_INTERNAL void m0_ctg_meta_cursor_init (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL int m0_ctg_meta_cursor_get (struct m0_ctg_op *ctg_op, const struct m0_fid *fid, int next_phase)
 
M0_INTERNAL int m0_ctg_meta_cursor_next (struct m0_ctg_op *ctg_op, int next_phase)
 
M0_INTERNAL void m0_ctg_cursor_init (struct m0_ctg_op *ctg_op, struct m0_cas_ctg *ctg)
 
M0_INTERNAL bool m0_ctg_cursor_is_initialised (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL int m0_ctg_cursor_get (struct m0_ctg_op *ctg_op, const struct m0_buf *key, int next_phase)
 
M0_INTERNAL int m0_ctg_cursor_next (struct m0_ctg_op *ctg_op, int next_phase)
 
M0_INTERNAL void m0_ctg_cursor_kv_get (struct m0_ctg_op *ctg_op, struct m0_buf *key, struct m0_buf *val)
 
M0_INTERNAL void m0_ctg_cursor_put (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL void m0_ctg_cursor_fini (struct m0_ctg_op *ctg_op)
 
M0_INTERNAL void m0_ctg_insert_credit (struct m0_cas_ctg *ctg, m0_bcount_t knob, m0_bcount_t vnob, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_ctg_delete_credit (struct m0_cas_ctg *ctg, m0_bcount_t knob, m0_bcount_t vnob, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_ctg_ctidx_insert_credits (struct m0_cas_id *cid, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_ctg_drop_credit (struct m0_fom *fom, struct m0_be_tx_credit *accum, struct m0_cas_ctg *ctg, m0_bcount_t *limit)
 
M0_INTERNAL void m0_ctg_try_init (struct m0_cas_ctg *ctg)
 
M0_INTERNAL void m0_ctg_fini (struct m0_fom *fom0, struct m0_cas_ctg *ctg)
 
M0_INTERNAL void m0_ctg_mark_deleted_credit (struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_ctg_create_credit (struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_ctg_dead_clean_credit (struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_ctg_ctidx_delete_credits (struct m0_cas_id *cid, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_ctg_ctidx_insert_sync (const struct m0_cas_id *cid, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_ctg_ctidx_delete_sync (const struct m0_cas_id *cid, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_ctg_ctidx_lookup_sync (const struct m0_fid *fid, struct m0_dix_layout **layout)
 
M0_INTERNAL int m0_ctg_mem_place (struct m0_ctg_op *ctg_op, const struct m0_buf *buf, int next_phase)
 
M0_INTERNAL void m0_ctg_mem_place_get (struct m0_ctg_op *ctg_op, struct m0_buf *buf)
 
M0_INTERNAL int m0_ctg_mem_free (struct m0_ctg_op *ctg_op, void *area, int next_phase)
 
M0_INTERNAL uint64_t m0_ctg_rec_nr (void)
 
M0_INTERNAL uint64_t m0_ctg_rec_size (void)
 
M0_INTERNAL struct m0_long_lockm0_ctg_del_lock (void)
 
M0_INTERNAL struct m0_long_lockm0_ctg_lock (struct m0_cas_ctg *ctg)
 
M0_INTERNAL int m0_ctg_create (struct m0_be_seg *seg, struct m0_be_tx *tx, struct m0_cas_ctg **out, const struct m0_fid *cas_fid)
 
M0_INTERNAL int m0_ctg__meta_insert (struct m0_be_btree *meta, const struct m0_fid *fid, struct m0_cas_ctg *ctg, struct m0_be_tx *tx)
 
M0_INTERNAL int m0_ctg_meta_find_ctg (struct m0_cas_ctg *meta, const struct m0_fid *ctg_fid, struct m0_cas_ctg **ctg)
 
M0_INTERNAL const struct m0_be_btree_kv_opsm0_ctg_btree_ops (void)
 
M0_INTERNAL void m0_ctg_state_inc_update (struct m0_be_tx *tx, uint64_t size)
 
M0_INTERNAL int ctgdump (struct m0_motr *motr_ctx, char *fidstr, char *dump_in_hex_str)
 

Variables

struct m0_format_header cc_head
 
struct m0_format_footer cc_foot
 
struct m0_be_btree cc_tree
 
struct m0_be_long_lock cc_lock
 
struct m0_be_chan cc_chan
 
struct m0_be_mutex cc_chan_guard
 
bool cc_inited
 
enum m0_cas_ctg_format_version M0_XCA_DOMAIN
 
struct m0_format_header cs_header
 
struct m0_cas_ctgcs_meta
 
uint64_t cs_rec_nr
 
uint64_t cs_rec_size
 
struct m0_format_footer cs_footer
 
struct m0_be_mutex cs_ctg_init_mutex
 

Macro Definition Documentation

◆ __MOTR_CAS_CTG_STORE_H__

#define __MOTR_CAS_CTG_STORE_H__

Definition at line 26 of file ctg_store.h.

Variable Documentation

◆ cc_chan

struct m0_be_chan cc_chan

Channel to announce catalogue modifications (put, delete).

Definition at line 123 of file ctg_store.h.

◆ cc_chan_guard

struct m0_be_mutex cc_chan_guard

Mutex protecting cc_chan.

Definition at line 125 of file ctg_store.h.

◆ cc_foot

struct m0_format_footer cc_foot

Definition at line 115 of file ctg_store.h.

◆ cc_head

struct m0_format_header cc_head

Definition at line 114 of file ctg_store.h.

◆ cc_inited

bool cc_inited

Definition at line 131 of file ctg_store.h.

◆ cc_lock

struct m0_be_long_lock cc_lock

Definition at line 121 of file ctg_store.h.

◆ cc_tree

struct m0_be_btree cc_tree

Definition at line 120 of file ctg_store.h.

◆ cs_ctg_init_mutex

struct m0_be_mutex cs_ctg_init_mutex

Mutex to protect m0_cas_ctg init after load.

Definition at line 137 of file ctg_store.h.

◆ cs_footer

struct m0_format_footer cs_footer

Definition at line 133 of file ctg_store.h.

◆ cs_header

struct m0_format_header cs_header

Definition at line 114 of file ctg_store.h.

◆ cs_meta

struct m0_cas_ctg* cs_meta

Pointer to descriptor of meta catalogue. Descriptor itself is allocated elsewhere. This pointer is there (not in m0_ctg_store) because m0_cas_state is saved in seg_dict.

Definition at line 120 of file ctg_store.h.

◆ cs_rec_nr

uint64_t cs_rec_nr

Total number of records in all catalogues in catalogue store. It's used by repair/re-balance services to report progress.

Definition at line 125 of file ctg_store.h.

◆ cs_rec_size

uint64_t cs_rec_size

Total size of all records in catalogue store. The value is incremented on every record insertion. On record deletion it's not decremented, because before record deletion the size of the value is unknown.

Definition at line 132 of file ctg_store.h.