27 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 38 #if defined(round_down) 53 #define DUMMY_PTR 0xdeafdead 55 #define UT_DEFAULT_BLOCK_SIZE (1ULL << M0_DEFAULT_BUF_SHIFT) 67 addr |= M0_NETBUF_MASK;
71 addr &= ~M0_NETBUF_MASK;
90 obj.ob_attr.oa_bshift = 2;
93 obj.ob_attr.oa_bshift = 3;
96 obj.ob_attr.oa_bshift = 13;
99 obj.ob_attr.oa_bshift = 0;
116 obj.ob_attr.oa_bshift = bshift;
180 obj.ob_attr.oa_bshift = bshift;
229 obj.ob_attr.oa_bshift = bshift;
611 for (
i = 0;
i < len; ++
i) {
629 if (prev_ind >
INDEX(ivec,
i))
631 prev_ind =
INDEX(ivec,
i);
668 uint32_t vecs[3][10] = { {1, 9, 8, 7, 2, 3, 4, 6, 5, 10},
669 {10, 9, 8, 7, 6, 5, 4, 3, 2, 1},
670 {1, 400, 34, 399, 2, 33, 13, 14, 1, 10}};
721 obj.ob_attr.oa_pver =
instance->m0c_pools_common.pc_cur_pver->pv_id;
724 m0_fi_enable(
"tolerance_of_level",
"fake_tolerance_of_level");
731 m0_fi_disable(
"tolerance_of_level",
"fake_tolerance_of_level");
735 m0_op_io_bob_init(ioop);
736 m0_op_obj_bob_init(&ioop->
ioo_oo);
795 {
"addr_is_network_aligned",
807 {
"layout_unit_size",
813 {
"pdlayout_instance",
825 {
"indexvec_page_nr",
829 {
"parity_units_page_nr",
845 {
"obj_io_cb_launch",
851 {
"m0_op_io_invariant",
863 #undef M0_TRACE_SUBSYSTEM
void ut_layout_domain_empty(struct m0_client *cinst)
static void ut_test_layout_unit_size(void)
void(* iro_iosm_handle_launch)(struct m0_sm_group *grp, struct m0_sm_ast *ast)
struct m0_uint128 uuid[1000]
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_io_ut_fini(void)
void m0_entity_fini(struct m0_entity *entity)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
static int ut_mock_io_launch_prepare(struct m0_op_io *ioo)
static void ut_test_page_size(void)
static m0_bcount_t seg_endpos(const struct m0_indexvec *ivec, uint32_t i)
static void ut_test_layout_n(void)
static void obj_io_cb_launch(struct m0_op_common *oc)
M0_INTERNAL void m0_uuid_generate(struct m0_uint128 *u)
void m0_op_fini(struct m0_op *op)
static struct m0_sm_group * grp
const struct m0_op_io_ops * ioo_ops
static void ut_test_page_nr(void)
static void ut_test_m0_op_io_invariant(void)
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
static uint32_t layout_k(const struct m0_pdclust_layout *play)
struct m0_sm_group * oo_sm_grp
static void ut_test_layout_k(void)
struct m0_layout_instance pi_base
static void ut_test_obj_io_cb_launch(void)
static uint32_t io_seg_size(void)
static int ut_mock_io_launch_distribute(struct nw_xfer_request *xfer)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
static void obj_io_cb_free(struct m0_op_common *oc)
static void ut_test_target_offset(void)
void ut_layout_domain_fill(struct m0_client *cinst)
static uint64_t round_up(uint64_t val, uint64_t size)
static void ut_test_addr_is_network_aligned(void)
M0_INTERNAL int ut_m0_client_init(struct m0_client **instance)
struct m0_pdclust_attr pl_attr
static struct m0_pdclust_layout * dummy_pdclust_layout
static void ut_disable_resource_manager(struct m0_client *instance)
static void ut_test_round_up(void)
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
int m0_obj_op(struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op **op)
static void ut_mock_iosm_handle_launch(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static struct m0_sm_ast ast[NR]
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
static void ut_test_obj_io_cb_free(void)
static void ut_test_iomap_page_nr(void)
M0_INTERNAL void ut_realm_entity_setup(struct m0_realm *realm, struct m0_entity *ent, struct m0_client *cinst)
static uint32_t rows_nr(struct m0_pdclust_layout *play)
struct nw_xfer_request ioo_nwxfer
int(* nxo_distribute)(struct nw_xfer_request *xfer)
M0_INTERNAL struct m0_pdclust_instance * ut_dummy_pdclust_instance_create(struct m0_pdclust_layout *pdl)
M0_INTERNAL struct m0_pdclust_layout * ut_get_pdclust_layout_from_ioo(struct m0_op_io *ioo)
void(* oc_cb_free)(struct m0_op_common *oc)
static void ut_helper_page_nr(m0_bcount_t size, m0_bcount_t bshift, uint64_t exp_pg)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
M0_INTERNAL void ut_dummy_ioo_delete(struct m0_op_io *ioo, struct m0_client *instance)
static void ut_test_parity_units_page_nr(void)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
const struct m0_fid_type cot_ftype
static void m0_fi_enable(const char *func, const char *tag)
M0_INTERNAL bool m0_op_io_invariant(const struct m0_op_io *ioo)
static uint64_t page_nr(m0_bcount_t size)
static uint64_t page_id(m0_bindex_t offset)
M0_INTERNAL void m0_reqh_service_quit(struct m0_reqh_service *svc)
M0_INTERNAL void ut_m0_client_fini(struct m0_client **instance)
struct m0_ut_suite ut_suite_io
static void ut_test_round_down(void)
static struct m0_pdclust_instance * pdlayout_instance(const struct m0_layout_instance *li)
const struct nw_xfer_ops * nxr_ops
static struct m0_bufvec bvec
static struct m0_stob_domain * dom
static void ut_test_layout_instance(void)
static void ut_test_seg_endpos(void)
static uint64_t layout_unit_size(const struct m0_pdclust_layout *play)
M0_INTERNAL struct m0_rm_domain * rm_domain_get(struct m0_client *cinst)
M0_INTERNAL void ut_shuffle_test_order(struct m0_ut_suite *suite)
static void ut_test_rm_domain_get(void)
M0_INTERNAL int m0_io_ut_init(void)
M0_INTERNAL void m0_client_init_io_op(void)
static m0_bindex_t offset
void(* oc_cb_fini)(struct m0_op_common *oc)
M0_INTERNAL int m0_reqh_service_setup(struct m0_reqh_service **out, struct m0_reqh_service_type *stype, struct m0_reqh *reqh, struct m0_reqh_context *rctx, const struct m0_fid *fid)
struct m0_op_common oo_oc
static void obj_io_cb_fini(struct m0_op_common *oc)
static uint64_t data_size(const struct m0_pdclust_layout *play)
M0_INTERNAL bool addr_is_network_aligned(void *addr)
static uint64_t round_down(uint64_t val, uint64_t size)
static void ut_helper_sort_init(struct m0_indexvec *ivec, uint32_t *arr, uint32_t len)
static uint32_t layout_n(const struct m0_pdclust_layout *play)
static struct m0_pdclust_layout * pdlayout_get(const struct io_request *req)
static void ut_test_pdlayout_instance(void)
struct m0_reqh_service_type m0_rms_type
static void ut_helper_page_id(m0_bindex_t offset, m0_bcount_t bshift, uint64_t exp_pg)
M0_INTERNAL struct m0_pdclust_layout * ut_dummy_pdclust_layout_create(struct m0_client *instance)
static void segments_sort(struct m0_indexvec *ivec, struct m0_bufvec *data, struct m0_bufvec *attr)
M0_INTERNAL struct m0_op_io * ut_dummy_ioo_create(struct m0_client *instance, int num_io_maps)
static void ut_test_m0_obj_op(void)
static void ut_test_target_fid(void)
static void ut_test_obj_io_cb_fini(void)
static struct m0_layout_instance * layout_instance(const struct io_request *req)
#define M0_ALLOC_PTR(ptr)
static void ut_test_pdlayout_get(void)
static struct m0_realm realm
struct m0_entity * op_entity
static uint64_t parity_units_page_nr(const struct m0_pdclust_layout *play)
static void ut_test_data_size(void)
int(* iro_iomaps_prepare)(struct m0_op_io *ioo)
static struct m0 instance
static void ut_test_io_desc_size(void)
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
static void ut_test_page_id(void)
static void m0_fi_enable_once(const char *func, const char *tag)
static uint64_t group_id(m0_bindex_t index, m0_bcount_t dtsize)
static void ut_test_indexvec_page_nr(void)
static void ut_test_segments_sort(void)
static bool ut_helper_sort_is_sorted(struct m0_indexvec *ivec)
static void ut_helper_sort(struct m0_indexvec *ivec, uint32_t *arr, uint32_t len)
static struct m0_reqh_service * ut_service
void m0_op_free(struct m0_op *op)
M0_INTERNAL uint64_t m0__page_size(const struct m0_op_io *ioo)
struct m0_layout_instance * oo_layout_instance
static void ut_enable_resource_manager(struct m0_client *instance)
void(* oc_cb_launch)(struct m0_op_common *oc)
static void ut_test_rows_nr(void)
static void ut_test_obj_io_ast_fini(void)
static void ut_test_page_pos_get(void)
static void ut_test_group_id(void)
static struct m0_client * dummy_instance
static uint64_t target_offset(uint64_t frame, struct m0_pdclust_layout *play, m0_bindex_t gob_offset)
static void ut_helper_rows_nr(uint64_t size, m0_bcount_t bshift, uint64_t exp_row_nr)
static void ut_test_io_seg_size(void)
M0_INTERNAL void m0_fid_tassume(struct m0_fid *fid, const struct m0_fid_type *ft)