Motr  M0
pargrp_iomap_ops Struct Reference

#include <file_internal.h>

Collaboration diagram for pargrp_iomap_ops:
Collaboration graph

Data Fields

int(* pi_populate )(struct pargrp_iomap *iomap, struct m0_ivec_varr_cursor *cursor)
 
bool(* pi_spans_seg )(struct pargrp_iomap *iomap, m0_bindex_t index, m0_bcount_t count)
 
int(* pi_readrest )(struct pargrp_iomap *iomap)
 
uint64_t(* pi_fullpages_find )(struct pargrp_iomap *map)
 
int(* pi_seg_process )(struct pargrp_iomap *map, uint64_t segid, bool rmw)
 
int(* pi_readold_auxbuf_alloc )(struct pargrp_iomap *map)
 
int(* pi_parity_recalc )(struct pargrp_iomap *map)
 
int(* pi_parity_verify )(struct pargrp_iomap *map)
 
int(* pi_paritybufs_alloc )(struct pargrp_iomap *map)
 
int(* pi_dgmode_process )(struct pargrp_iomap *map, struct target_ioreq *tio, m0_bindex_t *index, uint32_t count)
 
int(* pi_dgmode_postprocess )(struct pargrp_iomap *map)
 
int(* pi_dgmode_recover )(struct pargrp_iomap *map)
 
int(* pi_databuf_alloc )(struct pargrp_iomap *map, uint32_t row, uint32_t col, struct m0_bufvec_cursor *buf_cursor)
 
int(* pi_parity_replica_verify )(struct pargrp_iomap *map)
 
int(* pi_data_replicate )(struct pargrp_iomap *map)
 
int(* pi_replica_recover )(struct pargrp_iomap *map)
 

Detailed Description

Operations vector for struct pargrp_iomap.

Definition at line 1561 of file file_internal.h.

Field Documentation

◆ pi_data_replicate

int(* pi_data_replicate) (struct pargrp_iomap *map)

In case of a replicated layout this method replicates data into parity buffers.

Definition at line 515 of file pg.h.

◆ pi_databuf_alloc

int(* pi_databuf_alloc) (struct pargrp_iomap *map, uint32_t row, uint32_t col, struct m0_bufvec_cursor *buf_cursor)

Definition at line 485 of file pg.h.

◆ pi_dgmode_postprocess

int(* pi_dgmode_postprocess)(struct pargrp_iomap *map)

Marks all but the failed pages with flag PA_DGMODE_READ in data matrix and parity matrix.

Definition at line 1673 of file file_internal.h.

◆ pi_dgmode_process

int(* pi_dgmode_process)(struct pargrp_iomap *map, struct target_ioreq *tio, m0_bindex_t *index, uint32_t count)

Does necessary processing for degraded mode read IO. Marks pages belonging to failed targets with a flag PA_READ_FAILED.

Parameters
indexArray of target indices that fall in given parity group. These are converted to global file offsets.
countNumber of segments provided.
Precondition
map->pi_state == PI_HEALTHY.
Postcondition
map->pi_state == PI_DEGRADED.

Definition at line 1664 of file file_internal.h.

◆ pi_dgmode_recover

int(* pi_dgmode_recover)(struct pargrp_iomap *map)

Recovers lost unit/s by using data recover APIs from underlying parity algorithm.

Precondition
map->pi_state == PI_DEGRADED.
Postcondition
map->pi_state == PI_HEALTHY.

Definition at line 1681 of file file_internal.h.

◆ pi_fullpages_find

uint64_t(* pi_fullpages_find)(struct pargrp_iomap *map)

Finds out the number of pages completely spanned by incoming io vector. Used only in case of read-modify-write IO. This is needed in order to decide the type of read approach {read_old, read_rest} for the given parity group.

Precondition
pargrp_iomap_invariant(map). Number of pages completely spanned by pargrp_iomap::pi_ivec.

Definition at line 1608 of file file_internal.h.

◆ pi_parity_recalc

int(* pi_parity_recalc)(struct pargrp_iomap *map)

Recalculates parity for given pargrp_iomap.

Precondition
map != NULL && map->pi_ioreq->ir_type == IRT_WRITE.

Definition at line 1637 of file file_internal.h.

◆ pi_parity_replica_verify

int(* pi_parity_replica_verify) (struct pargrp_iomap *map)

In case of a replicated layout this compares the members of a parity group for equality.

Definition at line 509 of file pg.h.

◆ pi_parity_verify

int(* pi_parity_verify)(struct pargrp_iomap *map)

verify parity for given pargrp_iomap for read operation and in 'parity verify' mode, after data and parity units are all already read from ioserive.

Precondition
map != NULL

Definition at line 1645 of file file_internal.h.

◆ pi_paritybufs_alloc

