25 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 36 #if defined(round_down) 49 #define DUMMY_PTR 0xdeafdead 51 #define UT_DEFAULT_BLOCK_SHIFT M0_DEFAULT_BUF_SHIFT 52 #define UT_DEFAULT_BLOCK_SIZE (1ULL << M0_DEFAULT_BUF_SHIFT) 113 db =
map->pi_databufs[0][0];
197 obj->ob_attr.oa_bshift = 63;
270 map->pi_databufs[row][col] =
NULL;
332 map->pi_ivec.iv_vec.v_nr = 0;
337 map->pi_ivec.iv_vec.v_nr = 0;
354 map->pi_ivec.iv_vec.v_nr = 0;
355 map->pi_ivec.iv_index[0] = 0;
356 map->pi_ivec.iv_vec.v_count[0] = 0;
375 map->pi_ivec.iv_vec.v_nr = 0;
376 map->pi_ivec.iv_index[0] = 0;
377 map->pi_ivec.iv_vec.v_count[0] = 0;
397 map->pi_ivec.iv_vec.v_nr = 0;
398 map->pi_ivec.iv_index[0] = 0;
399 map->pi_ivec.iv_vec.v_count[0] = 0;
481 map->pi_ivec.iv_index[0] = 0;
482 map->pi_ivec.iv_vec.v_count[0] = blk_size;
493 map->pi_ivec.iv_index[0] = 0;
494 map->pi_ivec.iv_vec.v_count[0] = 2 * blk_size;
510 map->pi_ivec.iv_index[0] = 0;
511 map->pi_ivec.iv_vec.v_count[0] = blk_size;
547 pargrp_iomap_bob_init(
map);
636 map->pi_ivec.iv_index[0] = 0;
637 map->pi_ivec.iv_vec.v_count[0] = blk_size;
676 map->pi_ivec.iv_index[0] = 0;
677 map->pi_ivec.iv_vec.v_count[0] = blk_size;
687 map->pi_ivec.iv_index[0] = 0;
688 map->pi_ivec.iv_vec.v_count[0] = 2 * blk_size;
792 for (
i = 0;
i <
map->pi_max_row;
i++) {
831 map->pi_ivec.iv_index[0] = 0;
832 map->pi_ivec.iv_vec.v_count[0] = 4096;
863 if (
map->pi_databufs !=
NULL) {
864 for (row = 0; row <
map->pi_max_row; ++row) {
865 for (col = 0; col <
map->pi_max_col; ++col) {
866 if (
map->pi_databufs[row][col] !=
NULL)
873 if (
map->pi_paritybufs !=
NULL) {
874 for (row = 0; row <
map->pi_max_row; ++row) {
875 for (col = 0; col <
layout_k(play); ++col) {
876 if (
map->pi_paritybufs[row][col] !=
NULL)
913 for (
i = 0;
i <
map->pi_max_row;
i++) {
947 pargrp_iomap_bob_init(
map);
954 map->pi_ivec.iv_vec.v_nr = 1;
1168 map->pi_ioo->ioo_oo.oo_oc.oc_op.op_entity,
instance);
1169 map->pi_ioo->ioo_oo.oo_layout_instance->li_ops =
1174 &
instance->m0c_pools_common.pc_cur_pver->pv_mach,
1199 map->pi_ioo->ioo_oo.oo_oc.oc_op.op_entity,
instance);
1200 map->pi_ioo->ioo_oo.oo_layout_instance->li_ops =
1209 &
instance->m0c_pools_common.pc_cur_pver->pv_mach,
1216 map->pi_databufs[0][
i]->db_flags = 0;
1218 map->pi_paritybufs[0][
i]->db_flags = 0;
1270 {
"data_buf_invariant",
1272 {
"data_buf_invariant_nr",
1278 {
"data_buf_dealloc_fini",
1280 {
"data_buf_alloc_init",
1282 {
"pargrp_iomap_invariant",
1284 {
"pargrp_iomap_invariant_nr",
1288 {
"pargrp_iomap_populate",
1290 {
"pargrp_iomap_fullpages_count",
1292 {
"pargrp_iomap_seg_process",
1294 {
"pargrp_iomap_databuf_alloc",
1296 {
"pargrp_iomap_auxbuf_alloc",
1298 {
"pargrp_iomap_readold_auxbuf_alloc",
1300 {
"pargrp_iomap_readrest",
1302 {
"pargrp_iomap_parity_recalc",
1304 {
"pargrp_iomap_paritybufs_alloc",
1306 {
"pargrp_iomap_spans_seg",
1308 {
"pargrp_iomap_init",
1310 {
"pargrp_iomap_fini",
1312 {
"pargrp_src_addr",
1320 {
"data_page_offset_get",
1322 {
"pargrp_iomap_pages_mark_as_failed",
1328 {
"mark_page_as_read_failed",
1330 {
"pargrp_iomap_dgmode_process",
1332 {
"pargrp_iomap_dgmode_postprocess",
1334 {
"pargrp_iomap_dgmode_recover",
1340 #undef M0_TRACE_SUBSYSTEM
struct m0_poolmach_state * pm_state
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)
static void ut_test_pargrp_iomap_populate(void)
static void ut_test_pargrp_iomap_parity_recalc(void)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int ut_io_pargrp_fini(void)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
static struct m0_fid mock_fid
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
static uint64_t pargrp_iomap_fullpages_count(struct pargrp_iomap *map)
struct m0_ut_suite ut_suite_io_pargrp
static bool data_buf_invariant_nr(const struct pargrp_iomap *map)
static int pargrp_iomap_populate(struct pargrp_iomap *map, struct m0_ivec_cursor *cursor, struct m0_bufvec_cursor *buf_cursor)
static uint32_t layout_k(const struct m0_pdclust_layout *play)
static int pargrp_iomap_readrest(struct pargrp_iomap *map)
static struct net_test_cmd_node * node
static int pargrp_iomap_parity_recalc(struct pargrp_iomap *map)
M0_INTERNAL bool data_buf_invariant(const struct data_buf *db)
static void ut_test_pargrp_iomap_fini(void)
M0_INTERNAL void ut_dummy_pargrp_iomap_delete(struct pargrp_iomap *map, struct m0_client *instance)
static void ut_test_data_buf_dealloc_fini(void)
M0_INTERNAL void ut_dummy_target_ioreq_delete(struct target_ioreq *ti)
static bool is_page_read(struct data_buf *dbuf)
struct m0_layout_enum *(* lio_to_enum)(const struct m0_layout_instance *li)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
static void ut_test_data_page_offset_get(void)
M0_INTERNAL void m0_free_aligned(void *data, size_t size, unsigned shift)
static void ut_test_gobj_offset(void)
struct m0_poolnode * pst_nodes_array
static void ut_test_pargrp_src_addr(void)
static void ut_test_pargrp_id_find(void)
static void mock_layout_enum_get(const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
M0_INTERNAL void ut_dummy_data_buf_fini(struct data_buf *db)
static struct m0_client * dummy_instance
void ut_layout_domain_fill(struct m0_client *cinst)
M0_INTERNAL bool pargrp_iomap_invariant(const struct pargrp_iomap *map)
M0_INTERNAL int ut_m0_client_init(struct m0_client **instance)
static struct data_buf * data_buf_alloc_init(struct m0_obj *obj, enum page_attr pattr)
M0_INTERNAL struct m0_obj * ut_dummy_obj_create(void)
struct m0_layout_enum_type * le_type
static const struct pargrp_iomap_ops iomap_ops
M0_INTERNAL void pargrp_iomap_fini(struct pargrp_iomap *map, struct m0_obj *obj)
static void ut_pargrp_iomap_free_data_buf(struct pargrp_iomap *map, int row, int col)
static struct m0_pdclust_layout * dummy_pdclust_layout
static void ut_test_is_page_read(void)
static bool pargrp_iomap_spans_seg(struct pargrp_iomap *map, m0_bindex_t index, m0_bcount_t count)
M0_INTERNAL void ut_dummy_paritybufs_delete(struct pargrp_iomap *map, bool do_free)
struct m0_pooldev * pst_devices_array
M0_INTERNAL bool pargrp_iomap_invariant_nr(const struct m0_op_io *ioo)
static void ut_test_pargrp_iomap_databuf_alloc(void)
static m0_bindex_t gobj_offset(m0_bindex_t toff, struct pargrp_iomap *map, struct m0_pdclust_layout *play, struct m0_pdclust_src_addr *src)
static void ut_test_pargrp_iomap_seg_process(void)
struct m0_pools_common m0c_pools_common
M0_INTERNAL void ut_realm_entity_setup(struct m0_realm *realm, struct m0_entity *ent, struct m0_client *cinst)
static void ut_test_data_buf_invariant_nr(void)
M0_INTERNAL struct m0_pdclust_layout * ut_get_pdclust_layout_from_ioo(struct m0_op_io *ioo)
static void ut_test_pargrp_iomap_dgmode_process(void)
static void ut_test_mark_page_as_read_failed(void)
static void ut_test_pargrp_iomap_init(void)
static m0_bindex_t data_page_offset_get(struct pargrp_iomap *map, uint32_t row, uint32_t col)
struct m0_indexvec ioo_ext
M0_INTERNAL void ut_dummy_ioo_delete(struct m0_op_io *ioo, struct m0_client *instance)
const struct m0_layout_enum_ops * le_ops
static struct m0_layout_enum_ops mock_layout_enum_ops
static void data_buf_init(struct data_buf *buf, void *addr, uint64_t addr_size, uint64_t flags)
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 struct target_ioreq * ut_dummy_target_ioreq_create(void)
#define UT_DEFAULT_BLOCK_SIZE
struct m0_bufvec ioo_data
static void ut_test_data_buf_invariant(void)
static struct m0_layout_enum * mock_layout_instance_to_enum(const struct m0_layout_instance *li)
static void ut_test_pargrp_iomap_spans_seg(void)
enum m0_pbuf_type ioo_pbuf_type
M0_INTERNAL int ut_dummy_poolmach_create(struct m0_pool_version *pv)
static int pargrp_iomap_pages_mark_as_failed(struct pargrp_iomap *map, enum m0_pdclust_unit_type type)
static void ut_test_pargrp_iomap_fullpages_count(void)
M0_INTERNAL void ut_shuffle_test_order(struct m0_ut_suite *suite)
static int pargrp_iomap_dgmode_postprocess(struct pargrp_iomap *map)
static int pargrp_iomap_readold_auxbuf_alloc(struct pargrp_iomap *map)
M0_INTERNAL struct pargrp_iomap * ut_dummy_pargrp_iomap_create(struct m0_client *instance, int num_blocks)
M0_INTERNAL void ut_set_device_state(struct m0_poolmach *pm, int dev, enum m0_pool_nd_state state)
static void ut_test_pargrp_iomap_dgmode_recover(void)
static void ut_test_pargrp_iomap_pages_mark_as_failed(void)
struct m0_op_common oo_oc
static void data_buf_fini(struct data_buf *buf)
static void ut_test_unit_state(void)
void(* leo_get)(const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
M0_INTERNAL struct data_buf * ut_dummy_data_buf_create(void)
static void ut_test_pargrp_iomap_paritybufs_alloc(void)
static void ut_test_pargrp_iomap_invariant(void)
static struct m0_pdclust_layout * pdlayout_get(const struct io_request *req)
static void ut_test_pargrp_iomap_auxbuf_alloc(void)
static void ut_test_pargrp_iomap_invariant_nr(void)
static struct m0_parity_math * parity_math(struct io_request *req)
static void ut_free_pargrp_iomap(struct pargrp_iomap *map)
M0_INTERNAL struct m0_pdclust_layout * ut_dummy_pdclust_layout_create(struct m0_client *instance)
struct m0_realm * en_realm
M0_INTERNAL struct m0_op_io * ut_dummy_ioo_create(struct m0_client *instance, int num_io_maps)
static struct m0_layout_instance_ops mock_layout_instance_ops
static void ut_test_data_buf_init(void)
M0_BOB_DECLARE(M0_INTERNAL, m0_layout_enum)
M0_INTERNAL void ut_set_node_state(struct m0_poolmach *pm, int node, enum m0_pool_nd_state state)
static int pargrp_iomap_databuf_alloc(struct pargrp_iomap *map, uint32_t row, uint32_t col, struct m0_bufvec_cursor *data)
#define M0_ALLOC_PTR(ptr)
static int pargrp_iomap_dgmode_recover(struct pargrp_iomap *map)
static struct m0_realm realm
static int pargrp_iomap_paritybufs_alloc(struct pargrp_iomap *map)
static void ut_test_pargrp_iomap_readrest(void)
struct m0_entity ob_entity
M0_INTERNAL m0_bindex_t m0_ivec_cursor_index(const struct m0_ivec_cursor *cur)
static void ut_test_data_buf_alloc_init(void)
static struct m0 instance
static int pargrp_iomap_seg_process(struct pargrp_iomap *map, uint32_t seg, bool rmw, uint64_t skip_buf_index, struct m0_bufvec_cursor *buf_cursor)
M0_INTERNAL int ut_io_pargrp_init(void)
static void ut_test_pargrp_iomap_dgmode_postprocess(void)
static uint64_t pargrp_iomap_auxbuf_alloc(struct pargrp_iomap *map, uint32_t row, uint32_t col)
static struct m0_layout_enum_type mock_layout_enum_type
M0_INTERNAL void ut_dummy_obj_delete(struct m0_obj *obj)
struct m0_client * re_instance
static struct m0_layout_enum mock_layout_enum
static void ut_test_seg_collate(void)
struct m0_pool_version * pc_cur_pver
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
static void ut_test_data_buf_fini(void)
static void ut_test_io_spare_map(void)
M0_INTERNAL void m0_client_init_io_op(void)
static void data_buf_dealloc_fini(struct data_buf *buf)
static void ut_test_pargrp_iomap_readold_auxbuf_alloc(void)
struct target_ioreq * db_tioreq
M0_INTERNAL void ut_dummy_data_buf_delete(struct data_buf *db)
#define UT_DEFAULT_BLOCK_SHIFT
M0_INTERNAL int pargrp_iomap_init(struct pargrp_iomap *map, struct m0_op_io *ioo, uint64_t grpid)
uint32_t pmi_parity_count
struct pargrp_iomap ** ioo_iomaps