|
| M0_BOB_DEFINE (M0_INTERNAL, &pgiomap_bobtype, pargrp_iomap) |
|
| M0_BOB_DEFINE (M0_INTERNAL, &dtbuf_bobtype, data_buf) |
|
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) |
|
M0_INTERNAL uint64_t | pargrp_id_find (m0_bindex_t index, const struct m0_op_io *ioo, const struct ioreq_fop *ir_fop) |
|
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 bool | is_page_read (struct data_buf *dbuf) |
|
M0_INTERNAL bool | data_buf_invariant (const struct data_buf *db) |
|
static bool | data_buf_invariant_nr (const struct pargrp_iomap *map) |
|
M0_INTERNAL bool | pargrp_iomap_invariant (const struct pargrp_iomap *map) |
|
M0_INTERNAL bool | pargrp_iomap_invariant_nr (const struct m0_op_io *ioo) |
|
static void | data_buf_init (struct data_buf *buf, void *addr, uint64_t addr_size, uint64_t flags) |
|
static void | data_buf_fini (struct data_buf *buf) |
|
static void | data_buf_dealloc_fini (struct data_buf *buf) |
|
static struct data_buf * | data_buf_alloc_init (struct m0_obj *obj, enum page_attr pattr) |
|
static struct data_buf * | data_buf_replicate_init (struct pargrp_iomap *map, int row, enum page_attr pattr) |
|
static m0_bindex_t | seg_set (struct pargrp_iomap *map, uint32_t seg, struct m0_ivec_cursor *cur, m0_bindex_t grpend) |
|
static void | seg_idx_inc_round (struct pargrp_iomap *map, uint32_t seg, uint64_t sz) |
|
static void | seg_align (struct pargrp_iomap *map, uint32_t seg, m0_bindex_t end, uint64_t sz) |
|
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 int | pargrp_iomap_select_ro_rr (struct pargrp_iomap *map, m0_bcount_t data_pages_nr, m0_bcount_t parity_pages_nr) |
|
static int | pargrp_iomap_populate (struct pargrp_iomap *map, struct m0_ivec_cursor *cursor, struct m0_bufvec_cursor *buf_cursor) |
|
static uint64_t | pargrp_iomap_fullpages_count (struct pargrp_iomap *map) |
|
static bool | pargrp_iomap_spans_seg (struct pargrp_iomap *map, m0_bindex_t index, m0_bcount_t count) |
|
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) |
|
static int | pargrp_iomap_databuf_alloc (struct pargrp_iomap *map, uint32_t row, uint32_t col, struct m0_bufvec_cursor *data) |
|
static uint64_t | pargrp_iomap_auxbuf_alloc (struct pargrp_iomap *map, uint32_t row, uint32_t col) |
|
static int | pargrp_iomap_readold_auxbuf_alloc (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_readrest (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_parity_recalc (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_paritybufs_alloc (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_databuf_replicate (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_pages_mark_as_failed (struct pargrp_iomap *map, enum m0_pdclust_unit_type type) |
|
static int | unit_state (const struct m0_pdclust_src_addr *src, struct m0_op_io *ioo, enum m0_pool_nd_state *state) |
|
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) |
|
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_dgmode_process (struct pargrp_iomap *map, struct target_ioreq *tio, m0_bindex_t *index, uint32_t count) |
|
static int | pargrp_iomap_dgmode_postprocess (struct pargrp_iomap *map) |
|
static uint32_t | iomap_dgmode_recov_prepare (struct pargrp_iomap *map, uint8_t *failed) |
|
static int | pargrp_iomap_dgmode_recover (struct pargrp_iomap *map) |
|
static bool | crc_cmp (const struct m0_buf *val1, const struct m0_buf *val2) |
|
static void | db_crc_set (struct data_buf *dbuf, uint32_t key, struct m0_key_val *kv) |
|
static size_t | offset_get (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_replica_elect (struct pargrp_iomap *map) |
|
static int | pargrp_iomap_parity_verify (struct pargrp_iomap *map) |
|
static void | pargrp_iomap_bufs_free (struct data_buf ***bufs, int nr) |
|
static int | pargrp_iomap_bufs_alloc (struct data_buf ****bufs_out, uint32_t row_nr, uint32_t col_nr) |
|
M0_INTERNAL int | pargrp_iomap_init (struct pargrp_iomap *map, struct m0_op_io *ioo, uint64_t grpid) |
|
static bool | are_pbufs_allocated (struct m0_op_io *ioo) |
|
M0_INTERNAL void | pargrp_iomap_fini (struct pargrp_iomap *map, struct m0_obj *obj) |
|
static int pargrp_iomap_readrest |
( |
struct pargrp_iomap * |
map | ) |
|
|
static |
Reads the remainder of a parity group row so that parity can be generated in a read-modify-write scenario. This is heavily based on m0t1fs/linux_kernel/file.cpargrp_iomap_readrest
A read request from rmw IO request can lead to either:
read_old - Read the old data for the extent spanned by current IO request, along with the old parity unit. This approach needs to calculate new parity in iterative manner. This approach is selected only if current IO extent lies within file size.
read_rest - Read rest of the parity group, which is not spanned by current IO request, so that data for whole parity group can be availble for parity calculation. This approach reads the extent from start of parity group to the point where a page is completely spanned by incoming IO request.
Typically, the approach which leads to least size of data to be read and written from server is selected.
N = 5, P = 1, K = 1, unit_size = 4k F => Fully occupied P' => Partially occupied
=> Parity unit
- => Spare unit x => Start of actual file extent. y => End of actual file extent. a => Rounded down value of x. b => Rounded up value of y.
Read-rest approach (XXX Sining: these diagrams don't seem right)
a x +—+—+—+—+—+—+—+ | | P'| F | F | F | # | * | PG#0 +—+—+—+—+—+—+—+ | F | F | F | F | F | # | * | PG#1 +—+—+—+—+—+—+—+ | F | F | F | P'| | # | * | PG#2 +—+—+—+—+—+—+—+ N N N N N K P y b
Read-old approach
a x +—+—+—+—+—+—+—+ | | | | P'| F | # | * | PG#0 +—+—+—+—+—+—+—+ | F | F | F | F | F | # | * | PG#1 +—+—+—+—+—+—+—+ | F | P'| | | | # | * | PG#2 +—+—+—+—+—+—+—+ N N N N N K P y b
Definition at line 1084 of file io_pargrp.c.
Decides whether to undertake a read-old or read-rest approach for the parity group RMW IO request based on the total number of pages to be read and written.
In read-old approach, the old data and parity units are read and the new parity is calculated incrementally based on the difference between old and new data and parity units.
In read-rest approach, the rest data units of the group are read and the new parity is calculated based on them and the new data units to be written.
In both approaches, the number of units to be written is the same (new data units and udpated parity units), so we compare only the number of units (pages) to be read.
By default, the segments in index vector pargrp_iomap::pi_ivec are suitable for read-old approach. Hence the index vector is changed only if read-rest approach is selected.
- Parameters
-
map | is the parity group iomap |
data_pages_nr | is the number of data pages in group |
parity_pages_nr | is the number of parity pages in group |
Definition at line 533 of file io_pargrp.c.
Initial value:= {
.bt_name = "pargrp_iomap_bobtype",
}
#define offsetof(typ, memb)
Explantation of object block, parity group unit and page.
An object is viewed as a stream of blocks (1-dimension). When an object is stored in motr, it is transformed into a 2-dimenional parity group matrix. The size of object block is set by Client applications and should be >= (1 >> M0_MIN_BUF_SHIFT) and <= parity group unit size. So a number of blocks may be assemblied into one parity data unit and stored together.
page is something Client inherits from m0t1fs as m0t1fs uses kernel pages. It serves as the in-memory representation of an object block.BOB types for the assorted parts of io requests and nwxfer
BOB initialisation for the assorted parts of io requests and nwxfer
Definition at line 54 of file io_pargrp.c.