int(* pi_paritybufs_alloc)(struct pargrp_iomap *map)

Allocates data_buf structures for pargrp_iomap::pi_paritybufs and populate db_flags accordingly.

Precondition
map->pi_paritybufs == NULL.
Postcondition
map->pi_paritybufs != NULL && pargrp_iomap_invariant(map).

Definition at line 1653 of file file_internal.h.

◆ pi_populate

int(* pi_populate)(struct pargrp_iomap *iomap, struct m0_ivec_cursor *cursor, struct m0_bufvec_cursor *buf_cursor)

Populates pargrp_iomap::pi_ivec by deciding whether to follow read-old approach or read-rest approach. pargrp_iomap::pi_rtype will be set to PIR_READOLD or PIR_READREST accordingly.

Parameters
cursorSource index vector cursor from which pargrp_iomap::pi_ivec will be populated. Typically, this is io_request::ir_ivec.
Precondition
iomap != NULL && ivec != NULL && m0_vec_count(&ivec->iv_vec) > 0 && cursor != NULL && m0_vec_count(&iomap->iv_vec) == 0
Postcondition
m0_vec_count(&iomap->iv_vec) > 0 && iomap->pi_databufs != NULL.

Populates pargrp_iomap::pi_ivec by deciding whether to follow read-old approach or read-rest approach. pargrp_iomap::pi_rtype will be set to PIR_READOLD or PIR_READREST accordingly.

Parameters
cursorSource index vector cursor from which pargrp_iomap::pi_ivec will be populated. Typically, this is m0_op_io::ioo_ext.
Precondition
iomap != NULL && ivec != NULL && m0_vec_count(&ivec->iv_vec) > 0 && cursor != NULL && m0_vec_count(&iomap->iv_vec) == 0
Postcondition
m0_vec_count(&iomap->iv_vec) > 0 && iomap->pi_databufs != NULL.

Definition at line 1576 of file file_internal.h.

◆ pi_readold_auxbuf_alloc

int(* pi_readold_auxbuf_alloc)(struct pargrp_iomap *map)

Process the data buffers in pargrp_iomap::pi_databufs when read-old approach is chosen. Auxiliary buffers are allocated here.

Precondition
pargrp_iomap_invariant(map) && map->pi_rtype == PIR_READOLD.

Processes the data buffers in pargrp_iomap::pi_databufs when read-old approach is chosen. Auxiliary buffers are allocated here.

Precondition
pargrp_iomap_invariant(map) && map->pi_rtype == PIR_READOLD.

Definition at line 1631 of file file_internal.h.

◆ pi_readrest

int(* pi_readrest)(struct pargrp_iomap *iomap)

Changes pargrp_iomap::pi_ivec to suit read-rest approach for an RMW IO request.

Precondition
pargrp_iomap_invariant(iomap).
Postcondition
pargrp_iomap_invariant(iomap).

Definition at line 1598 of file file_internal.h.

◆ pi_replica_recover

int(* pi_replica_recover) (struct pargrp_iomap *map)

In case of degraded mode picks the replica with majority.

Definition at line 556 of file pg.h.

◆ pi_seg_process

int(* pi_seg_process)(struct pargrp_iomap *map, uint32_t segid, bool rmw, uint64_t start_buf_index, struct m0_bufvec_cursor *buf_cursor)

Process segment pointed to by segid in pargrp_iomap::pi_ivec and allocate data_buf structures correspondingly. It also populates data_buf::db_flags for pargrp_iomap::pi_databufs.

Parameters
segidSegment id which needs to be processed. Given seg id should point to last segment in pargrp_iomap::pi_ivec when invoked.
rmwIf given pargrp_iomap structure needs rmw.
Precondition
map != NULL.
Postcondition
pargrp_iomap_invariant(map).

Processes segment pointed to by segid in pargrp_iomap::pi_ivec and allocate data_buf structures correspondingly. It also populates data_buf::db_flags for pargrp_iomap::pi_databufs.

Parameters
segidSegment identifier which needs to be processed. Given seg id should point to last segment in pargrp_iomap::pi_ivec when invoked.
rmwIf given pargrp_iomap structure needs rmw.
Precondition
map != NULL.
Postcondition
pargrp_iomap_invariant(map).

Definition at line 1621 of file file_internal.h.

◆ pi_spans_seg

bool(* pi_spans_seg)(struct pargrp_iomap *iomap, m0_bindex_t index, m0_bcount_t count)

Returns true if the given segment is spanned by existing segments in pargrp_iomap::pi_ivec.

Parameters
indexStarting index of incoming segment.
countCount of incoming segment.
Precondition
pargrp_iomap_invariant(iomap). true if segment is found in pargrp_iomap::pi_ivec, false otherwise.

Definition at line 1588 of file file_internal.h.


The documentation for this struct was generated from the following files: