36 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 63 .
bt_name =
"pargrp_iomap_bobtype",
126 map->pi_grpid, toff);
147 return (db !=
NULL &&
148 data_buf_bob_check(db) &&
171 obj =
map->pi_ioo->ioo_obj;
174 for (row = 0; row <
rows_nr(play,
obj); ++row) {
176 for (col = 0; col <
layout_n(play); ++col) {
178 if (
map->pi_databufs[row][col] !=
NULL &&
184 if (
map->pi_paritybufs !=
NULL) {
185 for (row = 0; row <
rows_nr(play,
obj); ++row) {
187 for (col = 0; col <
layout_k(play); ++col) {
189 if (
map->pi_paritybufs[row][col] !=
NULL &&
210 return M0_RC(pargrp_iomap_bob_check(
map) &&
216 map->pi_ivec.iv_vec.v_nr >= 2,
218 map->pi_ivec.iv_index[
i] +
219 map->pi_ivec.iv_vec.v_count[
i] <=
220 map->pi_ivec.iv_index[
i+1])) &&
257 data_buf_bob_init(
buf);
278 data_buf_bob_fini(
buf);
302 if (
buf->db_auxbuf.b_addr !=
NULL) {
304 buf->db_auxbuf.b_nob,
375 addr =
map->pi_databufs[row][0]->db_buf.b_addr;
376 size =
map->pi_databufs[row][0]->db_buf.b_nob;
446 grpstart = grpsize *
map->pi_grpid;
447 grpend = grpstart + grpsize;
456 if (
map->pi_ops->pi_spans_seg(
map,
480 ++
map->pi_ivec.iv_vec.v_nr;
487 rc =
map->pi_ops->pi_seg_process(
map,
seg, rmw, 0, buf_cursor);
550 uint64_t rr_pages_nr = data_pages_nr -
551 map->pi_ops->pi_fullpages_find(
map);
553 if (rr_pages_nr < ro_pages_nr || map->pi_trunc_partial) {
562 rc =
map->pi_ops->pi_readold_auxbuf_alloc(
map);
602 grpstart = grpsize *
map->pi_grpid;
603 grpend = grpstart + grpsize;
628 ioo,
map,
map->pi_grpid, grpstart, grpsize, !!rmw);
631 map->pi_trunc_partial =
true;
635 instance->m0c_config->mc_is_read_verify) {
644 rc =
map->pi_ops->pi_seg_process(
map, 0, rmw,
662 rc =
map->pi_ops->pi_paritybufs_alloc(
map);
668 rc =
map->pi_ops->pi_data_replicate(
map);
703 for (row = 0; row <
rows_nr(play,
obj); ++row) {
705 for (col = 0; col <
layout_n(play); ++col) {
707 if (
map->pi_databufs[row][col] &&
708 map->pi_databufs[row][col]->db_flags &
756 uint32_t
seg,
bool rmw,
757 uint64_t skip_buf_index,
821 if (
start < skip_buf_index) {
822 rc =
map->pi_ops->pi_databuf_alloc(
map, row, col,
NULL);
835 rc =
map->pi_ops->pi_databuf_alloc(
map, row, col,
837 if (
rc == 0 && buf_cursor)
841 " grpid=%3" PRIu64 " row=%u col=%u f=0x%x addr=%p",
843 map->pi_databufs[row][col] ?
844 map->pi_databufs[row][col]->db_buf.b_addr :
NULL);
848 map->pi_databufs[row][col]->db_flags |=
flags;
854 for (row = 0; row <
rows_nr(play,
obj); ++row) {
855 for (col = 0; col <
layout_n(play); ++col) {
856 if (
map->pi_databufs[row][col] !=
NULL) {
858 map->pi_databufs[row][col]);
859 map->pi_databufs[row][col] =
NULL;
887 M0_ENTRY(
"row %u col %u", row, col);
890 M0_PRE(col <= map->pi_max_col);
891 M0_PRE(row <= map->pi_max_row);
894 obj =
map->pi_ioo->ioo_obj;
915 map->pi_databufs[row][col] =
buf;
917 return M0_RC(
map->pi_databufs[row][col] ==
NULL ? -ENOMEM : 0);
942 map->pi_databufs[row][col]->db_auxbuf.b_addr = (
void *)
945 if (
map->pi_databufs[row][col]->db_auxbuf.b_addr ==
NULL)
948 map->pi_databufs[row][col]->db_auxbuf.b_nob = pagesize;
991 if (
map->pi_databufs[row][col] !=
NULL) {
1015 map->pi_databufs[row][col]->db_flags |=
PA_READ;
1109 ivec = &
map->pi_ivec;
1116 COUNT(ivec, 0) += (
INDEX(ivec, 0) - grpstart);
1117 INDEX(ivec, 0) = grpstart;
1143 if (
map->pi_databufs[row][col] ==
NULL) {
1149 map->pi_databufs[row][col]->db_flags |=
PA_READ;
1195 if (dbufs ==
NULL || pbufs ==
NULL) {
1213 for (col = 0; col <
layout_n(play); ++col)
1214 if (
map->pi_databufs[row][col] !=
NULL) {
1216 map->pi_databufs[row][col]->db_buf;
1218 dbufs[col].
b_addr = (
void *)zpage;
1219 dbufs[col].
b_nob = pagesize;
1222 for (col = 0; col <
layout_k(play); ++col)
1223 pbufs[col] =
map->pi_paritybufs[row][col]->
1246 for (col = 0; col <
layout_k(play); ++col)
1247 pbufs[col] =
map->pi_paritybufs[row][col]->
1250 for (col = 0; col <
layout_n(play); ++col) {
1264 if (
map->pi_databufs[row][col] ==
NULL ||
1265 map->pi_databufs[row][col]->
1266 db_auxbuf.b_addr ==
NULL)
1269 dbufs[col] =
map->pi_databufs[row][col]->db_buf;
1270 old[col] =
map->pi_databufs[row][col]->db_auxbuf;
1272 old, dbufs, pbufs, col);
1311 uint32_t row_per_seg;
1318 obj =
map->pi_ioo->ioo_obj;
1319 op = &
map->pi_ioo->ioo_oo.oo_oc.oc_op;
1321 op_code =
op->op_code;
1332 row_per_seg =
rows_nr(play,
obj) / num_alloc;
1334 for (col = 0; col <
layout_k(play); ++col) {
1335 for (
i = 0;
i < num_alloc; ++
i) {
1342 for (row = 0; row < row_per_seg; ++row) {
1344 (
i*row_per_seg)+ row][col]);
1345 if (
map->pi_paritybufs[
1346 (
i*row_per_seg)+ row][col] ==
NULL)
1349 dbuf =
map->pi_paritybufs[
1350 (
i*row_per_seg)+ row][col];
1356 row, col, dbuf, pbuf,
ptr);
1364 instance->m0c_config->mc_is_read_verify))
1372 for (
i = 0;
i < col; ++
i) {
1373 for (row = 0; row <
rows_nr(play,
obj); ++row) {
1374 buf =
map->pi_paritybufs[row][col];
1376 if ((row % row_per_seg) == 0 )
1400 obj =
map->pi_ioo->ioo_obj;
1401 op = &
map->pi_ioo->ioo_oo.oo_oc.oc_op;
1406 for (row = 0; row <
rows_nr(play,
obj); ++row) {
1407 for (col = 0; col <
layout_k(play); ++col) {
1408 if (
map->pi_databufs[row][0] ==
NULL) {
1409 map->pi_paritybufs[row][col] =
1411 if (
map->pi_paritybufs[row][col] ==
NULL) {
1416 map->pi_paritybufs[row][col] =
1419 if (
map->pi_paritybufs[row][col] ==
NULL) {
1423 dbuf =
map->pi_paritybufs[row][col];
1431 for (; row > -1; --row) {
1432 for (col = 0; col <
layout_k(play); ++col) {
1433 if (
map->pi_databufs[row][0] ==
NULL) {
1435 pi_paritybufs[row][col]);
1436 map->pi_paritybufs[row][col] =
NULL;
1480 bufs =
map->pi_databufs;
1484 bufs =
map->pi_paritybufs;
1492 for (col = 0; col < col_nr; ++col) {
1493 for (row = 0; row < row_nr; ++row) {
1500 if (bufs[row][col] !=
NULL &&
1516 for (row = 0; row < row_nr; ++row) {
1517 if (bufs[row][col] ==
NULL) {
1520 if (bufs[row][col] ==
NULL) {
1582 uint32_t *spare_slot, uint32_t *spare_slot_prev,
1609 spare_slot, spare_slot_prev);
1615 spare.
sa_unit = *spare_slot_prev;
1637 uint32_t spare_slot;
1638 uint32_t spare_prev;
1644 map->pi_databufs[row][col] !=
NULL));
1646 map->pi_paritybufs[row][col] !=
NULL));
1649 map->pi_grpid, row, col, page_type);
1677 map->pi_databufs[row][col]->db_flags |=
1680 map->pi_paritybufs[row][col]->db_flags |=
1712 uint32_t spare_slot;
1713 uint32_t spare_slot_prev;
1757 ++
map->pi_ioo->ioo_dgmap_nr;
1787 if (
map->pi_paritybufs ==
NULL) {
1789 if (
map->pi_paritybufs ==
NULL)
1794 if (
map->pi_paritybufs[row] ==
NULL) {
1843 map->pi_grpid,
map->pi_state);
1856 for (col = 0; col <
layout_n(play); ++col) {
1857 for (row = 0; row <
rows_nr(play,
obj); ++row) {
1859 if (
map->pi_databufs[row][col] !=
NULL &&
1860 map->pi_databufs[row][col]->db_flags &
1871 map->pi_databufs[row][col] =
1873 if (
map->pi_databufs[row][col] ==
1884 dbuf =
map->pi_databufs[row][col];
1898 !
instance->m0c_config->mc_is_read_verify)
1921 for (row = 0; row <
rows_nr(play,
obj); ++row) {
1922 for (col = 0; col <
layout_k(play); ++col) {
1924 if (
map->pi_paritybufs[row][col] ==
NULL) {
1925 map->pi_paritybufs[row][col] =
1927 if (
map->pi_paritybufs[row][col] ==
NULL) {
1932 dbuf =
map->pi_paritybufs[row][col];
1957 for (col = 0; col <
layout_n(play); ++col) {
1958 if (
map->pi_databufs[0][col] !=
NULL &&
1959 map->pi_databufs[0][col]->db_flags &
1966 for (col = 0; col <
layout_k(play); ++col) {
1968 if (
map->pi_paritybufs[0][col]->db_flags &
2009 return M0_ERR_INFO(-ENOMEM,
"Failed to allocate memory" 2015 return M0_ERR_INFO(-ENOMEM,
"Failed to allocate memory" 2023 return M0_ERR_INFO(-ENOMEM,
"Failed to allocate page.");
2033 return M0_ERR_INFO(-ENOMEM,
"Failed to allocate memory " 2040 (
int)
map->pi_grpid);
2047 for (col = 0; col <
layout_n(play); ++col) {
2048 data[col].b_nob = pagesize;
2050 if (
map->pi_databufs[row][col] ==
NULL) {
2051 data[col].b_addr = (
void *)zpage;
2054 data[col].b_addr =
map->pi_databufs[row][col]->
2058 for (col = 0; col <
layout_k(play); ++col) {
2061 map->pi_paritybufs[row][col]->db_buf.b_addr;
2062 parity[col].b_nob = pagesize;
2080 "Number of failed units" 2081 "in parity group exceeds the" 2082 "total number of parity units" 2083 "in a parity group %d.", (
int)
map->pi_grpid);
2088 return *(uint32_t *)val1->
b_addr == *(uint32_t *)val2->
b_addr;
2139 instance->m0c_config->mc_is_read_verify))
2145 if (crc_arr ==
NULL) {
2170 ++row, crc_idx = 0) {
2171 dbuf =
map->pi_databufs[row][0];
2177 db_crc_set(dbuf, unit_id, &crc_arr[crc_idx++]);
2179 for (col = 0; col <
layout_k(play); ++col) {
2180 pbuf =
map->pi_paritybufs[row][col];
2190 db_crc_set(pbuf, unit_id, &crc_arr[crc_idx++]);
2198 "failed for %llu [%u:%u], rc %d",
2199 map->pi_ioo, (
unsigned long long)
map->pi_grpid,
2206 if (vote_nr < crc_idx) {
2211 map->pi_is_corrupted =
true;
2218 map->pi_databufs[row][0]->db_maj_ele = *mjr;
2219 for (col = 0; col <
layout_k(play); ++col) {
2220 map->pi_paritybufs[row][col]->db_maj_ele = *mjr;
2256 instance->m0c_config->mc_is_read_verify))
2270 for (col = 0; col <
layout_k(play); ++col) {
2277 pbufs[col].
b_addr = (
void *)page;
2278 pbufs[col].
b_nob = pagesize;
2283 for (col = 0; col <
layout_n(play); ++col) {
2284 if (
map->pi_databufs[row][col] !=
NULL) {
2286 map->pi_databufs[row][col]->db_buf;
2288 dbufs[col].
b_addr = zpage;
2289 dbufs[col].
b_nob = pagesize;
2298 for (col = 0; col <
layout_k(play); ++col) {
2299 old_pbuf = &
map->pi_paritybufs[row][col]->db_buf;
2303 "failed for %llu [%u:%u], rc %d",
2305 (
unsigned long long)
map->pi_grpid, row,
2311 "parity verified for %" PRIu64 " [%u:%u]",
2312 map->pi_grpid, row, col);
2318 if (pbufs !=
NULL) {
2319 for (col = 0; col <
layout_k(play); ++col) {
2323 pagesize, M0_NETBUF_SHIFT);
2363 uint32_t row_nr, uint32_t col_nr)
2372 for (row = 0; row < row_nr; ++row) {
2374 if (bufs[row] ==
NULL) {
2404 pargrp_iomap_bob_init(
map);
2408 map->pi_grpid = grpid;
2412 map->pi_trunc_partial =
false;
2423 map->pi_ivec.iv_vec.v_nr = 0;
2480 uint32_t row_per_seg;
2492 op = &
map->pi_ioo->ioo_oo.oo_oc.oc_op;
2502 row_per_seg =
rows_nr(play,
obj) / num_alloc;
2504 pargrp_iomap_bob_fini(
map);
2507 for (row = 0; row <
rows_nr(play,
obj); ++row) {
2509 map->pi_databufs[row][0] ==
NULL) {
2510 for (col_r = 0; col_r <
layout_k(play); ++col_r) {
2512 pi_paritybufs[row][col_r]);
2513 map->pi_paritybufs[row][col_r] =
NULL;
2517 for (col = 0; col <
layout_n(play); ++col) {
2518 if (
map->pi_databufs[row][col] !=
NULL) {
2520 pi_databufs[row][col]);
2521 map->pi_databufs[row][col] =
NULL;
2528 if (
map->pi_paritybufs !=
NULL) {
2529 for (col = 0; col <
layout_k(play); ++col) {
2530 for (row = 0; row <
rows_nr(play,
obj); ++row) {
2531 buf =
map->pi_paritybufs[row][col];
2534 (row % row_per_seg) == 0 ) {
2540 map->pi_paritybufs[row][col] =
NULL;
2546 for (row = 0; row <
rows_nr(play,
obj); ++row) {
2547 if (
map->pi_paritybufs !=
NULL)
2558 #undef M0_TRACE_SUBSYSTEM static m0_bcount_t seg_size
M0_INTERNAL void m0_ivec_cursor_init(struct m0_ivec_cursor *cur, const struct m0_indexvec *ivec)
M0_BOB_DEFINE(M0_INTERNAL, &pgiomap_bobtype, pargrp_iomap)
static void ptr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
M0_INTERNAL bool m0_pdclust_is_replicated(struct m0_pdclust_layout *play)
const struct m0_bob_type dtbuf_bobtype
#define M0_ALLOC_ARR(arr, nr)
static int pargrp_iomap_dgmode_process(struct pargrp_iomap *map, struct target_ioreq *tio, m0_bindex_t *index, uint32_t count)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
int const char const void size_t int flags
static m0_bcount_t seg_endpos(const struct m0_indexvec *ivec, uint32_t i)
static uint64_t pargrp_iomap_fullpages_count(struct pargrp_iomap *map)
M0_INTERNAL m0_bcount_t m0_ivec_cursor_step(const struct m0_ivec_cursor *cur)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
M0_INTERNAL m0_bindex_t m0_ivec_cursor_conti(const struct m0_ivec_cursor *cur, m0_bindex_t dest)
static bool data_buf_invariant_nr(const struct pargrp_iomap *map)
static void mark_page_as_read_failed(struct pargrp_iomap *map, uint32_t row, uint32_t col, enum page_attr page_type)
static int pargrp_iomap_populate(struct pargrp_iomap *map, struct m0_ivec_cursor *cursor, struct m0_bufvec_cursor *buf_cursor)
#define M0_LOG(level,...)
static uint32_t layout_k(const struct m0_pdclust_layout *play)
static int pargrp_iomap_readrest(struct pargrp_iomap *map)
static int pargrp_iomap_parity_recalc(struct pargrp_iomap *map)
M0_INTERNAL bool data_buf_invariant(const struct data_buf *db)
M0_INTERNAL int m0_sns_repair_spare_map(struct m0_poolmach *pm, const struct m0_fid *fid, struct m0_pdclust_layout *pl, struct m0_pdclust_instance *pi, uint64_t group, uint64_t unit, uint32_t *spare_slot_out, uint32_t *spare_slot_out_prev)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
static bool is_page_read(struct data_buf *dbuf)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
static int pargrp_iomap_replica_elect(struct pargrp_iomap *map)
M0_INTERNAL void m0_free_aligned(void *data, size_t size, unsigned shift)
M0_INTERNAL void * m0_bufvec_cursor_addr(struct m0_bufvec_cursor *cur)
M0_INTERNAL int m0_poolmach_device_state(struct m0_poolmach *pm, uint32_t device_index, enum m0_pool_nd_state *state_out)
M0_INTERNAL int m0_parity_math_recover(struct m0_parity_math *math, struct m0_buf *data, struct m0_buf *parity, struct m0_buf *fails, enum m0_parity_linsys_algo algo)
static uint64_t round_up(uint64_t val, uint64_t size)
M0_INTERNAL bool pargrp_iomap_invariant(const struct pargrp_iomap *map)
M0_INTERNAL int m0_parity_math_diff(struct m0_parity_math *math, struct m0_buf *old, struct m0_buf *new, struct m0_buf *parity, uint32_t index)
M0_INTERNAL bool m0__is_update_op(struct m0_op *op)
static struct data_buf * data_buf_alloc_init(struct m0_obj *obj, enum page_attr pattr)
M0_INTERNAL const struct m0_key_val M0_KEY_VAL_NULL
static const struct pargrp_iomap_ops iomap_ops
M0_INTERNAL bool m0_ivec_cursor_move_to(struct m0_ivec_cursor *cur, m0_bindex_t dest)
M0_INTERNAL void pargrp_iomap_fini(struct pargrp_iomap *map, struct m0_obj *obj)
static bool pargrp_iomap_spans_seg(struct pargrp_iomap *map, m0_bindex_t index, m0_bcount_t count)
M0_INTERNAL uint64_t m0_round_up(uint64_t val, uint64_t size)
static int io_spare_map(const struct pargrp_iomap *map, const struct m0_pdclust_src_addr *src, uint32_t *spare_slot, uint32_t *spare_slot_prev, enum m0_pool_nd_state *eff_state)
M0_INTERNAL void m0_parity_math_calculate(struct m0_parity_math *math, struct m0_buf *data, struct m0_buf *parity)
static struct data_buf * data_buf_replicate_init(struct pargrp_iomap *map, int row, enum page_attr pattr)
static bool crc_cmp(const struct m0_buf *val1, const struct m0_buf *val2)
static uint32_t unit_size
M0_INTERNAL bool pargrp_iomap_invariant_nr(const struct m0_op_io *ioo)
M0_INTERNAL bool m0_bufvec_cursor_move(struct m0_bufvec_cursor *cur, m0_bcount_t count)
static void pargrp_iomap_bufs_free(struct data_buf ***bufs, int nr)
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 uint32_t rows_nr(struct m0_pdclust_layout *play)
#define M0_ERR_INFO(rc, fmt,...)
return M0_ERR(-EOPNOTSUPP)
static void db_crc_set(struct data_buf *dbuf, uint32_t key, struct m0_key_val *kv)
M0_INTERNAL struct m0_poolmach * ioo_to_poolmach(struct m0_op_io *ioo)
M0_INTERNAL struct m0_client * m0__op_instance(const struct m0_op *op)
int(* pi_populate)(struct pargrp_iomap *iomap, struct m0_ivec_varr_cursor *cursor)
static uint64_t page_nr(m0_bcount_t size)
static void seg_idx_inc_round(struct pargrp_iomap *map, uint32_t seg, uint64_t sz)
static void data_buf_init(struct data_buf *buf, void *addr, uint64_t addr_size, uint64_t flags)
M0_INTERNAL void m0_crc32(const void *data, uint64_t len, uint64_t *cksum)
M0_INTERNAL void m0_key_val_init(struct m0_key_val *kv, const struct m0_buf *key, const struct m0_buf *val)
M0_INTERNAL uint64_t pargrp_id_find(m0_bindex_t index, const struct m0_op_io *ioo, const struct ioreq_fop *ir_fop)
static struct m0_pdclust_instance * pdlayout_instance(const struct m0_layout_instance *li)
static void pargrp_src_addr(m0_bindex_t index, const struct m0_op_io *ioo, const struct target_ioreq *tio_req, struct m0_pdclust_src_addr *src)
enum m0_pbuf_type ioo_pbuf_type
static uint64_t layout_unit_size(const struct m0_pdclust_layout *play)
static int pargrp_iomap_pages_mark_as_failed(struct pargrp_iomap *map, enum m0_pdclust_unit_type type)
void * m0_alloc(size_t size)
static int pargrp_iomap_parity_verify(struct pargrp_iomap *map)
static int pargrp_iomap_dgmode_postprocess(struct pargrp_iomap *map)
const struct m0_bob_type pgiomap_bobtype
static int pargrp_iomap_populate_pi_ivec(struct pargrp_iomap *map, struct m0_ivec_cursor *cursor, struct m0_bufvec_cursor *buf_cursor, bool rmw)
static m0_bindex_t offset
static int pargrp_iomap_readold_auxbuf_alloc(struct pargrp_iomap *map)
M0_INTERNAL void m0_fd_bwd_map(struct m0_pdclust_instance *pi, const struct m0_pdclust_tgt_addr *tgt, struct m0_pdclust_src_addr *src)
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
static uint64_t min64u(uint64_t a, uint64_t b)
M0_INTERNAL bool m0_ivec_cursor_move(struct m0_ivec_cursor *cur, m0_bcount_t count)
struct m0_op_common oo_oc
static void page_pos_get(struct pargrp_iomap *map, m0_bindex_t index, uint32_t *row, uint32_t *col)
static void data_buf_fini(struct data_buf *buf)
static uint64_t data_size(const struct m0_pdclust_layout *play)
M0_INTERNAL bool addr_is_network_aligned(void *addr)
M0_INTERNAL m0_bcount_t m0_vec_count(const struct m0_vec *vec)
static uint64_t round_down(uint64_t val, uint64_t size)
static uint32_t layout_n(const struct m0_pdclust_layout *play)
static struct m0_pdclust_layout * pdlayout_get(const struct io_request *req)
static bool are_pbufs_allocated(struct m0_op_io *ioo)
#define m0_forall(var, nr,...)
static size_t offset_get(struct pargrp_iomap *map)
struct m0_pdclust_tgt_addr tgt
static uint8_t fail[DATA_UNIT_COUNT_MAX+PARITY_UNIT_COUNT_MAX]
static struct m0_parity_math * parity_math(struct io_request *req)
static int pargrp_iomap_bufs_alloc(struct data_buf ****bufs_out, uint32_t row_nr, uint32_t col_nr)
struct target_ioreq * irf_tioreq
#define M0_BUF_INIT_PTR(p)
static int pargrp_iomap_select_ro_rr(struct pargrp_iomap *map, m0_bcount_t data_pages_nr, m0_bcount_t parity_pages_nr)
#define M0_FI_ENABLED(tag)
static struct m0_layout_instance * layout_instance(const struct io_request *req)
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 int64_t min64(int64_t a, int64_t b)
static int pargrp_iomap_paritybufs_alloc(struct pargrp_iomap *map)
static int unit_state(const struct m0_pdclust_src_addr *src, struct m0_op_io *ioo, enum m0_pool_nd_state *state)
static uint32_t iomap_dgmode_recov_prepare(struct pargrp_iomap *map, uint8_t *failed)
M0_INTERNAL uint64_t obj_buffer_size(const struct m0_obj *obj)
static uint64_t parity_units_page_nr(const struct m0_pdclust_layout *play)
static m0_bindex_t seg_set(struct pargrp_iomap *map, uint32_t seg, struct m0_ivec_cursor *cur, m0_bindex_t grpend)
static int start(struct m0_fom *fom)
M0_INTERNAL m0_bindex_t m0_ivec_cursor_index(const struct m0_ivec_cursor *cur)
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 struct m0_client * m0__obj_instance(const struct m0_obj *obj)
static struct m0_be_seg * seg
static uint64_t pargrp_iomap_auxbuf_alloc(struct pargrp_iomap *map, uint32_t row, uint32_t col)
M0_INTERNAL void * m0_vote_majority_get(struct m0_key_val *arr, uint32_t len, bool(*cmp)(const struct m0_buf *, const struct m0_buf *), uint32_t *vote_nr)
M0_INTERNAL uint64_t m0__page_size(const struct m0_op_io *ioo)
static void seg_align(struct pargrp_iomap *map, uint32_t seg, m0_bindex_t end, uint64_t sz)
static void data_buf_dealloc_fini(struct data_buf *buf)
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
struct target_ioreq * db_tioreq
static uint64_t iomap_page_nr(struct pargrp_iomap *map)
M0_INTERNAL void m0_fd_fwd_map(struct m0_pdclust_instance *pi, const struct m0_pdclust_src_addr *src, struct m0_pdclust_tgt_addr *tgt)
struct m0_pdclust_src_addr src
#define offsetof(typ, memb)
M0_INTERNAL int pargrp_iomap_init(struct pargrp_iomap *map, struct m0_op_io *ioo, uint64_t grpid)
static uint8_t parity[DATA_UNIT_COUNT_MAX][UNIT_BUFF_SIZE_MAX]
M0_INTERNAL uint64_t m0_pdclust_unit_size(const struct m0_pdclust_layout *pl)
struct pargrp_iomap ** ioo_iomaps
static struct m0_addb2_frame_header last
static int pargrp_iomap_databuf_replicate(struct pargrp_iomap *map)
M0_INTERNAL bool m0_op_io_invariant(const struct m0_op_io *iop)