25 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 35 #include <openssl/md5.h> 43 #if defined(round_down) 207 "ut_mock_launch_dispatch_fails");
282 "ut_mock_handle_executed_adc_fails");
305 "ut_mock_ioreq_parity_recalc_fails");
574 "ut_mock_handle_executed_adc_fails");
625 "ut_mock_dgmode_write_fails");
704 memset(
data.db_buf.b_addr,
'!',
716 memset(
data.db_buf.b_addr, 0,
data.db_buf.b_nob);
732 memset(
data.db_buf.b_addr,
'?',
data.db_buf.b_nob);
778 obj =
map->pi_ioo->ioo_obj;
779 obj->ob_attr.oa_bshift = M0_DEFAULT_BUF_SHIFT;
783 map->pi_ivec.iv_index[0] = 0;
806 memset(
map->pi_databufs[0][0]->db_buf.b_addr,
'!',
807 map->pi_databufs[0][0]->db_buf.b_nob);
814 map->pi_databufs[0][0]->db_buf.b_addr,
950 obj->ob_attr.oa_bshift = M0_DEFAULT_BUF_SHIFT;
988 for (
i = 0;
i <
map->pi_max_row;
i++) {
989 for (j = 0; j <
map->pi_max_col; j++) {
990 memset(
map->pi_databufs[
i][j]->db_buf.b_addr,
992 map->pi_databufs[
i][j]->db_buf.b_nob);
1012 for (j = 0; j <
map->pi_max_col; j++) {
1014 if (unit_idx != 0) {
1019 for (
i = 0;
i <
map->pi_max_row;
i++) {
1046 for (
i = 0;
i <
map->pi_max_row;
i++) {
1047 for (j = 0; j <
map->pi_max_col; j++) {
1053 map->pi_databufs[
i][j]->db_buf.b_addr+
count,
1105 &
instance->m0c_pools_common.pc_cur_pver->pv_mach,
1109 &
instance->m0c_pools_common.pc_cur_pver->pv_mach,
1169 &
instance->m0c_pools_common.pc_cur_pver->pv_mach,
1206 instance->m0c_pools_common.pc_cur_pver);
1223 &
instance->m0c_pools_common.pc_cur_pver->pv_mach,
1257 instance->m0c_pools_common.pc_cur_pver);
1317 {
"ioreq_sm_state_set_locked",
1319 {
"ioreq_sm_failed_locked",
1321 {
"ioreq_iosm_handle_launch",
1323 {
"ioreq_iosm_handle_executed",
1325 {
"ioreq_iomaps_destroy",
1327 {
"ioreq_iomaps_prepare",
1329 {
"application_data_copy",
1331 {
"ioreq_application_data_copy",
1333 {
"ioreq_parity_recalc",
1337 {
"ioreq_dgmode_recover",
1339 {
"ioreq_dgmode_read",
1341 {
"ioreq_dgmode_write",
1346 #undef M0_TRACE_SUBSYSTEM int(* iro_dgmode_read)(struct m0_op_io *ioo, bool rmw)
M0_INTERNAL void ut_dummy_paritybufs_create(struct pargrp_iomap *map, bool do_alloc)
M0_INTERNAL void m0_ivec_cursor_init(struct m0_ivec_cursor *cur, const struct m0_indexvec *ivec)
void ut_layout_domain_empty(struct m0_client *cinst)
#define M0_ALLOC_ARR(arr, nr)
void m0_entity_fini(struct m0_entity *entity)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
int(* iro_parity_recalc)(struct m0_op_io *ioo)
M0_INTERNAL void ut_set_device_state(struct m0_poolmach *pm, int dev, enum m0_pool_nd_state state)
unsigned char * curr_context[DATA_UNIT_COUNT]
static uint64_t data_buf_copy(struct data_buf *data, struct m0_bufvec_cursor *app_datacur, enum copy_direction dir)
static void ioreq_iosm_handle_executed(struct m0_sm_group *grp, struct m0_sm_ast *ast)
int(* iro_parity_verify)(struct m0_op_io *ioo)
static struct m0_sm_group * grp
M0_INTERNAL int ut_io_req_fini(void)
struct m0_bufvec * user_data
const struct m0_op_io_ops * ioo_ops
struct m0_sm_group * oo_sm_grp
#define UT_DEFAULT_BLOCK_SIZE
static void ut_test_device_check(void)
int m0_client_calculate_pi(struct m0_generic_pi *pi, struct m0_pi_seed *seed, struct m0_bufvec *bvec, enum m0_pi_calc_flag flag, unsigned char *curr_context, unsigned char *pi_value_without_seed)
int(* iro_dgmode_write)(struct m0_op_io *ioo, bool rmw)
M0_INTERNAL void ut_dummy_pargrp_iomap_delete(struct pargrp_iomap *map, struct m0_client *instance)
void(* nxo_complete)(struct nw_xfer_request *xfer, bool rmw)
static void ut_test_ioreq_dgmode_read(void)
M0_INTERNAL void ut_dummy_target_ioreq_delete(struct target_ioreq *ti)
struct m0_sm_conf io_sm_conf
static void ut_test_ioreq_iomaps_destroy(void)
static void ut_test_ioreq_sm_state(void)
M0_INTERNAL void ut_dummy_data_buf_fini(struct data_buf *db)
static void ut_test_ioreq_iomaps_prepare(void)
static void ut_test_data_buf_copy(void)
void ut_layout_domain_fill(struct m0_client *cinst)
struct m0_ut_suite ut_suite_io_req
M0_INTERNAL int ut_m0_client_init(struct m0_client **instance)
M0_INTERNAL void m0_sm_group_fini(struct m0_sm_group *grp)
static struct m0_pdclust_layout * dummy_pdclust_layout
struct m0_indexvec pi_ivec
M0_INTERNAL void ut_dummy_paritybufs_delete(struct pargrp_iomap *map, bool do_free)
M0_INTERNAL struct nw_xfer_request * ut_dummy_xfer_req_create(void)
int(* iro_application_data_copy)(struct m0_op_io *ioo, enum copy_direction dir, enum page_attr filter)
static int ut_mock_handle_executed_adc(struct m0_op_io *ioo, enum copy_direction dir, enum page_attr filter)
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
struct m0_semaphore cpus_sem
static struct m0_sm_ast ast[NR]
static void ut_test_ioreq_sm_failed_locked(void)
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
static void ut_test_ioreq_iosm_handle_executed(void)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
void(* iro_iosm_handle_executed)(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static int ioreq_parity_recalc(struct m0_op_io *ioo)
static int device_check(struct m0_op_io *ioo)
static void ut_test_ioreq_dgmode_write(void)
static int ut_mock_ioreq_parity_verify(struct m0_op_io *ioo)
M0_INTERNAL void ut_realm_entity_setup(struct m0_realm *realm, struct m0_entity *ent, struct m0_client *cinst)
static void ioreq_iosm_handle_launch(struct m0_sm_group *grp, struct m0_sm_ast *ast)
struct nw_xfer_request ioo_nwxfer
int(* nxo_distribute)(struct nw_xfer_request *xfer)
struct m0_indexvec ioo_ext
M0_INTERNAL void ut_dummy_ioo_delete(struct m0_op_io *ioo, struct m0_client *instance)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
static struct m0_client * dummy_instance
static void m0_fi_enable(const char *func, const char *tag)
M0_INTERNAL void ut_m0_client_fini(struct m0_client **instance)
M0_INTERNAL void ut_dummy_poolmach_delete(struct m0_pool_version *pv)
M0_INTERNAL int ut_io_req_init(void)
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
static int ioreq_dgmode_recover(struct m0_op_io *ioo)
M0_INTERNAL struct target_ioreq * ut_dummy_target_ioreq_create(void)
void m0_sm_state_set(struct m0_sm *mach, int state)
const struct nw_xfer_ops * nxr_ops
struct m0_bufvec ioo_data
M0_INTERNAL void ioreq_sm_state_set_locked(struct m0_op_io *ioo, int state)
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
M0_INTERNAL int ut_dummy_poolmach_create(struct m0_pool_version *pv)
static void ut_test_ioreq_dgmode_recover(void)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
void * m0_alloc(size_t size)
M0_INTERNAL void ut_shuffle_test_order(struct m0_ut_suite *suite)
struct m0_pdclust_instance pi
static int ut_mock_ioreq_parity_recalc(struct m0_op_io *ioo)
static int ioreq_dgmode_write(struct m0_op_io *ioo, bool rmw)
M0_INTERNAL struct pargrp_iomap * ut_dummy_pargrp_iomap_create(struct m0_client *instance, int num_blocks)
struct m0_htable nxr_tioreqs_hash
M0_INTERNAL bool m0_ivec_cursor_move(struct m0_ivec_cursor *cur, m0_bcount_t count)
struct m0_op_common oo_oc
static int application_data_copy(struct pargrp_iomap *map, struct m0_obj *obj, m0_bindex_t start, m0_bindex_t end, struct m0_bufvec_cursor *datacur, enum copy_direction dir, enum page_attr filter)
static void ut_test_application_data_copy(void)
static void ut_test_ioreq_sm_state_set_locked(void)
static int ut_mock_handle_launch_dispatch(struct nw_xfer_request *xfer)
M0_INTERNAL struct m0_pdclust_layout * ut_dummy_pdclust_layout_create(struct m0_client *instance)
M0_INTERNAL void ioreq_sm_failed_locked(struct m0_op_io *ioo, int rc)
struct m0_realm * en_realm
struct m0_sm_group en_sm_group
struct m0_sm_group op_sm_group
static int ut_mock_ioreq_dgmode_read(struct m0_op_io *ioo, bool rmw)
M0_INTERNAL struct m0_op_io * ut_dummy_ioo_create(struct m0_client *instance, int num_io_maps)
#define M0_FI_ENABLED(tag)
M0_INTERNAL void m0_sm_init(struct m0_sm *mach, const struct m0_sm_conf *conf, uint32_t state, struct m0_sm_group *grp)
static void ioreq_iomaps_destroy(struct m0_op_io *ioo)
static void ut_test_ioreq_parity_recalc(void)
#define M0_ALLOC_PTR(ptr)
static struct m0_realm realm
struct m0_entity * op_entity
static int ut_mock_io_launch_distribute(struct nw_xfer_request *xfer)
int(* nxo_dispatch)(struct nw_xfer_request *xfer)
M0_INTERNAL void ut_dummy_xfer_req_delete(struct nw_xfer_request *xfer)
static int ioreq_dgmode_read(struct m0_op_io *ioo, bool rmw)
static void ut_mock_ioreq_iosm_handle_executed(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static void ut_test_ioreq_application_data_copy(void)
int(* iro_dgmode_recover)(struct m0_op_io *ioo)
struct m0_entity ob_entity
void ut_mock_handle_executed_complete(struct nw_xfer_request *xfer, bool rmw)
M0_INTERNAL m0_bindex_t m0_ivec_cursor_index(const struct m0_ivec_cursor *cur)
M0_INTERNAL void m0_sm_move(struct m0_sm *mach, int32_t rc, int state)
struct data_buf *** pi_databufs
static struct m0 instance
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
static void m0_fi_enable_once(const char *func, const char *tag)
static uint32_t ioreq_sm_state(const struct io_request *req)
static int ut_mock_ioreq_dgmode_recover(struct m0_op_io *ioo)
struct m0_client * re_instance
M0_INTERNAL void ut_set_node_state(struct m0_poolmach *pm, int node, enum m0_pool_nd_state state)
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
const struct m0_op_io_ops ioo_ops
M0_INTERNAL void m0_client_init_io_op(void)
static int ioreq_application_data_copy(struct m0_op_io *ioo, enum copy_direction dir, enum page_attr filter)
M0_INTERNAL void m0_sm_asts_run(struct m0_sm_group *grp)
const struct pargrp_iomap_ops mock_iomap_ops
struct m0_bufvec ioo_attr
static void ut_test_ioreq_iosm_handle_launch(void)
M0_INTERNAL void m0_bufvec_free2(struct m0_bufvec *bufvec)
const struct pargrp_iomap_ops * pi_ops
struct m0_sm_conf m0_op_conf
struct pargrp_iomap ** ioo_iomaps
static int ut_mock_ioreq_dgmode_write(struct m0_op_io *ioo, bool rmw)
M0_INTERNAL int m0_bufvec_empty_alloc(struct m0_bufvec *bufvec, uint32_t num_segs)
M0_INTERNAL void m0_sm_fini(struct m0_sm *mach)
M0_INTERNAL void ut_dummy_data_buf_init(struct data_buf *db)