Motr
M0
|
Data Structures | |
struct | m0_dix_cli |
struct | m0_dix_cm_iter |
struct | dix_meta_val |
struct | m0_dix_imask |
struct | m0_dix_ldesc |
struct | m0_dix_capture_ldesc |
struct | m0_dix_composite_layer |
struct | m0_dix_composite_ldesc |
struct | m0_dix_layout |
struct | m0_dix_linst |
struct | m0_dix_layout_iter |
struct | m0_dix_meta_req |
struct | m0_dix |
struct | m0_dix_next_sort_ctx |
struct | m0_dix_next_sort_ctx_arr |
struct | m0_dix_next_results |
struct | m0_dix_next_resultset |
struct | m0_dix_req |
struct | m0_dix_get_reply |
struct | m0_dix_next_reply |
struct | m0_dix_item |
struct | m0_dix_cas_req |
struct | m0_dix_idxop_req |
struct | m0_dix_idxop_ctx |
struct | m0_dix_crop_attrs |
struct | m0_dix_cas_rop |
struct | m0_dix_pg_unit |
struct | m0_dix_rec_op |
struct | m0_dix_rop_ctx |
struct | dix_ctx |
Macros | |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | DIX_META_VAL_XCODE_OBJ(ptr) M0_XCODE_OBJ(dix_meta_val_xc, ptr) |
#define | DIX_LAYOUT_VAL_XCODE_OBJ(ptr) M0_XCODE_OBJ(m0_dix_layout_xc, ptr) |
#define | DIX_LDESC_VAL_XCODE_OBJ(ptr) M0_XCODE_OBJ(m0_dix_ldesc_xc, ptr) |
#define | DIX_FID_VAL_XCODE_OBJ(ptr) M0_XCODE_OBJ(m0_fid_xc, ptr) |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | AT(mask, idx) ((mask)->im_range[idx]) |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | DFID(x, y) M0_FID_TINIT('x', (x), (y)) |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | NOENT (-ENOENT) |
#define | PROCESSING_IS_DONE (-ENOKEY) |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
Functions | |
static struct m0_sm_group * | dix_cli_smgrp (const struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_lock (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_unlock (struct m0_dix_cli *cli) |
M0_INTERNAL bool | m0_dix_cli_is_locked (const struct m0_dix_cli *cli) |
static enum m0_dix_cli_state | dix_cli_state (const struct m0_dix_cli *cli) |
static void | dix_cli_failure (struct m0_dix_cli *cli, int32_t rc) |
static void | dix_cli_state_set (struct m0_dix_cli *cli, enum m0_dix_cli_state state) |
M0_INTERNAL int | m0_dix_cli_init (struct m0_dix_cli *cli, struct m0_sm_group *sm_group, struct m0_pools_common *pc, struct m0_layout_domain *ldom, const struct m0_fid *pver) |
static void | dix_cli_ast_post (struct m0_dix_cli *cli, void(*cb)(struct m0_sm_group *, struct m0_sm_ast *)) |
static void | dix_meta_read_ast_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
static bool | dix_cli_meta_read_clink_cb (struct m0_clink *cl) |
static void | dix_cli_start_ast_cb (struct m0_sm_group *grp M0_UNUSED, struct m0_sm_ast *ast) |
M0_INTERNAL void | m0_dix_cli_start (struct m0_dix_cli *cli) |
M0_INTERNAL int | m0_dix_cli_start_sync (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_bootstrap (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_bootstrap_lock (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_stop (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_stop_lock (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_fini (struct m0_dix_cli *cli) |
M0_INTERNAL void | m0_dix_cli_fini_lock (struct m0_dix_cli *cli) |
M0_INTERNAL int | m0_dix__root_set (const struct m0_dix_cli *cli, struct m0_dix *out) |
M0_INTERNAL int | m0_dix__layout_set (const struct m0_dix_cli *cli, struct m0_dix *out) |
M0_INTERNAL int | m0_dix__ldescr_set (const struct m0_dix_cli *cli, struct m0_dix *out) |
M0_INTERNAL struct m0_pool_version * | m0_dix_pver (const struct m0_dix_cli *cli, const struct m0_dix *dix) |
M0_INTERNAL void | m0_dix_cm_iter_type_register (struct m0_dix_cm_type *dcmt) |
M0_INTERNAL int | m0_dix_cm_iter_start (struct m0_dix_cm_iter *iter, struct m0_dix_cm_type *dcmt, struct m0_reqh *reqh, m0_bcount_t rpc_cutoff) |
M0_INTERNAL void | m0_dix_cm_iter_next (struct m0_dix_cm_iter *iter) |
M0_INTERNAL int | m0_dix_cm_iter_get (struct m0_dix_cm_iter *iter, struct m0_buf *key, struct m0_buf *val, uint32_t *sdev_id) |
M0_INTERNAL void | m0_dix_cm_iter_stop (struct m0_dix_cm_iter *iter) |
M0_INTERNAL void | m0_dix_cm_iter_cur_pos (struct m0_dix_cm_iter *iter, struct m0_fid *cctg_fid, uint64_t *cctg_proc_recs_nr) |
M0_INTERNAL void | m0_dix_cm_iter_processed_num (struct m0_dix_cm_iter *iter, uint64_t *proc_recs_nr) |
static int | dix_rebalance_sw_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh) |
M0_INTERNAL void | m0_dix_rebalance_sw_onwire_fop_init (void) |
M0_INTERNAL void | m0_dix_rebalance_sw_onwire_fop_fini (void) |
M0_INTERNAL int | m0_dix_rebalance_sw_onwire_fop_setup (struct m0_cm *cm, struct m0_fop *fop, void(*fop_release)(struct m0_ref *), uint64_t proxy_id, const char *local_ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval) |
static int | dix_repair_sw_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh) |
M0_INTERNAL void | m0_dix_repair_sw_onwire_fop_init (void) |
M0_INTERNAL void | m0_dix_repair_sw_onwire_fop_fini (void) |
M0_INTERNAL int | m0_dix_repair_sw_onwire_fop_setup (struct m0_cm *cm, struct m0_fop *fop, void(*fop_release)(struct m0_ref *), uint64_t proxy_id, const char *local_ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval) |
M0_INTERNAL int | m0_dix__meta_val_enc (const struct m0_fid *fid, const struct m0_dix_ldesc *dld, uint32_t nr, struct m0_bufvec *vals) |
M0_INTERNAL int | m0_dix__meta_val_dec (const struct m0_bufvec *vals, struct m0_fid *out_fid, struct m0_dix_ldesc *out_dld, uint32_t nr) |
M0_INTERNAL int | m0_dix__layout_vals_enc (const struct m0_fid *fid, const struct m0_dix_layout *dlay, uint32_t nr, struct m0_bufvec *keys, struct m0_bufvec *vals) |
M0_INTERNAL int | m0_dix__layout_vals_dec (const struct m0_bufvec *keys, const struct m0_bufvec *vals, struct m0_fid *out_fid, struct m0_dix_layout *out_dlay, uint32_t nr) |
M0_INTERNAL int | m0_dix__ldesc_vals_enc (const uint64_t *lid, const struct m0_dix_ldesc *ldesc, uint32_t nr, struct m0_bufvec *keys, struct m0_bufvec *vals) |
M0_INTERNAL int | m0_dix__ldesc_vals_dec (const struct m0_bufvec *keys, const struct m0_bufvec *vals, uint64_t *out_lid, struct m0_dix_ldesc *out_ldesc, uint32_t nr) |
M0_INTERNAL uint32_t | m0_dix_fid__device_id_extract (const struct m0_fid *fid) |
M0_INTERNAL void | m0_dix_fid_dix_make (struct m0_fid *dix_fid, uint32_t container, uint64_t key) |
M0_INTERNAL void | m0_dix_fid_convert_dix2cctg (const struct m0_fid *dix_fid, struct m0_fid *cctg_fid, uint32_t device_id) |
M0_INTERNAL void | m0_dix_fid_convert_cctg2dix (const struct m0_fid *cctg_fid, struct m0_fid *dix_fid) |
M0_INTERNAL uint32_t | m0_dix_fid_cctg_device_id (const struct m0_fid *cctg_fid) |
M0_INTERNAL bool | m0_dix_fid_validate_dix (const struct m0_fid *dix_fid) |
M0_INTERNAL bool | m0_dix_fid_validate_cctg (const struct m0_fid *cctg_fid) |
static m0_bcount_t | range_size (const struct m0_ext *range) |
static m0_bcount_t | range_actual_size (const struct m0_ext *range, uint64_t bs_len) |
static int | dix_imask_range_alloc (struct m0_dix_imask *mask, uint64_t nr) |
static void | dix_imask_range_free (struct m0_dix_imask *mask) |
static uint64_t | ranges_size (struct m0_ext *range, uint64_t nr, uint64_t bs_len) |
static uint64_t | imask_size (struct m0_dix_imask *mask, uint64_t bs_len) |
M0_INTERNAL int | m0_dix_imask_init (struct m0_dix_imask *mask, struct m0_ext *range, uint64_t nr) |
M0_INTERNAL void | m0_dix_imask_fini (struct m0_dix_imask *mask) |
static void | mask_bit_copy (void *buffer, m0_bcount_t pos, void *res, m0_bcount_t respos) |
M0_INTERNAL bool | m0_dix_imask_is_empty (const struct m0_dix_imask *mask) |
M0_INTERNAL int | m0_dix_imask_apply (void *buffer, m0_bcount_t buf_len_bytes, struct m0_dix_imask *mask, void **res, m0_bcount_t *res_len_bits) |
M0_INTERNAL int | m0_dix_imask_copy (struct m0_dix_imask *dst, const struct m0_dix_imask *src) |
M0_INTERNAL bool | m0_dix_imask_eq (const struct m0_dix_imask *imask1, const struct m0_dix_imask *imask2) |
struct m0_dix_imask | M0_XCA_DOMAIN (rpc) |
static int | layout_create (struct m0_layout_domain *domain, const struct m0_fid *fid, uint64_t layout_id, struct m0_pool_version *pver, struct m0_dix_linst *dli) |
M0_INTERNAL uint32_t | m0_dix_devices_nr (struct m0_dix_linst *linst) |
M0_INTERNAL struct m0_pooldev * | m0_dix_tgt2sdev (struct m0_dix_linst *linst, uint64_t tgt) |
M0_INTERNAL int | m0_dix_layout_init (struct m0_dix_linst *dli, struct m0_layout_domain *domain, const struct m0_fid *fid, uint64_t layout_id, struct m0_pool_version *pver, struct m0_dix_ldesc *dld) |
M0_INTERNAL void | m0_dix_layout_fini (struct m0_dix_linst *li) |
static void | dix_hash (struct m0_dix_ldesc *ldesc, struct m0_buf *buf, uint64_t *hash) |
static bool | unit_is_valid (struct m0_pdclust_attr *attr, uint64_t unit) |
M0_INTERNAL void | m0_dix_target (struct m0_dix_linst *inst, uint64_t unit, struct m0_buf *key, uint64_t *out_id) |
M0_INTERNAL int | m0_dix_ldesc_init (struct m0_dix_ldesc *ld, struct m0_ext *range, m0_bcount_t range_nr, enum m0_dix_hash_fnc_type htype, struct m0_fid *pver) |
M0_INTERNAL int | m0_dix_ldesc_copy (struct m0_dix_ldesc *dst, const struct m0_dix_ldesc *src) |
M0_INTERNAL void | m0_dix_ldesc_fini (struct m0_dix_ldesc *ld) |
M0_INTERNAL int | m0_dix_layout_iter_init (struct m0_dix_layout_iter *iter, const struct m0_fid *index, struct m0_layout_domain *ldom, struct m0_pool_version *pver, struct m0_dix_ldesc *ldesc, struct m0_buf *key) |
M0_INTERNAL void | m0_dix_layout_iter_next (struct m0_dix_layout_iter *iter, uint64_t *tgt) |
M0_INTERNAL void | m0_dix_layout_iter_get_at (struct m0_dix_layout_iter *iter, uint64_t unit, uint64_t *tgt) |
M0_INTERNAL uint32_t | m0_dix_liter_W (struct m0_dix_layout_iter *iter) |
M0_INTERNAL uint32_t | m0_dix_liter_N (struct m0_dix_layout_iter *iter) |
M0_INTERNAL uint32_t | m0_dix_liter_P (struct m0_dix_layout_iter *iter) |
M0_INTERNAL uint32_t | m0_dix_liter_K (struct m0_dix_layout_iter *iter) |
M0_INTERNAL uint32_t | m0_dix_liter_S (struct m0_dix_layout_iter *iter) |
M0_INTERNAL uint32_t | m0_dix_liter_spare_offset (struct m0_dix_layout_iter *iter) |
M0_INTERNAL uint32_t | m0_dix_liter_unit_classify (struct m0_dix_layout_iter *iter, uint64_t unit) |
M0_INTERNAL void | m0_dix_layout_iter_goto (struct m0_dix_layout_iter *iter, uint64_t unit) |
M0_INTERNAL void | m0_dix_layout_iter_reset (struct m0_dix_layout_iter *iter) |
M0_INTERNAL void | m0_dix_layout_iter_fini (struct m0_dix_layout_iter *iter) |
M0_INTERNAL bool | m0_dix_layout_eq (const struct m0_dix_layout *layout1, const struct m0_dix_layout *layout2) |
static struct m0_dix_cli * | meta_req_cli (const struct m0_dix_meta_req *req) |
static int | dix_mreq_rc (const struct m0_dix_req *req) |
static int | dix_root_add (struct m0_bufvec *keys, struct m0_bufvec *vals, uint32_t idx, const char *iname, const struct m0_fid *ifid, const struct m0_dix_ldesc *idesc) |
static int | dix_root_put (struct m0_dix_cli *cli, struct m0_sm_group *grp, const struct m0_dix_ldesc *dld_layout, const struct m0_dix_ldesc *dld_ldescr) |
static void | dix_meta_indices_fini (struct m0_dix *meta) |
static int | dix_meta_indices_init (struct m0_dix *indices, struct m0_dix_cli *cli, struct m0_dix_ldesc *dld_layout, struct m0_dix_ldesc *dld_ldescr) |
static int | dix_meta_create (struct m0_dix_cli *cli, struct m0_sm_group *grp, struct m0_dix_ldesc *dld_layout, struct m0_dix_ldesc *dld_ldescr) |
static int | dix_meta_delete (struct m0_dix_cli *cli, struct m0_sm_group *grp, struct m0_dix_ldesc *dld_layout, struct m0_dix_ldesc *dld_ldescr) |
static bool | dix_meta_op_done_cb (struct m0_clink *clink) |
M0_INTERNAL void | m0_dix_meta_req_init (struct m0_dix_meta_req *req, struct m0_dix_cli *cli, struct m0_sm_group *grp) |
static void | dix_meta_req_fini (struct m0_dix_meta_req *req) |
M0_INTERNAL void | m0_dix_meta_req_fini (struct m0_dix_meta_req *req) |
M0_INTERNAL void | m0_dix_meta_req_fini_lock (struct m0_dix_meta_req *req) |
M0_INTERNAL void | m0_dix_meta_lock (struct m0_dix_meta_req *req) |
M0_INTERNAL void | m0_dix_meta_unlock (struct m0_dix_meta_req *req) |
M0_INTERNAL int | m0_dix_meta_generic_rc (const struct m0_dix_meta_req *req) |
M0_INTERNAL int | m0_dix_meta_item_rc (const struct m0_dix_meta_req *req, uint64_t idx) |
M0_INTERNAL int | m0_dix_meta_req_nr (const struct m0_dix_meta_req *req) |
M0_INTERNAL int | m0_dix_meta_create (struct m0_dix_cli *cli, struct m0_sm_group *grp, struct m0_dix_ldesc *dld_layout, struct m0_dix_ldesc *dld_ldescr) |
M0_INTERNAL int | m0_dix_meta_check (struct m0_dix_cli *cli, struct m0_sm_group *grp, bool *result) |
M0_INTERNAL int | m0_dix_root_read (struct m0_dix_meta_req *req) |
static int | dix_layout_from_read_rep (struct m0_dix_meta_req *req, uint64_t idx, const struct m0_fid *expected, struct m0_dix_ldesc *out) |
M0_INTERNAL int | m0_dix_root_read_rep (struct m0_dix_meta_req *req, struct m0_dix_ldesc *layout, struct m0_dix_ldesc *ldescr) |
M0_INTERNAL int | m0_dix_meta_destroy (struct m0_dix_cli *cli, struct m0_sm_group *grp) |
M0_INTERNAL int | m0_dix_ldescr_put (struct m0_dix_meta_req *req, const uint64_t *lid, const struct m0_dix_ldesc *ldesc, uint32_t nr) |
M0_INTERNAL int | m0_dix_ldescr_get (struct m0_dix_meta_req *req, const uint64_t *lid, uint32_t nr) |
M0_INTERNAL int | m0_dix_ldescr_rep_get (struct m0_dix_meta_req *req, uint64_t idx, struct m0_dix_ldesc *ldesc) |
M0_INTERNAL int | m0_dix_ldescr_del (struct m0_dix_meta_req *req, const uint64_t *lid, uint32_t nr) |
M0_INTERNAL int | m0_dix_layout_put (struct m0_dix_meta_req *req, const struct m0_fid *fid, const struct m0_dix_layout *dlay, uint32_t nr, uint32_t flags) |
M0_INTERNAL int | m0_dix_layout_del (struct m0_dix_meta_req *req, const struct m0_fid *fid, uint32_t nr) |
M0_INTERNAL int | m0_dix_layout_get (struct m0_dix_meta_req *req, const struct m0_fid *fid, uint32_t nr) |
M0_INTERNAL int | m0_dix_layout_rep_get (struct m0_dix_meta_req *req, uint64_t idx, struct m0_dix_layout *dlay) |
M0_INTERNAL int | m0_dix_index_list (struct m0_dix_meta_req *req, const struct m0_fid *start_fid, uint32_t indices_nr) |
M0_INTERNAL int | m0_dix_index_list_rep_nr (struct m0_dix_meta_req *req) |
M0_INTERNAL int | m0_dix_index_list_rep (struct m0_dix_meta_req *req, uint32_t idx, struct m0_fid *fid) |
static void | sc_result_add (struct m0_dix_next_sort_ctx *key_ctx, uint32_t cidx, struct m0_dix_next_resultset *rs, uint32_t key_id, struct m0_cas_next_reply *rep) |
static int | sc_rep_cmp (const struct m0_cas_next_reply *a, const struct m0_cas_next_reply *b) |
static bool | sc_rep_le (const struct m0_cas_next_reply *a, const struct m0_cas_next_reply *b) |
static bool | sc_rep_eq (const struct m0_cas_next_reply *a, const struct m0_cas_next_reply *b) |
static void | sc_next (struct m0_dix_next_sort_ctx *ctx) |
static int | sc_rep_get (struct m0_dix_next_sort_ctx *ctx, struct m0_cas_next_reply **rep) |
static int | sc_key_pos_set (struct m0_dix_next_sort_ctx *ctx, uint32_t key_idx, const uint32_t *recs_nr) |
static bool | sc_min_val_get (struct m0_dix_next_sort_ctx_arr *ctxarr, struct m0_cas_next_reply **rep, struct m0_dix_next_sort_ctx **ret_ctx, uint32_t *ret_idx) |
static int | dix_rs_vals_alloc (struct m0_dix_next_resultset *rs, uint32_t key_idx, uint32_t nr) |
static int | dix_data_load (struct m0_dix_req *req, struct m0_dix_next_resultset *rs) |
M0_INTERNAL int | m0_dix_next_result_prepare (struct m0_dix_req *req) |
static int | sc_init (struct m0_dix_next_sort_ctx_arr *ctx_arr, uint32_t nr) |
static void | sc_fini (struct m0_dix_next_sort_ctx_arr *ctx_arr) |
M0_INTERNAL int | m0_dix_rs_init (struct m0_dix_next_resultset *rs, uint32_t start_keys_nr, uint32_t sctx_nr) |
M0_INTERNAL void | m0_dix_rs_fini (struct m0_dix_next_resultset *rs) |
M0_TL_DESCR_DEFINE (cas_rop, "cas record operations", M0_INTERNAL, struct m0_dix_cas_rop, crp_linkage, crp_magix, M0_DIX_ROP_MAGIC, M0_DIX_ROP_HEAD_MAGIC) | |
M0_TL_DEFINE (cas_rop, M0_INTERNAL, struct m0_dix_cas_rop) | |
static void | dix_idxop (struct m0_dix_req *req) |
static void | dix_rop (struct m0_dix_req *req) |
static void | dix_rop_units_set (struct m0_dix_req *req) |
static int | dix_cas_rops_alloc (struct m0_dix_req *req) |
static int | dix_cas_rops_fill (struct m0_dix_req *req) |
static int | dix_cas_rops_send (struct m0_dix_req *req) |
static void | dix_ldescr_resolve (struct m0_dix_req *req) |
static void | dix_discovery_completed (struct m0_dix_req *req) |
static int | dix_idxop_reqs_send (struct m0_dix_req *req) |
static void | dix_discovery (struct m0_dix_req *req) |
static int | dix_id_layouts_nr (struct m0_dix_req *req) |
static int | dix_unknown_layouts_nr (struct m0_dix_req *req) |
static uint32_t | dix_rop_tgt_iter_max (struct m0_dix_req *req, struct m0_dix_rec_op *rec_op) |
static bool | dix_req_is_idxop (const struct m0_dix_req *req) |
static struct m0_sm_group * | dix_req_smgrp (const struct m0_dix_req *req) |
static void | dix_to_cas_map (const struct m0_dix_req *dreq, const struct m0_cas_req *creq) |
M0_INTERNAL void | m0_dix_req_lock (struct m0_dix_req *req) |
M0_INTERNAL void | m0_dix_req_unlock (struct m0_dix_req *req) |
M0_INTERNAL bool | m0_dix_req_is_locked (const struct m0_dix_req *req) |
M0_INTERNAL int | m0_dix_req_wait (struct m0_dix_req *req, uint64_t states, m0_time_t to) |
static void | dix_req_init (struct m0_dix_req *req, struct m0_dix_cli *cli, struct m0_sm_group *grp, bool meta) |
M0_INTERNAL void | m0_dix_mreq_init (struct m0_dix_req *req, struct m0_dix_cli *cli, struct m0_sm_group *grp) |
M0_INTERNAL void | m0_dix_req_init (struct m0_dix_req *req, struct m0_dix_cli *cli, struct m0_sm_group *grp) |
static enum m0_dix_req_state | dix_req_state (const struct m0_dix_req *req) |
static void | dix_req_state_set (struct m0_dix_req *req, enum m0_dix_req_state state) |
static void | dix_req_failure (struct m0_dix_req *req, int32_t rc) |
static int | dix_type_layouts_nr (struct m0_dix_req *req, enum dix_layout_type type) |
static int | dix_resolved_nr (struct m0_dix_req *req) |
static void | dix_to_mdix_map (const struct m0_dix_req *req, const struct m0_dix_meta_req *mreq) |
static void | dix_layout_find_ast_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
static bool | dix_layout_find_clink_cb (struct m0_clink *cl) |
static void | dix_layout_find (struct m0_dix_req *req) |
static int | dix_indices_copy (struct m0_dix **dst_indices, const struct m0_dix *src_indices, uint32_t indices_nr) |
static int | dix_req_indices_copy (struct m0_dix_req *req, const struct m0_dix *indices, uint32_t indices_nr) |
static struct m0_pool_version * | dix_pver_find (const struct m0_dix_req *req, const struct m0_fid *pver_fid) |
static void | dix_idxop_ctx_free (struct m0_dix_idxop_ctx *idxop) |
static void | dix_idxop_item_rc_update (struct m0_dix_item *ditem, struct m0_dix_req *req, const struct m0_dix_cas_req *creq) |
static void | dix_idxop_completed (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
static bool | dix_idxop_clink_cb (struct m0_clink *cl) |
static int | dix_idxop_pver_analyse (struct m0_dix_idxop_req *idxop_req, struct m0_dix_req *dreq, uint64_t *creqs_nr) |
static int | dix_idxop_req_send (struct m0_dix_idxop_req *idxop_req, struct m0_dix_req *dreq, uint64_t *reqs_acc) |
static void | dix_idxop_meta_update_ast_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
static bool | dix_idxop_meta_update_clink_cb (struct m0_clink *cl) |
static int | dix_idxop_meta_update (struct m0_dix_req *req) |
static bool | dix_item_should_be_sent (const struct m0_dix_req *req, uint32_t i) |
M0_INTERNAL int | m0_dix_create (struct m0_dix_req *req, const struct m0_dix *indices, uint32_t indices_nr, struct m0_dtx *dtx, uint32_t flags) |
static void | addb2_add_dix_req_attrs (const struct m0_dix_req *req) |
static void | dix_discovery_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
void | m0_dix_req_cancel (struct m0_dix_req *dreq) |
M0_INTERNAL int | m0_dix_delete (struct m0_dix_req *req, const struct m0_dix *indices, uint64_t indices_nr, struct m0_dtx *dtx, uint32_t flags) |
M0_INTERNAL int | m0_dix_cctgs_lookup (struct m0_dix_req *req, const struct m0_dix *indices, uint32_t indices_nr) |
static int | dix_rec_op_init (struct m0_dix_rec_op *rec_op, struct m0_dix_req *req, struct m0_dix_cli *cli, struct m0_pool_version *pver, struct m0_dix *dix, struct m0_buf *key, uint64_t user_item) |
static void | dix_rec_op_fini (struct m0_dix_rec_op *rec_op) |
static int | dix_cas_rop_alloc (struct m0_dix_req *req, uint32_t sdev, struct m0_dix_cas_rop **cas_rop) |
static void | dix_cas_rop_fini (struct m0_dix_cas_rop *cas_rop) |
static void | dix_cas_rops_fini (struct m0_tl *cas_rops) |
static int | dix_rop_ctx_init (struct m0_dix_req *req, struct m0_dix_rop_ctx *rop, const struct m0_bufvec *keys, uint64_t *indices) |
static void | dix_rop_ctx_fini (struct m0_dix_rop_ctx *rop) |
static void | dix__rop (struct m0_dix_req *req, const struct m0_bufvec *keys, uint64_t *indices) |
static void | dix_item_rc_update (struct m0_dix_req *req, struct m0_cas_req *creq, uint64_t key_idx, struct m0_dix_item *ditem) |
static bool | dix_item_get_has_failed (struct m0_dix_item *item) |
static bool | dix_item_parity_unit_is_last (const struct m0_dix_req *req, const struct m0_dix_item *item) |
static void | dix_get_req_resend (struct m0_dix_req *req) |
static bool | dix_del_phase2_is_needed (const struct m0_dix_rec_op *rec_op) |
static int | dix_rop_del_phase2_rop (struct m0_dix_req *req, struct m0_dix_rop_ctx **out) |
static void | dix_rop_del_phase2 (struct m0_dix_req *req) |
static void | dix_cas_rop_rc_update (struct m0_dix_cas_rop *cas_rop, int rc) |
static void | dix_rop_completed (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
static void | dix_rop_one_completed (struct m0_dix_cas_rop *crop) |
static bool | dix_cas_rop_clink_cb (struct m0_clink *cl) |
static void | dix_rop_tgt_iter_begin (const struct m0_dix_req *req, struct m0_dix_rec_op *rec_op) |
static void | dix_rop_tgt_iter_next (const struct m0_dix_req *req, struct m0_dix_rec_op *rec_op, uint64_t *target, bool *is_spare) |
static int | dix_spare_slot_find (struct m0_poolmach_state *pm_state, uint64_t failed_tgt, uint32_t *spare_slot) |
static struct m0_pool_version * | dix_rec_op_pver (struct m0_dix_rec_op *rec_op) |
static uint32_t | dix_rop_max_failures (struct m0_dix_rop_ctx *rop) |
static uint32_t | dix_rec_op_spare_offset (struct m0_dix_rec_op *rec_op) |
static int | dix__spare_target (struct m0_dix_rec_op *rec_op, const struct m0_dix_pg_unit *failed_unit, uint32_t *spare_slot, struct m0_dix_pg_unit **spare_unit, bool with_data) |
static int | dix_spare_target (struct m0_dix_rec_op *rec_op, const struct m0_dix_pg_unit *failed_unit, uint32_t *spare_slot, struct m0_dix_pg_unit **spare_unit) |
static int | dix_spare_target_with_data (struct m0_dix_rec_op *rec_op, const struct m0_dix_pg_unit *failed_unit, uint32_t *spare_slot, struct m0_dix_pg_unit **spare_unit) |
static void | dix_online_unit_choose (struct m0_dix_req *req, struct m0_dix_rec_op *rec_op) |
static void | dix_pg_unit_pd_assign (struct m0_dix_pg_unit *pgu, struct m0_pooldev *pd) |
static void | dix_rop_failed_unit_tgt (struct m0_dix_req *req, struct m0_dix_rec_op *rec_op, uint64_t unit) |
static void | dix_rop_failures_analyse (struct m0_dix_req *req) |
static bool | dix_pg_unit_skip (struct m0_dix_req *req, struct m0_dix_pg_unit *unit) |
M0_INTERNAL int | m0_dix_put (struct m0_dix_req *req, const struct m0_dix *index, const struct m0_bufvec *keys, const struct m0_bufvec *vals, struct m0_dtx *dtx, uint32_t flags) |
M0_INTERNAL int | m0_dix_get (struct m0_dix_req *req, const struct m0_dix *index, const struct m0_bufvec *keys) |
M0_INTERNAL void | m0_dix_get_rep (const struct m0_dix_req *req, uint64_t idx, struct m0_dix_get_reply *rep) |
M0_INTERNAL int | m0_dix_del (struct m0_dix_req *req, const struct m0_dix *index, const struct m0_bufvec *keys, struct m0_dtx *dtx, uint32_t flags) |
M0_INTERNAL int | m0_dix_next (struct m0_dix_req *req, const struct m0_dix *index, const struct m0_bufvec *start_keys, const uint32_t *recs_nr, uint32_t flags) |
M0_INTERNAL void | m0_dix_next_rep (const struct m0_dix_req *req, uint64_t key_idx, uint64_t val_idx, struct m0_dix_next_reply *rep) |
M0_INTERNAL uint32_t | m0_dix_next_rep_nr (const struct m0_dix_req *req, uint64_t key_idx) |
M0_INTERNAL int | m0_dix_item_rc (const struct m0_dix_req *req, uint64_t idx) |
M0_INTERNAL int | m0_dix_generic_rc (const struct m0_dix_req *req) |
M0_INTERNAL int | m0_dix_req_rc (const struct m0_dix_req *req) |
M0_INTERNAL uint64_t | m0_dix_req_nr (const struct m0_dix_req *req) |
M0_INTERNAL void | m0_dix_get_rep_mlock (struct m0_dix_req *req, uint64_t idx) |
M0_INTERNAL void | m0_dix_next_rep_mlock (struct m0_dix_req *req, uint32_t key_idx, uint32_t val_idx) |
static void | dix_item_fini (const struct m0_dix_req *req, struct m0_dix_item *item) |
M0_INTERNAL void | m0_dix_req_fini (struct m0_dix_req *req) |
M0_INTERNAL void | m0_dix_req_fini_lock (struct m0_dix_req *req) |
M0_INTERNAL int | m0_dix_copy (struct m0_dix *dst, const struct m0_dix *src) |
M0_INTERNAL int | m0_dix_desc_set (struct m0_dix *dix, const struct m0_dix_ldesc *desc) |
M0_INTERNAL void | m0_dix_fini (struct m0_dix *dix) |
M0_INTERNAL int | m0_dix_sm_conf_init (void) |
M0_INTERNAL void | m0_dix_sm_conf_fini (void) |
M0_TL_DESCR_DECLARE (cas_rop, M0_EXTERN) | |
M0_TL_DECLARE (cas_rop, M0_INTERNAL, struct m0_dix_cas_rop) | |
static int | dix_ha_init (struct dix_ctx *ctx, const char *ha_addr) |
static void | dix_ha_stop (struct dix_ctx *ctx) |
static void | dix_ha_fini (struct dix_ctx *ctx) |
static int | dix_net_init (struct dix_ctx *ctx, const char *local_addr) |
static int | dix_rpc_init (struct dix_ctx *ctx) |
static void | dix_rpc_fini (struct dix_ctx *ctx) |
static void | dix_net_fini (struct dix_ctx *ctx) |
M0_INTERNAL struct m0_rconfc * | dix2rconfc (struct dix_ctx *ctx) |
static int | dix_layouts_init (struct dix_ctx *ctx) |
static void | dix_layouts_fini (struct dix_ctx *ctx) |
static int | dix_service_start (struct m0_reqh_service_type *stype, struct m0_reqh *reqh) |
static int | dix_reqh_services_start (struct dix_ctx *ctx) |
static int | dix_init (struct dix_ctx *ctx, const char *local_addr, const char *ha_addr, const char *profile) |
static void | dix_fini (struct dix_ctx *ctx) |
static int | dix_root_pver_find (struct dix_ctx *ctx, struct m0_fid *out) |
static int | dix_pver_fids_check (struct dix_ctx *ctx, const struct m0_fid *root, const struct m0_fid *layout, const struct m0_fid *ldescr) |
int | main (int argc, char **argv) |
Distributed index client provides an interface to access and modify distributed indices. It uses CAS client internally and extends its functionality by providing indices distribution.
Please refer to HLD of the distributed indexing for high-level overview.
There are three meta-indices that are used by client internally and can be manipulated through appropriate interfaces externally:
Meta-data is global for the file system and normally is created during cluster provisioning via m0_dix_meta_create(). Meta-data can be destroyed via m0_dix_meta_destroy(). Also user is able to check whether meta-data is accessible and is correct via m0_dix_meta_check(). Distributed index meta-data is mandatory and should always be present in the filesystem.
Client is initialised with m0_dix_cli_init(). The main argument is a pool version fid of the root index. All subsequent operations use this fid to locate indices in the cluster.
User should start the client in order to make DIX requests through the client. Client start procedure is executed through m0_dix_cli_start() or m0_dix_cli_start_sync(). The start procedure involves reading root index to retrieve layouts of 'layout' and 'layout-descr' meta-indeces.
There is a special client mode called "bootstrap" mode. In that mode the only request allowed is creating meta-indices in cluster (m0_dix_meta_create()). A client can be moved to this mode just after initialisation using m0_dix_cli_bootstrap() call. It's useful at cluster provisioning state, because client can't start successfully without meta-indices being created in motr file system. After meta indices creation is done, client can be started as usual or finalised.
DIX client relies on HA notifications to detect device failures. In order to receive HA notifications, the process where DIX client resides should be added to the cluster configuration. On receiving device failure notification local pool machines for all affected pool versions are updated accordingly.
DIX client is said to perform an operation over distributed index in degraded mode if at least one device in index pool version has failed or under repair/re-balance. Note, that offline device (i.e. the one with M0_PNDS_OFFLINE state) doesn't imply degraded mode. DIX client doesn't treat offline devices in any special way and the user is likely to get an error during record put/delete operation.
DIX client uses component catalogues with spare units instead of component catalogues stored on failed drives during operation in degraded mode. Below is a table showing how DIX client treats target component catalogue for different operations depending on the disk state storing this catalogue.
Disk state | GET PUT DEL NEXT |
---|---|
FAILED | Skip Use spare Skip Skip |
| REPAIRING | Skip Use spare Use spare Skip | REPAIRED | Use spare Use spare Use spare Skip |
DIX client relies on the fact that device will transit from FAILED to REPAIRING state, and it's not possible to transit from FAILED to ONLINE state. Otherwise, replicas written to spares when the device was FAILED won't be taken into account when disk returns to ONLINE state.
NEXT operation always ignores non-online disks, because this operation queries all online disks in a pool version and a layout guarantees that at least one correct replica for every record is available.
There is a possible race, where repair/re-balance service sends the old value to the spares/re-balance targets concurrently with a DIX client update. In order to avoid it DEL operation is executed in 2 phases. The process slightly differs for repair and re-balance.
Client sets special COF_DEL_LOCK flag in CAS request to make a hint to CAS service that special global "delete" lock should be taken for catalogue store prior to deletion. That lock guarantees that CAS service will do record deletion when the record is either already repaired/re-balanced or repair/re-balance process for this record is not started yet.
References:
HLD of the distributed indexing : For documentation links, please refer to this file : doc/motr-design-doc-list.rst
Fids of component catalogues are build in the same manner as it is done for cobs: component catalogue fid is a combination of distributed index fid with 'component catalogue' type and target storage id.
* 8 bits 24 bits 96 bits * +-----------------+-----------+---------------------------+ * DIX fid | DIX type id | zeroed | | * +-----------------+-----------+---------------------------+ * || * \/ * +-----------------+-----------+---------------------------+ * CCTG fid | CCTG type id | device id | | * +-----------------+-----------+---------------------------+ *
Identity mask is a sequence of ranges of bit positions in bit-string: [S0, E0], [S1, E1], ..., [Sm, Em], where Si and Ei are bit-offsets counted from 0. The ranges can be overlapping and are not necessarily monotone offset-wise. Range of identity mask can be infinite [X, inf] meaning that range includes bit positions from X to the end of a bit-string. Empty identity mask is a mask with 0 ranges defined.
The mask can be applied to a bit-string. Applying identity mask to a bit-string X produces a new bit-string Y: Y = X[S0, E0] :: X[S1, E1] :: ... :: X[Sm, Em], where :: is is bit-string concatenation.
For example, given identity mask I = [0, 3], [7, 8] and X = 0xf0, result of mask application is: Y = 0xf0[0, 3] :: 0xf0[7, 8] = 0b0000 :: 0b11 = 0b000011 = 0x03
It's totally fine to apply mask with ranges extending the bit-string's length. For example, application of identity mask with a single range [50,100] to a bit-string 0b11 is valid and produces empty bit-string.
Distributed index layout is based on parity de-clustering layout and determines targets (pool disks) for index records.
Layouts of indices are stored centralised in 'layout' meta-index. Layout can be stored there in two forms: layout id and layout descriptor. Layout descriptor shall be known in order to instantiate layout instance (m0_dix_linst) usable for target disks calculation. Therefore, if layout id is stored in 'layout' meta-index then it shall be resolved to full-fledged layout descriptor. The mapping between layout id and corresponding layout descriptor is stored in 'layout-descr' meta-index.
For more information about targets calculation for index records please refer to distributed indexing HLD.
Module "meta" contains functionality to create, destroy, and update meta-data for distributed indexing subsystem.
There are three groups of functions to work with 'root', 'layout' and 'layout-descr' indices respectively. Operations for 'root' index are synchronous, since they intended to be executed during provisioning. Operations for 'layout', 'layout-descr' indices are asynchronous. User shall wait on m0_dix_meta_req::dmr_chan for asynchronous operation completion.
Format of record in 'layout' index: key: index fid val: layout descriptor or layout id
Format of record in 'layout-descr' index: key: layout id val: layout descriptor
Root index is used to locate 'layout' and 'layout-descr' indices.
For more information see dix/client.h.
Also, module contains several functions for xcoding m0_dix_ldesc, m0_dix_layout types. There are three types of buffers that can be encoded/decoded via these functions:
Usage example. Encode existing arrays of fids and layouts into two buffer vectors (vals and keys):
Decode fids and layouts from existing buffer vectors (vals and keys):
DIX requests allow to access and modify distributed indices. Requests are executed in the context of distributed index client.
GET, PUT, DEL operations share a common logic:
NEXT operation logic:
Client operations are executed in the context of state machine group provided at initialisation. All DIX requests have asynchronous interface. It is possible to run several requests in the context of one client simultaneously even if the same state machine group is used.
All DIX requests are asynchronous and user shall wait until request reaches one of DIXREQ_FINAL, DIXREQ_FAILURE states.
#define DIX_FID_VAL_XCODE_OBJ | ( | ptr | ) | M0_XCODE_OBJ(m0_fid_xc, ptr) |
#define DIX_LAYOUT_VAL_XCODE_OBJ | ( | ptr | ) | M0_XCODE_OBJ(m0_dix_layout_xc, ptr) |
#define DIX_LDESC_VAL_XCODE_OBJ | ( | ptr | ) | M0_XCODE_OBJ(m0_dix_ldesc_xc, ptr) |
#define DIX_META_VAL_XCODE_OBJ | ( | ptr | ) | M0_XCODE_OBJ(dix_meta_val_xc, ptr) |
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
Definition at line 30 of file m0dixinit.c.
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX |
Definition at line 30 of file next_merge.c.
#define NOENT (-ENOENT) |
Definition at line 41 of file next_merge.c.
#define PROCESSING_IS_DONE (-ENOKEY) |
Definition at line 42 of file next_merge.c.
anonymous enum |
Enumerator | |
---|---|
M0_DIX_FID_DEVICE_ID_BITS | |
M0_DIX_FID_DEVICE_ID_OFFSET | |
M0_DIX_FID_DEVICE_ID_MASK | |
M0_DIX_FID_DEVICE_ID_MAX | |
M0_DIX_FID_DIX_CONTAINER_MASK |
Definition at line 54 of file fid_convert.h.
anonymous enum |
anonymous enum |
enum dix_action |
Enumerator | |
---|---|
ACTION_CREATE | |
ACTION_CHECK | |
ACTION_DESTROY |
Definition at line 55 of file m0dixinit.c.
enum dix_layout_type |
enum dix_req_type |
enum m0_dix_cli_state |
enum m0_dix_hash_fnc_type |
enum m0_dix_req_state |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Loads all CAS replies for NEXT request in sorting contexts.
There is exactly one sorting context for one CAS reply. One CAS reply carries retrieved records for all starting keys in a linear array from one component catalogue.
Definition at line 219 of file next_merge.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 350 of file m0dixinit.c.
|
static |
|
static |
Definition at line 115 of file m0dixinit.c.
|
static |
Definition at line 74 of file m0dixinit.c.
|
static |
Definition at line 102 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 241 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Determines whether item should be sent in dix_idxop_reqs_send().
Item should be sent if there was no failure for it on previous steps (i.e. during discovery) or if it should be sent during second phase of delete operation (see "Operation in degraded mode" in dix/client.h).
Definition at line 909 of file req.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 209 of file m0dixinit.c.
|
static |
Definition at line 200 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 188 of file m0dixinit.c.
|
static |
Definition at line 120 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 382 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 228 of file m0dixinit.c.
|
static |
|
static |
Serialize iname into keys and pair <FID,layout descriptor> into keys and vals bufvecs. Is used for insert the new pair of <key,val> into root and read val by key from root (for read case we should fill only keys parameter)
Definition at line 71 of file meta.c.
|
static |
Definition at line 368 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Determines targets for the parity group 'unit' with the target device known to be non-online. Record operation units (rec_op->dgp_units[]) for the resulting targets are updated accordingly (usually dpu_is_spare flag is unset to indicate that spare unit target should be used instead of the failed one).
Definition at line 2022 of file req.c.
|
static |
For every unit that is unaccessible (resides on a non-online device) determines corresponding spare unit. Depending on DIX request type and device states, record units are updated in order to skip the failed unit, to use the spare unit or to use both the failed and the spare units.
For more information see dix/client.h, "Operation in degraded mode" section.
Definition at line 2095 of file req.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 176 of file m0dixinit.c.
|
static |
Definition at line 128 of file m0dixinit.c.
|
static |
Definition at line 197 of file next_merge.c.
|
static |
Definition at line 216 of file m0dixinit.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Returns total size in bits of all ranges for the given bit-string length in bits. Bit-string length is required in case if mask contains infinite range or bit-string is shorter than mask being applied.
Definition at line 92 of file imask.c.
|
static |
M0_INTERNAL int m0_dix__layout_set | ( | const struct m0_dix_cli * | cli, |
struct m0_dix * | out | ||
) |
M0_INTERNAL int m0_dix__layout_vals_dec | ( | const struct m0_bufvec * | keys, |
const struct m0_bufvec * | vals, | ||
struct m0_fid * | out_fid, | ||
struct m0_dix_layout * | out_dlay, | ||
uint32_t | nr | ||
) |
Decodes 'keys' and 'vals' buffer vectors of keys/values from 'layout' index and returns decoded index identifiers and layouts. User must call m0_dix_ldesc_fini() for every 'out_dlay[i].u.dl_desc' when they are not necessary.
Definition at line 157 of file encdec.c.
M0_INTERNAL int m0_dix__layout_vals_enc | ( | const struct m0_fid * | fid, |
const struct m0_dix_layout * | dlay, | ||
uint32_t | nr, | ||
struct m0_bufvec * | keys, | ||
struct m0_bufvec * | vals | ||
) |
Encodes input arrays of index identifiers and layouts into record keys and values that can be stored in 'layout' meta-index.
'keys' and 'vals' buffer vectors shall be not allocated prior to invocation and user is responsible to free these buffer vectors afterwards.
Definition at line 111 of file encdec.c.
M0_INTERNAL int m0_dix__ldesc_vals_dec | ( | const struct m0_bufvec * | keys, |
const struct m0_bufvec * | vals, | ||
uint64_t * | out_lid, | ||
struct m0_dix_ldesc * | out_ldesc, | ||
uint32_t | nr | ||
) |
Decodes 'keys' and 'vals' buffer vectors of keys/values from 'layout-descr' index and returns decoded layout identifiers and layout descriptors. User must call m0_dix_ldesc_fini() for returned 'out_ldesc' objects when they are not necessary.
Definition at line 234 of file encdec.c.
M0_INTERNAL int m0_dix__ldesc_vals_enc | ( | const uint64_t * | lid, |
const struct m0_dix_ldesc * | ldesc, | ||
uint32_t | nr, | ||
struct m0_bufvec * | keys, | ||
struct m0_bufvec * | vals | ||
) |
Encodes input arrays of layout identifiers and layout descriptors into record keys and values that can be stored in 'layout-descr' meta-index.
'keys' and 'vals' buffer vectors shall be not allocated prior to invocation and user is responsible to free these buffer vectors afterwards.
Definition at line 195 of file encdec.c.
M0_INTERNAL int m0_dix__ldescr_set | ( | const struct m0_dix_cli * | cli, |
struct m0_dix * | out | ||
) |
M0_INTERNAL int m0_dix__meta_val_dec | ( | const struct m0_bufvec * | vals, |
struct m0_fid * | out_fid, | ||
struct m0_dix_ldesc * | out_dld, | ||
uint32_t | nr | ||
) |
Decodes 'vals' buffer vector of record values from 'root' index and returns FID+layout descriptor pairs. User must call m0_dix_ldesc_fini() for returned 'out_dld' objects when they are not necessary.
Definition at line 74 of file encdec.c.
M0_INTERNAL int m0_dix__meta_val_enc | ( | const struct m0_fid * | fid, |
const struct m0_dix_ldesc * | dld, | ||
uint32_t | nr, | ||
struct m0_bufvec * | vals | ||
) |
Encodes arrays of FID+layout pairs into values that can be stored as record values in 'root' meta-index. Encoded values are stored in 'vals' buffer vector.
'vals' buffer vector shall be not allocated prior to invocation and user is responsible to free this buffer vector afterwards.
Definition at line 48 of file encdec.c.
M0_INTERNAL int m0_dix__root_set | ( | const struct m0_dix_cli * | cli, |
struct m0_dix * | out | ||
) |
M0_INTERNAL int m0_dix_cctgs_lookup | ( | struct m0_dix_req * | req, |
const struct m0_dix * | indices, | ||
uint32_t | indices_nr | ||
) |
Checks whether all component catalogues exist for the given indices. Returns error if any component catalogue isn't accessible (e.g. disk where it resides has failed) or doesn't exist. It doesn't make sense to call this function for distributed indices with CROW policy, since some component catalogues may be not created yet.
Definition at line 1214 of file req.c.
M0_INTERNAL void m0_dix_cli_bootstrap | ( | struct m0_dix_cli * | cli | ) |
Moves DIX client to special "bootstrap" mode.
In that mode the only request allowed is creating meta-indices in cluster (m0_dix_meta_create()). It's the only way to create meta-indices in the cluster, because in normal mode DIX client returns error if meta-indices are not found in the cluster.
Definition at line 237 of file client.c.
M0_INTERNAL void m0_dix_cli_bootstrap_lock | ( | struct m0_dix_cli * | cli | ) |
The same as m0_dix_cli_bootstrap(), but locks DIX client internally.
Definition at line 245 of file client.c.
M0_INTERNAL void m0_dix_cli_fini | ( | struct m0_dix_cli * | cli | ) |
M0_INTERNAL void m0_dix_cli_fini_lock | ( | struct m0_dix_cli * | cli | ) |
The same as m0_dix_cli_fini(), but locks DIX client internally.
Definition at line 278 of file client.c.
M0_INTERNAL int m0_dix_cli_init | ( | struct m0_dix_cli * | cli, |
struct m0_sm_group * | sm_group, | ||
struct m0_pools_common * | pc, | ||
struct m0_layout_domain * | ldom, | ||
const struct m0_fid * | pver | ||
) |
Initialises DIX client.
cli | DIX client. |
sm_group | SM group for DIX client state machine. Asynchronous operations like m0_dix_cli_start() are executed in this SM group. Also, this SM group is locked/unlocked in m0_dix_lock()/m0_dix_unlock(). |
pc | Pools common structure where pool versions of index layouts are looked up. Also destination CAS services structures are looked up at pc->pc_dev2svc. |
ldom | Layout domain where layout structures for parity math are created. |
pver | Pool version of the root index (usually m0_conf_root::rt_imeta_pver). |
Definition at line 130 of file client.c.
M0_INTERNAL bool m0_dix_cli_is_locked | ( | const struct m0_dix_cli * | cli | ) |
M0_INTERNAL void m0_dix_cli_lock | ( | struct m0_dix_cli * | cli | ) |
M0_INTERNAL void m0_dix_cli_start | ( | struct m0_dix_cli * | cli | ) |
Starts DIX client asynchronously.
DIX client moves its SM (cli->dx_sm) to DIXCLI_READY or DIXCLI_FAILURE state on start procedure finish. If result state is DIXCLI_READY, then DIX client is ready to send DIX requests (see dix/meta.h and dix/req.h).
Definition at line 214 of file client.c.
M0_INTERNAL int m0_dix_cli_start_sync | ( | struct m0_dix_cli * | cli | ) |
M0_INTERNAL void m0_dix_cli_stop | ( | struct m0_dix_cli * | cli | ) |
M0_INTERNAL void m0_dix_cli_stop_lock | ( | struct m0_dix_cli * | cli | ) |
The same as m0_dix_cli_stop(), but locks DIX client internally.
Definition at line 261 of file client.c.
M0_INTERNAL void m0_dix_cli_unlock | ( | struct m0_dix_cli * | cli | ) |
M0_INTERNAL void m0_dix_cm_iter_cur_pos | ( | struct m0_dix_cm_iter * | iter, |
struct m0_fid * | cctg_fid, | ||
uint64_t * | cctg_proc_recs_nr | ||
) |
Gets fid of component catalogue that is currently under processing and number of processed records of this component catalogue.
[in] | iter | DIX CM iterator. |
[out] | cctg_fid | Current component catalogue fid. |
[out] | cctg_proc_recs_nr | Number of processed records. |
Definition at line 1537 of file iter.c.
M0_INTERNAL int m0_dix_cm_iter_get | ( | struct m0_dix_cm_iter * | iter, |
struct m0_buf * | key, | ||
struct m0_buf * | val, | ||
uint32_t * | sdev_id | ||
) |
Gets current key/value and remote device id for which retrieved key/value are targeted to.
[in] | iter | DIX CM iterator. |
[in] | key | Buffer which data pointer will be set to key. |
[in] | val | Buffer which data pointer will be set to value. |
[out] | sdev_id | Remote device id. |
0 on success. -ENODATA if all local catalogues are processed. Other error code on iterator failure.
Definition at line 1465 of file iter.c.
M0_INTERNAL void m0_dix_cm_iter_next | ( | struct m0_dix_cm_iter * | iter | ) |
Wakes up DIX CM iterator FOM to move the iterator to the next record. Than key/value can be retrieved using () function.
iter | DIX CM iterator. |
Definition at line 1458 of file iter.c.
M0_INTERNAL void m0_dix_cm_iter_processed_num | ( | struct m0_dix_cm_iter * | iter, |
uint64_t * | proc_recs_nr | ||
) |
M0_INTERNAL int m0_dix_cm_iter_start | ( | struct m0_dix_cm_iter * | iter, |
struct m0_dix_cm_type * | dcmt, | ||
struct m0_reqh * | reqh, | ||
m0_bcount_t | rpc_cutoff | ||
) |
Starts DIX CM iterator by queueing of corresponding FOM for execution. Function always returns success for now.
iter | DIX CM iterator. |
dcmt | DIX CM iterator type. |
reqh | Corresponding request handler. |
rpc_cutoff | Threshold in bytes for transmission using bulk. |
0 On success.
Definition at line 1429 of file iter.c.
M0_INTERNAL void m0_dix_cm_iter_stop | ( | struct m0_dix_cm_iter * | iter | ) |
Tells DIX CM iterator to stop and waits for the final state of its FOM. Please note that no external lock should be held before calling this function, because it may wait and block. Otherwise, deadlock may appear on that external lock.
iter | DIX CM iterator. |
Definition at line 1525 of file iter.c.
M0_INTERNAL void m0_dix_cm_iter_type_register | ( | struct m0_dix_cm_type * | dcmt | ) |
M0_INTERNAL int m0_dix_create | ( | struct m0_dix_req * | req, |
const struct m0_dix * | indices, | ||
uint32_t | indices_nr, | ||
struct m0_dtx * | dtx, | ||
uint32_t | flags | ||
) |
Creates distributed indices.
This request registers provided indices in "layout" meta-index and then, if COF_CROW flag is not specified, creates component catalogues for indices.
User can specify for every index to be created layout ID or full layout descriptor. Layout IDs are checked for existence internally.
If req->dr_is_meta is set, then provided indices are not registered in "layout" meta-index, only component catalogues are created.
Definition at line 990 of file req.c.
M0_INTERNAL int m0_dix_del | ( | struct m0_dix_req * | req, |
const struct m0_dix * | index, | ||
const struct m0_bufvec * | keys, | ||
struct m0_dtx * | dtx, | ||
uint32_t | flags | ||
) |
Deletes records from distributed index.
'Keys' buffer vector is managed by user and shall be accessible until the request completion.
Definition at line 2388 of file req.c.
M0_INTERNAL int m0_dix_delete | ( | struct m0_dix_req * | req, |
const struct m0_dix * | indices, | ||
uint64_t | indices_nr, | ||
struct m0_dtx * | dtx, | ||
uint32_t | flags | ||
) |
Destroys distributed indices.
For every provided index destroys all its component catalogues (along with data) and unregisters it from "layout" index.
If indices were created with COF_CROW, then it is user responsibility to set COF_CROW for delete operation also. Otherwise, execution errors are possible.
Definition at line 1190 of file req.c.
M0_INTERNAL int m0_dix_desc_set | ( | struct m0_dix * | dix, |
const struct m0_dix_ldesc * | desc | ||
) |
M0_INTERNAL uint32_t m0_dix_devices_nr | ( | struct m0_dix_linst * | linst | ) |
M0_INTERNAL uint32_t m0_dix_fid__device_id_extract | ( | const struct m0_fid * | fid | ) |
M0_INTERNAL uint32_t m0_dix_fid_cctg_device_id | ( | const struct m0_fid * | cctg_fid | ) |
Definition at line 81 of file fid_convert.c.
M0_INTERNAL void m0_dix_fid_convert_cctg2dix | ( | const struct m0_fid * | cctg_fid, |
struct m0_fid * | dix_fid | ||
) |
Definition at line 69 of file fid_convert.c.
M0_INTERNAL void m0_dix_fid_convert_dix2cctg | ( | const struct m0_fid * | dix_fid, |
struct m0_fid * | cctg_fid, | ||
uint32_t | device_id | ||
) |
Definition at line 54 of file fid_convert.c.
M0_INTERNAL void m0_dix_fid_dix_make | ( | struct m0_fid * | dix_fid, |
uint32_t | container, | ||
uint64_t | key | ||
) |
Definition at line 45 of file fid_convert.c.
M0_INTERNAL bool m0_dix_fid_validate_cctg | ( | const struct m0_fid * | cctg_fid | ) |
Definition at line 94 of file fid_convert.c.
M0_INTERNAL bool m0_dix_fid_validate_dix | ( | const struct m0_fid * | dix_fid | ) |
Definition at line 88 of file fid_convert.c.
M0_INTERNAL void m0_dix_fini | ( | struct m0_dix * | dix | ) |
M0_INTERNAL int m0_dix_generic_rc | ( | const struct m0_dix_req * | req | ) |
Returns generic return code for the operation.
If the generic return code is negative, then the whole request has failed. Otherwise, the user should check return codes for the individual items in operation vector via m0_dix_item_rc().
Definition at line 2483 of file req.c.
M0_INTERNAL int m0_dix_get | ( | struct m0_dix_req * | req, |
const struct m0_dix * | index, | ||
const struct m0_bufvec * | keys | ||
) |
Gets values for provided keys from distributed index.
'Keys' buffer vector is managed by user and shall be accessible until the request completion.
Retrieved values on request completion can be retrieved via m0_dix_get_rep().
Definition at line 2357 of file req.c.
M0_INTERNAL void m0_dix_get_rep | ( | const struct m0_dix_req * | req, |
uint64_t | idx, | ||
struct m0_dix_get_reply * | rep | ||
) |
Gets record value for i-th key retrieved by m0_dix_get().
Function fills rep->dgr_val. Value data buffer is deallocated in m0_dix_req_fini(), unless m0_dix_get_rep_mlock() is called by user.
Definition at line 2378 of file req.c.
M0_INTERNAL void m0_dix_get_rep_mlock | ( | struct m0_dix_req * | req, |
uint64_t | idx | ||
) |
Prevents deallocation of key/value buffers during request finalisation.
Applicable only for GET request. Retrieved 'idx'-th record value buffer is locked in memory and user is responsible to deallocate it.
Definition at line 2509 of file req.c.
M0_INTERNAL int m0_dix_imask_apply | ( | void * | buffer, |
m0_bcount_t | buf_len_bytes, | ||
struct m0_dix_imask * | mask, | ||
void ** | res, | ||
m0_bcount_t * | res_len_bits | ||
) |
M0_INTERNAL int m0_dix_imask_copy | ( | struct m0_dix_imask * | dst, |
const struct m0_dix_imask * | src | ||
) |
M0_INTERNAL bool m0_dix_imask_eq | ( | const struct m0_dix_imask * | imask1, |
const struct m0_dix_imask * | imask2 | ||
) |
M0_INTERNAL void m0_dix_imask_fini | ( | struct m0_dix_imask * | mask | ) |
M0_INTERNAL int m0_dix_imask_init | ( | struct m0_dix_imask * | mask, |
struct m0_ext * | range, | ||
uint64_t | nr | ||
) |
M0_INTERNAL bool m0_dix_imask_is_empty | ( | const struct m0_dix_imask * | mask | ) |
M0_INTERNAL int m0_dix_index_list | ( | struct m0_dix_meta_req * | req, |
const struct m0_fid * | start_fid, | ||
uint32_t | indices_nr | ||
) |
Returns identifiers of the next 'indices_nr' indices starting with index having 'start_fid' identifier.
Retrieved indices identifiers can be acessed using m0_dix_index_list_rep_nr() and m0_dix_index_list_rep().
Definition at line 669 of file meta.c.
M0_INTERNAL int m0_dix_index_list_rep | ( | struct m0_dix_meta_req * | req, |
uint32_t | idx, | ||
struct m0_fid * | fid | ||
) |
Gets 'idx'-th index identifier retrieved by m0_dix_index_list() request.
Definition at line 704 of file meta.c.
M0_INTERNAL int m0_dix_index_list_rep_nr | ( | struct m0_dix_meta_req * | req | ) |
Returns number of indices retrieved by m0_dix_index_list().
If returned value is less than number of indices requested, then there are no more distributed indices.
Definition at line 699 of file meta.c.
M0_INTERNAL int m0_dix_item_rc | ( | const struct m0_dix_req * | req, |
uint64_t | idx | ||
) |
M0_INTERNAL int m0_dix_layout_del | ( | struct m0_dix_meta_req * | req, |
const struct m0_fid * | fid, | ||
uint32_t | nr | ||
) |
M0_INTERNAL bool m0_dix_layout_eq | ( | const struct m0_dix_layout * | layout1, |
const struct m0_dix_layout * | layout2 | ||
) |
M0_INTERNAL void m0_dix_layout_fini | ( | struct m0_dix_linst * | dli | ) |
M0_INTERNAL int m0_dix_layout_get | ( | struct m0_dix_meta_req * | req, |
const struct m0_fid * | fid, | ||
uint32_t | nr | ||
) |
Retrieves layouts for distributed indices with the given fids.
It can also be used to check for existence of the distributed indices. Once operation is finished, retrieved layouts are accessible via m0_dix_layout_rep_get().
Definition at line 626 of file meta.c.
M0_INTERNAL int m0_dix_layout_init | ( | struct m0_dix_linst * | dli, |
struct m0_layout_domain * | domain, | ||
const struct m0_fid * | fid, | ||
uint64_t | layout_id, | ||
struct m0_pool_version * | pver, | ||
struct m0_dix_ldesc * | dld | ||
) |
Builds DIX layout instance.
Internal function, user should use m0_dix_layout_iter_init() instead.
Definition at line 86 of file layout.c.
M0_INTERNAL void m0_dix_layout_iter_fini | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL void m0_dix_layout_iter_get_at | ( | struct m0_dix_layout_iter * | iter, |
uint64_t | unit, | ||
uint64_t * | tgt | ||
) |
M0_INTERNAL void m0_dix_layout_iter_goto | ( | struct m0_dix_layout_iter * | iter, |
uint64_t | unit_nr | ||
) |
Moves iterator current position to unit with number 'unit_nr'.
Next m0_dix_layout_iter_next() invocation will return target for 'unit_nr' unit.
Definition at line 302 of file layout.c.
M0_INTERNAL int m0_dix_layout_iter_init | ( | struct m0_dix_layout_iter * | iter, |
const struct m0_fid * | index, | ||
struct m0_layout_domain * | ldom, | ||
struct m0_pool_version * | pver, | ||
struct m0_dix_ldesc * | ldesc, | ||
struct m0_buf * | key | ||
) |
Initialises DIX layout iterator.
After initialisation iterator stay on first unit (data unit) in parity group.
iter | Layout iterator. |
index | Fid of distributed index having layout 'ldesc'. |
ldom | Layout domain where layout instance is created. |
pver | Pool version where distributed index is stored. |
ldesc | Distributed index layout descriptor. |
key | Key of the record for which targets are calculated. |
Definition at line 203 of file layout.c.
M0_INTERNAL void m0_dix_layout_iter_next | ( | struct m0_dix_layout_iter * | iter, |
uint64_t * | tgt | ||
) |
Calculates target for the next unit in record parity group.
User is responsible to not overcome parity group boundary. Number of units in parity group can be obtained via m0_dix_liter_W().
Definition at line 249 of file layout.c.
M0_INTERNAL void m0_dix_layout_iter_reset | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL int m0_dix_layout_put | ( | struct m0_dix_meta_req * | req, |
const struct m0_fid * | fid, | ||
const struct m0_dix_layout * | dlay, | ||
uint32_t | nr, | ||
uint32_t | flags | ||
) |
Stores layouts for distributed indices with the given fids.
It puts "index fid":"index layout" pairs to "layout" meta-index.
Definition at line 574 of file meta.c.
M0_INTERNAL int m0_dix_layout_rep_get | ( | struct m0_dix_meta_req * | req, |
uint64_t | idx, | ||
struct m0_dix_layout * | dlay | ||
) |
Returns the 'idx'-th layout retrieved by m0_dix_layout_get().
'dlay' may be NULL if user is interested only in return code without copying the layout, e.g. to check that the index exists.
Definition at line 650 of file meta.c.
M0_INTERNAL int m0_dix_ldesc_copy | ( | struct m0_dix_ldesc * | dst, |
const struct m0_dix_ldesc * | src | ||
) |
M0_INTERNAL void m0_dix_ldesc_fini | ( | struct m0_dix_ldesc * | ld | ) |
M0_INTERNAL int m0_dix_ldesc_init | ( | struct m0_dix_ldesc * | ld, |
struct m0_ext * | range, | ||
m0_bcount_t | range_nr, | ||
enum m0_dix_hash_fnc_type | htype, | ||
struct m0_fid * | pver | ||
) |
M0_INTERNAL int m0_dix_ldescr_del | ( | struct m0_dix_meta_req * | req, |
const uint64_t * | lid, | ||
uint32_t | nr | ||
) |
M0_INTERNAL int m0_dix_ldescr_get | ( | struct m0_dix_meta_req * | req, |
const uint64_t * | lid, | ||
uint32_t | nr | ||
) |
Queries layout descriptor for the given layout id from 'layout-descr' meta-index. After request is finished retrieved layout descriptor can be accessed through m0_dix_ldescr_rep_get().
Definition at line 506 of file meta.c.
M0_INTERNAL int m0_dix_ldescr_put | ( | struct m0_dix_meta_req * | req, |
const uint64_t * | lid, | ||
const struct m0_dix_ldesc * | ldesc, | ||
uint32_t | nr | ||
) |
M0_INTERNAL int m0_dix_ldescr_rep_get | ( | struct m0_dix_meta_req * | req, |
uint64_t | idx, | ||
struct m0_dix_ldesc * | ldesc | ||
) |
Returns result of m0_dix_ldescr_get() request.
Definition at line 530 of file meta.c.
M0_INTERNAL uint32_t m0_dix_liter_K | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL uint32_t m0_dix_liter_N | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL uint32_t m0_dix_liter_P | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL uint32_t m0_dix_liter_S | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL uint32_t m0_dix_liter_spare_offset | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL uint32_t m0_dix_liter_unit_classify | ( | struct m0_dix_layout_iter * | iter, |
uint64_t | unit | ||
) |
M0_INTERNAL uint32_t m0_dix_liter_W | ( | struct m0_dix_layout_iter * | iter | ) |
M0_INTERNAL int m0_dix_meta_check | ( | struct m0_dix_cli * | cli, |
struct m0_sm_group * | grp, | ||
bool * | result | ||
) |
Checks whether meta-data is available (previously created).
Performs check for existence of 'root', 'layout' and 'layout-descr' in pool version assigned in client (including all meta-indices component catalogues).
Definition at line 343 of file meta.c.
M0_INTERNAL int m0_dix_meta_create | ( | struct m0_dix_cli * | cli, |
struct m0_sm_group * | grp, | ||
struct m0_dix_ldesc * | dld_layout, | ||
struct m0_dix_ldesc * | dld_ldescr | ||
) |
M0_INTERNAL int m0_dix_meta_destroy | ( | struct m0_dix_cli * | cli, |
struct m0_sm_group * | grp | ||
) |
M0_INTERNAL int m0_dix_meta_generic_rc | ( | const struct m0_dix_meta_req * | req | ) |
Returns generic return code for the meta operation.
If the generic return code is negative, then the whole request has failed. Otherwise, the user should check return codes for the individual items in operation vector via m0_dix_meta_item_rc().
Definition at line 309 of file meta.c.
M0_INTERNAL int m0_dix_meta_item_rc | ( | const struct m0_dix_meta_req * | req, |
uint64_t | idx | ||
) |
M0_INTERNAL void m0_dix_meta_lock | ( | struct m0_dix_meta_req * | req | ) |
Acquires lock for DIX meta request state machine group.
All asynchronous meta operations require DIX meta request state machine group being locked before invocation. DIX meta request state machine group is the one passed to m0_dix_meta_req_init() function.
Definition at line 299 of file meta.c.
M0_INTERNAL void m0_dix_meta_req_fini | ( | struct m0_dix_meta_req * | req | ) |
M0_INTERNAL void m0_dix_meta_req_fini_lock | ( | struct m0_dix_meta_req * | req | ) |
The same as m0_dix_meta_req_fini(), but takes request lock internally.
Definition at line 291 of file meta.c.
M0_INTERNAL void m0_dix_meta_req_init | ( | struct m0_dix_meta_req * | req, |
struct m0_dix_cli * | cli, | ||
struct m0_sm_group * | grp | ||
) |
Initialises DIX meta request.
It shall be called before passing request to other functions like m0_dix_root_read(), m0_dix_ldescr_put(), etc.
Definition at line 259 of file meta.c.
M0_INTERNAL int m0_dix_meta_req_nr | ( | const struct m0_dix_meta_req * | req | ) |
M0_INTERNAL void m0_dix_meta_unlock | ( | struct m0_dix_meta_req * | req | ) |
M0_INTERNAL void m0_dix_mreq_init | ( | struct m0_dix_req * | req, |
struct m0_dix_cli * | cli, | ||
struct m0_sm_group * | grp | ||
) |
Initialises DIX request operating with meta-indices. This function shall be used instead of m0_dix_req_init() if the request is the record operation over the meta-index ("root", "layout" or "layout-descr").
Definition at line 221 of file req.c.
M0_INTERNAL int m0_dix_next | ( | struct m0_dix_req * | req, |
const struct m0_dix * | index, | ||
const struct m0_bufvec * | start_keys, | ||
const uint32_t * | recs_nr, | ||
uint32_t | flags | ||
) |
Gets next 'recs_nr[i]' records for each i-th key in 'start_keys'.
Size of recs_nr array should be >= start_keys->ov_vec.v_nr.
Requested record ranges may overlap. Duplicates in a result are not filtered.
Records with 'start_keys' keys are also accounted and included in the result unless COF_EXCLUDE_START_KEY flag is specified.
In order to start iteration from the first record user may specify 1-byte zero start key and specify COF_SLANT flag. COF_SLANT flag is also useful if start key may be not found in the index. In this case iteration starts with the smallest key following the start key.
'Flags' argument is a bitmask of m0_cas_op_flags values.
Definition at line 2415 of file req.c.
M0_INTERNAL void m0_dix_next_rep | ( | const struct m0_dix_req * | req, |
uint64_t | key_idx, | ||
uint64_t | val_idx, | ||
struct m0_dix_next_reply * | rep | ||
) |
Gets 'val_idx'-th value retrieved for 'key_idx'-th key as a result of m0_dix_next() request.
Function doesn't copy key/value data buffers, only assign pointers to received buffers. They are deallocated in m0_dix_req_fini(), unless m0_dix_next_rep_mlock() is called by user.
Definition at line 2449 of file req.c.
M0_INTERNAL void m0_dix_next_rep_mlock | ( | struct m0_dix_req * | req, |
uint32_t | key_idx, | ||
uint32_t | val_idx | ||
) |
Prevents deallocation of key/value buffers during request finalisation.
Applicable only for NEXT request. For 'key_idx'-th start key and 'val_idx'-th record value retrieved for it key/value buffers are locked in memory and user is responsible to deallocate them.
Definition at line 2519 of file req.c.
M0_INTERNAL uint32_t m0_dix_next_rep_nr | ( | const struct m0_dix_req * | req, |
uint64_t | key_idx | ||
) |
M0_INTERNAL int m0_dix_next_result_prepare | ( | struct m0_dix_req * | req | ) |
Performs merge sorting of records retrieved for NEXT operation.
Since NEXT operation queries all component catalogues for subsequent records, then on completion received records shall be sorted, duplicates shall be filtered and excessive records shall be thrown away from result.
Definition at line 252 of file next_merge.c.
M0_INTERNAL int m0_dix_put | ( | struct m0_dix_req * | req, |
const struct m0_dix * | index, | ||
const struct m0_bufvec * | keys, | ||
const struct m0_bufvec * | vals, | ||
struct m0_dtx * | dtx, | ||
uint32_t | flags | ||
) |
Inserts records to a distributed index.
'Keys' and 'vals' buffer vectors are managed by user and shall be accessible until the request completion.
Definition at line 2326 of file req.c.
M0_INTERNAL struct m0_pool_version * m0_dix_pver | ( | const struct m0_dix_cli * | cli, |
const struct m0_dix * | dix | ||
) |
M0_INTERNAL void m0_dix_rebalance_sw_onwire_fop_fini | ( | void | ) |
M0_INTERNAL void m0_dix_rebalance_sw_onwire_fop_init | ( | void | ) |
M0_INTERNAL int m0_dix_rebalance_sw_onwire_fop_setup | ( | struct m0_cm * | cm, |
struct m0_fop * | fop, | ||
void(*)(struct m0_ref *) | fop_release, | ||
uint64_t | proxy_id, | ||
const char * | local_ep, | ||
const struct m0_cm_sw * | sw, | ||
const struct m0_cm_sw * | out_interval | ||
) |
M0_INTERNAL void m0_dix_repair_sw_onwire_fop_fini | ( | void | ) |
M0_INTERNAL void m0_dix_repair_sw_onwire_fop_init | ( | void | ) |
M0_INTERNAL int m0_dix_repair_sw_onwire_fop_setup | ( | struct m0_cm * | cm, |
struct m0_fop * | fop, | ||
void(*)(struct m0_ref *) | fop_release, | ||
uint64_t | proxy_id, | ||
const char * | local_ep, | ||
const struct m0_cm_sw * | sw, | ||
const struct m0_cm_sw * | out_interval | ||
) |
M0_INTERNAL void m0_dix_req_cancel | ( | struct m0_dix_req * | dreq | ) |
M0_INTERNAL void m0_dix_req_fini | ( | struct m0_dix_req * | req | ) |
Finalises DIX request.
Definition at line 2553 of file req.c.
M0_INTERNAL void m0_dix_req_fini_lock | ( | struct m0_dix_req * | req | ) |
The same as m0_dix_req_fini(), but takes SM group lock internally.
Definition at line 2577 of file req.c.
M0_INTERNAL void m0_dix_req_init | ( | struct m0_dix_req * | req, |
struct m0_dix_cli * | cli, | ||
struct m0_sm_group * | grp | ||
) |
M0_INTERNAL bool m0_dix_req_is_locked | ( | const struct m0_dix_req * | req | ) |
M0_INTERNAL void m0_dix_req_lock | ( | struct m0_dix_req * | req | ) |
M0_INTERNAL uint64_t m0_dix_req_nr | ( | const struct m0_dix_req * | req | ) |
Returns the number of results.
It's guaranteed that if m0_dix_req_generic_rc(req) == 0, then m0_dix_req_nr() equals to the number of requested items (indices to create/lookup/delete, records to insert/get/delete, etc.).
Definition at line 2504 of file req.c.
M0_INTERNAL int m0_dix_req_rc | ( | const struct m0_dix_req * | req | ) |
M0_INTERNAL void m0_dix_req_unlock | ( | struct m0_dix_req * | req | ) |
M0_INTERNAL int m0_dix_req_wait | ( | struct m0_dix_req * | req, |
uint64_t | states, | ||
m0_time_t | to | ||
) |
M0_INTERNAL int m0_dix_root_read | ( | struct m0_dix_meta_req * | req | ) |
Reads 'layout' and 'layout-descr' layouts from root index.
After meta request is finished the layouts are accessible through m0_dix_root_read_rep().
Definition at line 379 of file meta.c.
M0_INTERNAL int m0_dix_root_read_rep | ( | struct m0_dix_meta_req * | req, |
struct m0_dix_ldesc * | layout, | ||
struct m0_dix_ldesc * | ldescr | ||
) |
Returns result of m0_dix_root_read() request.
Definition at line 443 of file meta.c.
M0_INTERNAL void m0_dix_rs_fini | ( | struct m0_dix_next_resultset * | rs | ) |
Finalises result set for NEXT operation.
Definition at line 356 of file next_merge.c.
M0_INTERNAL int m0_dix_rs_init | ( | struct m0_dix_next_resultset * | rs, |
uint32_t | start_keys_nr, | ||
uint32_t | sctx_nr | ||
) |
Initialise result set for NEXT operation.
Result set is a context for merge-sorting records retrieved from all component catalogues.
This function is actually internal and exported only for UT purposes. Normally it is called inside m0_dix_next_result_prepare().
Definition at line 342 of file next_merge.c.
M0_INTERNAL void m0_dix_sm_conf_fini | ( | void | ) |
M0_INTERNAL int m0_dix_sm_conf_init | ( | void | ) |
M0_INTERNAL void m0_dix_target | ( | struct m0_dix_linst * | inst, |
uint64_t | unit, | ||
struct m0_buf * | key, | ||
uint64_t * | out_id | ||
) |
M0_INTERNAL struct m0_pooldev * m0_dix_tgt2sdev | ( | struct m0_dix_linst * | linst, |
uint64_t | tgt | ||
) |
Returns pool device structure by target (e.g. calculated by m0_dix_target()).
Definition at line 76 of file layout.c.
M0_TL_DECLARE | ( | cas_rop | , |
M0_INTERNAL | , | ||
struct m0_dix_cas_rop | |||
) |
M0_TL_DEFINE | ( | cas_rop | , |
M0_INTERNAL | , | ||
struct m0_dix_cas_rop | |||
) |
M0_TL_DESCR_DECLARE | ( | cas_rop | , |
M0_EXTERN | |||
) |
M0_TL_DESCR_DEFINE | ( | cas_rop | , |
"cas record operations" | , | ||
M0_INTERNAL | , | ||
struct m0_dix_cas_rop | , | ||
crp_linkage | , | ||
crp_magix | , | ||
M0_DIX_ROP_MAGIC | , | ||
M0_DIX_ROP_HEAD_MAGIC | |||
) |
struct m0_dix_imask M0_XCA_DOMAIN | ( | rpc | ) |
int main | ( | int | argc, |
char ** | argv | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 333 of file next_merge.c.
|
static |
Definition at line 324 of file next_merge.c.
|
static |
Sets sorting context current position to the first record retrieved for 'key_idx' starting key.
Definition at line 104 of file next_merge.c.
|
static |
Searches for the minimal value in all sort contexts.
After minimal value is found, all sort contexts current positions are moved to the first value that is bigger than found minimal value.
Function out values: m0_cas_next_reply *rep - minimal value for all sort contexts m0_dix_next_sort_ctx *ret_ctx - sort context which contains "rep" ret_idx - number of rep in cas_next_rep array
Returns true if for current starting key there are no more records in all sorting contexts.
Definition at line 147 of file next_merge.c.
|
static |
|
static |
Definition at line 50 of file next_merge.c.
|
static |
Definition at line 70 of file next_merge.c.
|
static |
|
static |
Definition at line 64 of file next_merge.c.
|
static |
Definition at line 388 of file next_merge.c.
|
static |
|
static |
|
static |
|
static |
struct m0_cm_type dix_rebalance_cmt |
const struct m0_fom_type_ops dix_rebalance_sw_fom_type_ops |
struct m0_fop_type dix_rebalance_sw_onwire_fopt |
struct m0_fop_type dix_rebalance_sw_onwire_rep_fopt |
struct m0_cm_type dix_repair_cmt |
const struct m0_fom_type_ops dix_repair_sw_fom_type_ops |
struct m0_fop_type dix_repair_sw_onwire_fopt |
struct m0_fop_type dix_repair_sw_onwire_rep_fopt |
struct m0_sm_conf dix_req_sm_conf |
|
static |
|
static |
struct m0_dix_linst M0_XCA_DOMAIN |
enum dix_req_type M0_XCA_ENUM |
|
static |
Definition at line 72 of file m0dixinit.c.
|
static |
Definition at line 71 of file m0dixinit.c.