Motr  M0
io.h File Reference
Include dependency graph for io.h:

Go to the source code of this file.

Macros

#define __MOTR_IO_H__
 
#define INDEX(ivec, i)   ((ivec)->iv_index[(i)])
 
#define COUNT(ivec, i)   ((ivec)->iv_vec.v_count[(i)])
 
#define BUFVI(ovec, i)   ((ovec)->ov_buf[(i)])
 
#define BUFVC(ovec, i)   ((ovec)->ov_vec.v_count[(i)])
 
#define SEG_NR(vec)   ((vec)->iv_vec.v_nr)
 
#define SHIFT2MASK(x)   ~((1ULL<<x) -1)
 

Functions

 M0_BOB_DECLARE (M0_INTERNAL, m0_op_io)
 
 M0_BOB_DECLARE (M0_INTERNAL, ioreq_fop)
 
 M0_BOB_DECLARE (M0_INTERNAL, target_ioreq)
 
 M0_BOB_DECLARE (M0_INTERNAL, nw_xfer_request)
 
 M0_BOB_DECLARE (M0_INTERNAL, pargrp_iomap)
 
 M0_BOB_DECLARE (M0_INTERNAL, data_buf)
 
 M0_TL_DESCR_DECLARE (iofops, M0_EXTERN)
 
 M0_TL_DECLARE (iofops, M0_INTERNAL, struct ioreq_fop)
 
 M0_TL_DECLARE (rpcbulk, M0_INTERNAL, struct m0_rpc_bulk_buf)
 
 M0_TL_DESCR_DECLARE (rpcbulk, M0_EXTERN)
 
 M0_TL_DECLARE (tioreqht, M0_EXTERN, struct target_ioreq)
 
 M0_TL_DESCR_DECLARE (tioreqht, M0_EXTERN)
 
 M0_HT_DESCR_DECLARE (tioreqht, M0_EXTERN)
 
 M0_HT_DECLARE (tioreqht, M0_EXTERN, struct target_ioreq, uint64_t)
 
M0_INTERNAL bool addr_is_network_aligned (void *addr)
 
M0_INTERNAL uint64_t obj_buffer_size (const struct m0_obj *obj)
 
M0_INTERNAL uint64_t m0__page_size (const struct m0_op_io *ioo)
 
M0_INTERNAL uint64_t page_nr (m0_bcount_t size, struct m0_obj *obj)
 
M0_INTERNAL uint32_t layout_n (struct m0_pdclust_layout *play)
 
M0_INTERNAL uint32_t layout_k (struct m0_pdclust_layout *play)
 
M0_INTERNAL uint64_t page_id (m0_bindex_t offset, struct m0_obj *obj)
 
M0_INTERNAL uint64_t layout_unit_size (struct m0_pdclust_layout *play)
 
M0_INTERNAL uint32_t rows_nr (struct m0_pdclust_layout *play, struct m0_obj *obj)
 
M0_INTERNAL uint64_t data_size (struct m0_pdclust_layout *play)
 
M0_INTERNAL struct m0_pdclust_instancepdlayout_instance (struct m0_layout_instance *li)
 
M0_INTERNAL struct m0_pdclust_layoutpdlayout_get (const struct m0_op_io *ioo)
 
M0_INTERNAL struct m0_layout_instancelayout_instance (const struct m0_op_io *ioo)
 
M0_INTERNAL struct m0_parity_mathparity_math (struct m0_op_io *ioo)
 
M0_INTERNAL uint64_t target_offset (uint64_t frame, struct m0_pdclust_layout *play, m0_bindex_t gob_offset)
 
M0_INTERNAL uint32_t di_cksum_offset (struct m0_pdclust_layout *play, m0_bindex_t gob_offset)
 
M0_INTERNAL uint64_t group_id (m0_bindex_t index, m0_bcount_t dtsize)
 
M0_INTERNAL m0_bcount_t seg_endpos (const struct m0_indexvec *ivec, uint32_t i)
 
M0_INTERNAL uint64_t indexvec_page_nr (const struct m0_vec *vec, struct m0_obj *obj)
 
M0_INTERNAL uint64_t iomap_page_nr (const struct pargrp_iomap *map)
 
M0_INTERNAL uint64_t parity_units_page_nr (struct m0_pdclust_layout *play, struct m0_obj *obj)
 
M0_INTERNAL uint64_t round_down (uint64_t val, uint64_t size)
 
M0_INTERNAL uint64_t round_up (uint64_t val, uint64_t size)
 
M0_INTERNAL uint32_t io_desc_size (struct m0_net_domain *ndom)
 
M0_INTERNAL uint32_t io_seg_size (void)
 
M0_INTERNAL void page_pos_get (struct pargrp_iomap *map, m0_bindex_t index, m0_bindex_t grp_size, uint32_t *row, uint32_t *col)
 
M0_INTERNAL m0_bindex_t data_page_offset_get (struct pargrp_iomap *map, uint32_t row, uint32_t col)
 
M0_INTERNAL uint32_t ioreq_sm_state (const struct m0_op_io *ioo)
 
M0_INTERNAL uint64_t tolerance_of_level (struct m0_op_io *ioo, uint64_t lv)
 
M0_INTERNAL struct m0_rm_domainrm_domain_get (struct m0_client *instance)
 
M0_INTERNAL struct m0_poolmachioo_to_poolmach (struct m0_op_io *ioo)
 
M0_INTERNAL bool nw_xfer_request_invariant (const struct nw_xfer_request *xfer)
 
M0_INTERNAL void target_ioreq_fini (struct target_ioreq *ti)
 
M0_INTERNAL void target_ioreq_cancel (struct target_ioreq *ti)
 
M0_INTERNAL struct m0_fid target_fid (struct m0_op_io *ioo, struct m0_pdclust_tgt_addr *tgt)
 
M0_INTERNAL void nw_xfer_request_init (struct nw_xfer_request *xfer)
 
M0_INTERNAL void nw_xfer_request_fini (struct nw_xfer_request *xfer)
 
M0_INTERNAL bool ioreq_fop_invariant (const struct ioreq_fop *fop)
 
M0_INTERNAL int ioreq_fop_async_submit (struct m0_io_fop *iofop, struct m0_rpc_session *session)
 
M0_INTERNAL int ioreq_fop_init (struct ioreq_fop *fop, struct target_ioreq *ti, enum page_attr pattr)
 
M0_INTERNAL void ioreq_fop_fini (struct ioreq_fop *fop)
 
M0_INTERNAL int ioreq_cc_fop_init (struct target_ioreq *ti)
 
M0_INTERNAL int ioreq_fop_dgmode_read (struct ioreq_fop *irfop)
 
M0_INTERNAL void ioreq_sm_state_set_locked (struct m0_op_io *ioo, int state)
 
M0_INTERNAL void ioreq_sm_failed_locked (struct m0_op_io *ioo, int rc)
 
M0_INTERNAL bool data_buf_invariant (const struct data_buf *db)
 
M0_INTERNAL uint64_t pargrp_id_find (m0_bindex_t index, const struct m0_op_io *ioo, const struct ioreq_fop *ir_fop)
 
M0_INTERNAL bool pargrp_iomap_invariant (const struct pargrp_iomap *map)
 
M0_INTERNAL bool pargrp_iomap_invariant_nr (const struct m0_op_io *ioo)
 
M0_INTERNAL int pargrp_iomap_init (struct pargrp_iomap *map, struct m0_op_io *ioo, uint64_t grpid)
 
M0_INTERNAL void pargrp_iomap_fini (struct pargrp_iomap *map, struct m0_obj *obj)
 
M0_INTERNAL struct m0_obj_attrm0_io_attr (struct m0_op_io *ioo)
 

Variables

struct m0_sm_conf io_sm_conf
 
const struct m0_op_io_ops ioo_ops
 
const struct m0_op_io_ops ioo_oostore_ops
 
const struct m0_uint128 m0_rm_group
 
const struct m0_bob_type ioo_bobtype
 
struct m0_bob_type iofop_bobtype
 
const struct m0_bob_type tioreq_bobtype
 
const struct m0_bob_type nwxfer_bobtype
 
const struct m0_bob_type pgiomap_bobtype
 
const struct m0_bob_type dtbuf_bobtype
 

Macro Definition Documentation

◆ __MOTR_IO_H__

#define __MOTR_IO_H__

Definition at line 26 of file io.h.

◆ BUFVC

#define BUFVC (   ovec,
  i 
)    ((ovec)->ov_vec.v_count[(i)])

Definition at line 38 of file io.h.

◆ BUFVI

#define BUFVI (   ovec,
  i 
)    ((ovec)->ov_buf[(i)])

Definition at line 37 of file io.h.

◆ COUNT

#define COUNT (   ivec,
  i 
)    ((ivec)->iv_vec.v_count[(i)])

Definition at line 36 of file io.h.

◆ INDEX

#define INDEX (   ivec,
  i 
)    ((ivec)->iv_index[(i)])

Definition at line 35 of file io.h.

◆ SEG_NR

#define SEG_NR (   vec)    ((vec)->iv_vec.v_nr)

Definition at line 40 of file io.h.

◆ SHIFT2MASK

#define SHIFT2MASK (   x)    ~((1ULL<<x) -1)

This is used to extract the offset within an otherwise aligned block

Definition at line 43 of file io.h.

Function Documentation

◆ addr_is_network_aligned()

M0_INTERNAL bool addr_is_network_aligned ( void *  addr)

Determines whether the provided pointer is aligned for use directly by the network code.

Parameters
addrThe address to check.
Returns
true/false whether the address is aligned.

Definition at line 29 of file utils.c.

Here is the caller graph for this function:

◆ data_buf_invariant()

M0_INTERNAL bool data_buf_invariant ( const struct data_buf db)

Checks a data_buf struct is correct.

Parameters
dbThe data_buf to check.
Returns
true or false.

This is heavily based on m0t1fs/linux_kernel/file.cdata_buf_invariant

Definition at line 145 of file io_pargrp.c.

Here is the caller graph for this function:

◆ data_page_offset_get()

M0_INTERNAL m0_bindex_t data_page_offset_get ( struct pargrp_iomap map,
uint32_t  row,
uint32_t  col 
)

Definition at line 246 of file utils.c.

Here is the call graph for this function:

◆ data_size()

M0_INTERNAL uint64_t data_size ( struct m0_pdclust_layout play)

Determines the total size of data units in a parity group.

Definition at line 95 of file utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ di_cksum_offset()

M0_INTERNAL uint32_t di_cksum_offset ( struct m0_pdclust_layout play,
m0_bindex_t  gob_offset 
)

Calculates the offset in the cksum object based on the global offset.

Parameters
playThe Parity layout for the global object
gob_offsetOffset in global object.
Returns
The cksum:object offset.

◆ group_id()

M0_INTERNAL uint64_t group_id ( m0_bindex_t  index,
m0_bcount_t  dtsize 
)

Calculates the group index, given a data index and the block size.

Parameters
indexThe data index.
dtsizeThe block size for this data.
Returns
the group index of the data index.

Definition at line 139 of file utils.c.

◆ indexvec_page_nr()

M0_INTERNAL uint64_t indexvec_page_nr ( const struct m0_vec vec,
struct m0_obj obj 
)

Counts the/ number of pages in a vector.

Parameters
vecThe vector to inspect.
objThe object this corresponds with, used to find the block shift.
Returns
The number of pages.

Definition at line 152 of file utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_desc_size()

M0_INTERNAL uint32_t io_desc_size ( struct m0_net_domain ndom)

Calculates additional space for metadata in an io fop, use when adding rpc bulk buffer and data buffers. This is heavily based on m0t1fs/linux_kernel/file.cio_desc_size

Parameters
ndomThe network domain the request will be sent on/to/through.
Returns
The additional space requirement.

Definition at line 205 of file utils.c.

Here is the call graph for this function:

◆ io_seg_size()

M0_INTERNAL uint32_t io_seg_size ( void  )

How much space is required for per-segment on-wire metadata. This is heavily based on m0t1fs/linux_kernel/file.cio_seg_size

Returns
The number of bytes for per-segment on-wire metadata.

Definition at line 218 of file utils.c.

◆ iomap_page_nr()

M0_INTERNAL uint64_t iomap_page_nr ( const struct pargrp_iomap map)

Retrieves the number of pages in the provided map.

Parameters
mapThe map to inspect.
Returns
The number of pages.

Definition at line 161 of file utils.c.

Here is the call graph for this function:

◆ ioo_to_poolmach()

M0_INTERNAL struct m0_poolmach* ioo_to_poolmach ( struct m0_op_io ioo)

Gets pool state machine from m0_op_io.

Parameters
iooThe IO operation in question.
Returns
A pointer to the pool machine corresponding to the pool version of this operation acting on.

Definition at line 75 of file io.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_cc_fop_init()

M0_INTERNAL int ioreq_cc_fop_init ( struct target_ioreq ti)

Initialises cob create fop. It's required for those targets that are not part of io request, but host the members of at least one parity group that's spanned by io request.

Definition at line 810 of file io_req_fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_fop_async_submit()

M0_INTERNAL int ioreq_fop_async_submit ( struct m0_io_fop iofop,
struct m0_rpc_session session 
)

Posts an io_fop, including updating it with descriptors for the bulk data transfer.

Parameters
iofopThe io_fop to sent.
sessionThe target server to send the fop too.
Returns
The response of m0_rpc_post, 0 for success, or -errno.

This is heavily based on m0t1fs/linux_kernel/file.ciofop_async_submit

Definition at line 672 of file io_req_fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_fop_dgmode_read()

M0_INTERNAL int ioreq_fop_dgmode_read ( struct ioreq_fop irfop)

Finds out parity groups for which read IO failed and marks them as DEGRADED.

Parameters
irfopThe object IO fop in question.
Returns
0 for success, -errno otherwise.

This is heavily based on m0t1fs/linux_kernel/file.cio_req_fop_dgmode_read.

Definition at line 745 of file io_req_fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_fop_fini()

M0_INTERNAL void ioreq_fop_fini ( struct ioreq_fop fop)

Finalises an io fop.

Parameters
fopThe fop to finalise.

This is heavily based on m0t1fs/linux_kernel/file.cio_req_fop_fini

Definition at line 1036 of file io_req_fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_fop_init()

M0_INTERNAL int ioreq_fop_init ( struct ioreq_fop fop,
struct target_ioreq ti,
enum page_attr  pattr 
)

Initialises an IO fop.

Parameters
fopThe io fop to initialise.
tiThe target request that this io-fop corresponds to.
pattrWhether the payload is data or parity.
Returns
0 for success, -errno otherwise.

This is heavily based on m0t1fs/linux_kernel/file.cio_req_fop_fini

Definition at line 977 of file io_req_fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_fop_invariant()

M0_INTERNAL bool ioreq_fop_invariant ( const struct ioreq_fop fop)

Checks an ioreq_fop struct is correct.

Parameters
fopThe ioreq_fop to check.
Returns
true or false.

This is heavily based on m0t1fs/linux_kernel/file.cio_req_fop_invariant

Definition at line 62 of file io_req_fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_sm_failed_locked()

M0_INTERNAL void ioreq_sm_failed_locked ( struct m0_op_io ioo,
int  rc 
)

Moves the state-machine into the failed state, with the provided rc. This function should be called with the sm_grp lock held.

Parameters
iooThe IO Operation.
rcThe rc to set in the state machine.

This is heavily based on m0t1fs/linux_kernel/file.cioreq_sm_failed

Definition at line 212 of file io_req.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ioreq_sm_state()

M0_INTERNAL uint32_t ioreq_sm_state ( const struct m0_op_io ioo)

Returns the state-machine:state of the provided io operation. This is heavily based on m0t1fs/linux_kernel/file.cioreq_sm_state

Parameters
iooThe IO Operation.
Returns
the io sm state.

Definition at line 268 of file utils.c.

◆ ioreq_sm_state_set_locked()

M0_INTERNAL void ioreq_sm_state_set_locked ( struct m0_op_io ioo,
int  state 
)

Sets the state-machine:state of the provided io operation. This function should be called with the sm_grp lock held.

Parameters
iooThe IO Operation.
stateThe state to move the state machine into.

This is heavily based on m0t1fs/linux_kernel/file.cioreq_sm_state_set

Definition at line 193 of file io_req.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ layout_instance()

M0_INTERNAL struct m0_layout_instance* layout_instance ( const struct m0_op_io ioo)

Retrieves the stashed layout instance from the provided IO operation.

Parameters
iooThe IO operation.
Returns
The stashed layout instance.

Definition at line 117 of file utils.c.

Here is the caller graph for this function:

◆ layout_k()

M0_INTERNAL uint32_t layout_k ( struct m0_pdclust_layout play)

Retrieves the K (number of spare/parity servers), parameter from a parity layout.

Parameters
playThe parity layout.
Returns
K

Definition at line 64 of file utils.c.

Here is the caller graph for this function:

◆ layout_n()

M0_INTERNAL uint32_t layout_n ( struct m0_pdclust_layout play)

Retrieves the N (number of data servers), parameter from a parity layout.

Parameters
playThe parity layout.
Returns
N

Definition at line 57 of file utils.c.

Here is the caller graph for this function:

◆ layout_unit_size()

M0_INTERNAL uint64_t layout_unit_size ( struct m0_pdclust_layout play)

Gets the unit size of the parity calculations, from a parity layout.

Parameters
playThe parity layout.
Returns
The unit size.

Definition at line 80 of file utils.c.

Here is the caller graph for this function:

◆ m0__page_size()

M0_INTERNAL uint64_t m0__page_size ( const struct m0_op_io ioo)

Determines the page size of the object to provided operation is on.

Parameters
iooThe operation on an object.
Returns
The objects page size.

Definition at line 41 of file utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_BOB_DECLARE() [1/6]

M0_BOB_DECLARE ( M0_INTERNAL  ,
m0_op_io   
)

◆ M0_BOB_DECLARE() [2/6]

M0_BOB_DECLARE ( M0_INTERNAL  ,
ioreq_fop   
)

◆ M0_BOB_DECLARE() [3/6]

M0_BOB_DECLARE ( M0_INTERNAL  ,
target_ioreq   
)

◆ M0_BOB_DECLARE() [4/6]

M0_BOB_DECLARE ( M0_INTERNAL  ,
nw_xfer_request   
)

◆ M0_BOB_DECLARE() [5/6]

M0_BOB_DECLARE ( M0_INTERNAL  ,
pargrp_iomap   
)

◆ M0_BOB_DECLARE() [6/6]

M0_BOB_DECLARE ( M0_INTERNAL  ,
data_buf   
)

◆ M0_HT_DECLARE()

M0_HT_DECLARE ( tioreqht  ,
M0_EXTERN  ,
struct target_ioreq  ,
uint64_t   
)

◆ M0_HT_DESCR_DECLARE()

M0_HT_DESCR_DECLARE ( tioreqht  ,
M0_EXTERN   
)

◆ m0_io_attr()

M0_INTERNAL struct m0_obj_attr* m0_io_attr ( struct m0_op_io ioo)

Definition at line 302 of file utils.c.

Here is the caller graph for this function:

◆ M0_TL_DECLARE() [1/3]

M0_TL_DECLARE ( iofops  ,
M0_INTERNAL  ,
struct ioreq_fop   
)

◆ M0_TL_DECLARE() [2/3]

M0_TL_DECLARE ( rpcbulk  ,
M0_INTERNAL  ,
struct m0_rpc_bulk_buf   
)

◆ M0_TL_DECLARE() [3/3]

M0_TL_DECLARE ( tioreqht  ,
M0_EXTERN  ,
struct target_ioreq   
)

◆ M0_TL_DESCR_DECLARE() [1/3]

M0_TL_DESCR_DECLARE ( iofops  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [2/3]

M0_TL_DESCR_DECLARE ( rpcbulk  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [3/3]

M0_TL_DESCR_DECLARE ( tioreqht  ,
M0_EXTERN   
)

◆ nw_xfer_request_fini()

M0_INTERNAL void nw_xfer_request_fini ( struct nw_xfer_request xfer)

Finalises a network transfer request. This is heavily based on m0t1fs/linux_kernel/file.cnw_xfer_request_fini

Parameters
xfer[out]The network transfer request to finalise.

Definition at line 2159 of file io_nw_xfer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nw_xfer_request_init()

M0_INTERNAL void nw_xfer_request_init ( struct nw_xfer_request xfer)

Initialises a network transfer request. This is heavily based on m0t1fs/linux_kernel/file.cnw_xfer_request_init

Parameters
xfer[out]The network transfer request to initialise.

Definition at line 2130 of file io_nw_xfer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nw_xfer_request_invariant()

M0_INTERNAL bool nw_xfer_request_invariant ( const struct nw_xfer_request xfer)

Checks a nw_xfer_request struct is correct.

Parameters
xferThe nw_xxfer_request to check.
Returns
true or false.

This is heavily based on m0t1fs/linux_kernel/file.cnw_xfer_request_invariant

Definition at line 340 of file io_nw_xfer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ obj_buffer_size()

M0_INTERNAL uint64_t obj_buffer_size ( const struct m0_obj obj)

Determines the IO buffer size of an object.

Parameters
objThe object.
Returns
The objects buffer size.

Definition at line 34 of file utils.c.

Here is the caller graph for this function:

◆ page_id()

M0_INTERNAL uint64_t page_id ( m0_bindex_t  offset,
struct m0_obj obj 
)

Gets the block number that contains the specified offset.

Parameters
offsetThe offset.
objThe object.
Returns
the block number in the object.TODO: this code is the same as page_nr -> combine them?

TODO: this code is the same as page_nr -> combine them?

Definition at line 72 of file utils.c.

Here is the caller graph for this function:

◆ page_nr()

M0_INTERNAL uint64_t page_nr ( m0_bcount_t  size,
struct m0_obj obj 
)

Determines the number of object:blocks that are needed to hold the specified amount of data.

Parameters
sizeThe size of the larger buffer.
objThe object that will hold this data.
Returns
the number of blocks required.TODO: rename this block_count ?

Definition at line 49 of file utils.c.

Here is the caller graph for this function:

◆ page_pos_get()

M0_INTERNAL void page_pos_get ( struct pargrp_iomap map,
m0_bindex_t  index,
m0_bindex_t  grp_off,
uint32_t *  row,
uint32_t *  col 
)

Calculates the data row/column for the provided index, using the provided parity layout. This is heavily based on m0t1fs/linux_kernel/file.cpage_pos_get

Parameters
mapThe io map that contains the row/columns.
indexThe object offset whose position we want.
grp_sizedata_size(play) * map->pi_grpid
[out]rowThe resulting row in the parity group.
[out]colThe resulting column in the parity group.TODO: obj can be retrieved from map->pi_ioo

TODO: obj can be retrieved from map->pi_ioo

Definition at line 224 of file utils.c.

Here is the call graph for this function:

◆ pargrp_id_find()

M0_INTERNAL uint64_t pargrp_id_find ( m0_bindex_t  index,
const struct m0_op_io ioo,
const struct ioreq_fop ir_fop 
)

Calculates the parity group identifier this 'index' belongs to.

Parameters
indexThe data index.
iooThe IO operation whose iomaps should be checked.
ir_fopThe io fop serving the data 'index'.
Returns
true or false.

This is heavily based on m0t1fs/linux_kernel/file.cpargrp_id_find

Definition at line 105 of file io_pargrp.c.

Here is the call graph for this function:

◆ pargrp_iomap_fini()

M0_INTERNAL void pargrp_iomap_fini ( struct pargrp_iomap map,
struct m0_obj obj 
)

Finalises a parity group io map.

Parameters
mapThe map to finalise.
objThe object this map correpsonds with, used to find the block size.TODO: arguments here can be reduced, map+obj are in ioo

This is heavily based on m0t1fs/linux_kernel/file.c::pargrp_iomap_finiTODO: arguments here can be reduced, map+obj are in ioo

Definition at line 2467 of file io_pargrp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pargrp_iomap_init()

M0_INTERNAL int pargrp_iomap_init ( struct pargrp_iomap map,
struct m0_op_io ioo,
uint64_t  grpid 
)

Initialises a parity group iomap. Populates the databuf and paritybuf arrays, but doesn't allocate any data_bufs for them.

Parameters
map[out]The map to initialise.
iooThe IO operation responsible for this IO.
grpidWhich group in the file the map should start at.
Returns
0 for success, -errno otherwise.

This is heavily based on m0t1fs/linux_kernel/file.cpargrp_iomap_init

Definition at line 2387 of file io_pargrp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pargrp_iomap_invariant()

M0_INTERNAL bool pargrp_iomap_invariant ( const struct pargrp_iomap map)

Checks a pargrp_iomap struct is correct.

Parameters
mapThe pargrp_iomap to check.
Returns
true or false.

This is heavily based on m0t1fs/linux_kernel/file.cpargrp_iomap_invariant

Definition at line 203 of file io_pargrp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pargrp_iomap_invariant_nr()

M0_INTERNAL bool pargrp_iomap_invariant_nr ( const struct m0_op_io ioo)

Checks all the pagrp_iomaps pass the invariant check.

Parameters
iooThe IO operation whose iomaps should be checked.
Returns
true or false.

This is heavily based on m0t1fs/linux_kernel/file.cpargrp_iomap_invariant_nr

Definition at line 227 of file io_pargrp.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parity_math()

M0_INTERNAL struct m0_parity_math* parity_math ( struct m0_op_io ioo)

Retrieves the math representation of parity

Parameters
iooThe IO operation
Returns
The parity math representation.

Definition at line 124 of file utils.c.

Here is the call graph for this function:

◆ parity_units_page_nr()

M0_INTERNAL uint64_t parity_units_page_nr ( struct m0_pdclust_layout play,
struct m0_obj obj 
)

Calculates the number of parity pages required for a given layout.

Parameters
playThe parity layout.
objThe object this corresponds with, used to find the block shift.
Returns
The number of parity pages.

Definition at line 168 of file utils.c.

Here is the call graph for this function:

◆ pdlayout_get()

M0_INTERNAL struct m0_pdclust_layout* pdlayout_get ( const struct m0_op_io ioo)

Gets the parity layout from the provided IO operation. This is heavily based on m0t1fs/linux_kernel/file.cpdlayout_get

Parameters
iooThe IO Operation.
Returns
The parity layout.

Definition at line 111 of file utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pdlayout_instance()

M0_INTERNAL struct m0_pdclust_instance* pdlayout_instance ( struct m0_layout_instance li)

Retrieves a parity-declustered instance from the provided layout instance.

Parameters
lithe layout instance.
Returns
The pdclust instance.

Definition at line 103 of file utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rm_domain_get()

M0_INTERNAL struct m0_rm_domain* rm_domain_get ( struct m0_client cinst)

Gets resource manage domain.

Parameters
instanceThe client instance/cluster whose rm domain should be returned.
Returns
A pointer to the resource manager domain.

This is heavily based on m0t1fs/linux_kernel/inode.cm0t1fs_rm_domain_get

Definition at line 59 of file io.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ round_down()

M0_INTERNAL uint64_t round_down ( uint64_t  val,
uint64_t  size 
)

Rounds val down to the nearest multiple of size. This is heavily based on m0t1fs/linux_kernel/file.cround_down

Parameters
valThe value to round.
sizeThe result should be a multiple of this size.
Returns
The rounded version of val.

Definition at line 178 of file utils.c.

Here is the call graph for this function:

◆ round_up()

M0_INTERNAL uint64_t round_up ( uint64_t  val,
uint64_t  size 
)

Rounds val up to the nearest multiple of size. This is heavily based on m0t1fs/linux_kernel/file.cround_up

Parameters
valThe value to round.
sizeThe result should be a multiple of this size.
Returns
The rounded version of val.

Definition at line 192 of file utils.c.

Here is the call graph for this function:

◆ rows_nr()

M0_INTERNAL uint32_t rows_nr ( struct m0_pdclust_layout play,
struct m0_obj obj 
)

Determines the size of data/parity unit in pages. This is essentially the rows number in the pargrp_iomap::pi_databufs[row][col] 2-dimentional array, hence the name.

Parameters
playThe Parity layout.
objThe object.
Returns
The number of pages.

Definition at line 87 of file utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seg_endpos()

M0_INTERNAL m0_bcount_t seg_endpos ( const struct m0_indexvec ivec,
uint32_t  i 
)

Calculates the offset of the last byte in the i'th extent.

Parameters
ivecThe index of extents.
iWhich extent to inspect.
Returns
The offset of the last byte.

Definition at line 145 of file utils.c.

◆ target_fid()

M0_INTERNAL struct m0_fid target_fid ( struct m0_op_io ioo,
struct m0_pdclust_tgt_addr tgt 
)

Retrieves the cob:fid on a target server for the provided offset. (embedded in tgt).

Parameters
iooThe IO operation, contains the layout etc.
tgtThe target parameters, contains the specified offset.
Returns
The cob:fid.

This is heavily based on m0t1fs/linux_kernel/file.ctarget_fid().

Definition at line 710 of file io_nw_xfer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ target_ioreq_cancel()

M0_INTERNAL void target_ioreq_cancel ( struct target_ioreq ti)

Cancel a target_ioreq.

Parameters
tiThe target_ioreq to cancel.

Definition at line 423 of file io_nw_xfer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ target_ioreq_fini()

M0_INTERNAL void target_ioreq_fini ( struct target_ioreq ti)

Finalises a target_ioreq, freeing any auxillary memory.

Parameters
tiThe target_ioreq to finalise.

This is heavily based on m0t1fs/linux_kernel/file.ctarget_ioreq_fini

Definition at line 364 of file io_nw_xfer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ target_offset()

M0_INTERNAL uint64_t target_offset ( uint64_t  frame,
struct m0_pdclust_layout play,
m0_bindex_t  gob_offset 
)

Calculates the offset in the target object based on the global offset.

Parameters
frameFrame number of target object.
playThe Parity layout for the global object
gob_offsetOffset in global object.
Returns
The target:object offset.

Definition at line 129 of file utils.c.

Here is the call graph for this function:

◆ tolerance_of_level()

M0_INTERNAL uint64_t tolerance_of_level ( struct m0_op_io ioo,
uint64_t  lv 
)
Todo:
This code is not required once MOTR-899 lands into dev. Tolerance for the given level.

Definition at line 275 of file utils.c.

Here is the call graph for this function:

Variable Documentation

◆ dtbuf_bobtype

const struct m0_bob_type dtbuf_bobtype
Initial value:
= {
.bt_name = "data_buf_bobtype",
.bt_magix_offset = offsetof(struct data_buf, db_magic),
.bt_magix = M0_DTBUF_MAGIC,
.bt_check = NULL,
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

Definition at line 69 of file io_pargrp.c.

◆ iofop_bobtype

struct m0_bob_type iofop_bobtype

Definition at line 47 of file io_req_fop.c.

◆ ioo_bobtype

const struct m0_bob_type ioo_bobtype
Initial value:
= {
.bt_name = "m0_op_io_bobtype",
.bt_magix_offset = offsetof(struct m0_op_io, ioo_magic),
.bt_magix = M0_IOREQ_MAGIC,
.bt_check = NULL,
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

BOB definitions for m0_op_io

Definition at line 153 of file io_req.c.

◆ ioo_oostore_ops

const struct m0_op_io_ops ioo_oostore_ops

◆ ioo_ops

const struct m0_op_io_ops ioo_ops

Definition at line 1860 of file io_req.c.

◆ m0_rm_group

const struct m0_uint128 m0_rm_group

Resource Manager group id, copied from m0t1fs

A note for rwlock.

As stated in client.h: "All other concurrency control, including ordering of reads and writes to a client object, and distributed transaction serializability, is up to the application.", rwlock related code is removed from Client (by Sining). And rwlock related commits are ignored as well, such as commit d3c06f4f. If rwlock is thought to be necessary for Client later, it will be added.Resource Manager group id, copied from m0t1fs

Definition at line 53 of file io.c.

◆ nwxfer_bobtype

const struct m0_bob_type nwxfer_bobtype
Initial value:
= {
.bt_name = "nw_xfer_request_bobtype",
.bt_magix_offset = offsetof(struct nw_xfer_request, nxr_magic),
.bt_magix = M0_NWREQ_MAGIC,
.bt_check = NULL,
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

BOB initialisation for the assorted parts of io requests and nwxfer

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 56 of file io_nw_xfer.c.

◆ pgiomap_bobtype

const struct m0_bob_type pgiomap_bobtype
Initial value:
= {
.bt_name = "pargrp_iomap_bobtype",
.bt_magix_offset = offsetof(struct pargrp_iomap, pi_magic),
.bt_magix = M0_PGROUP_MAGIC,
.bt_check = NULL,
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

BOB initialisation for the assorted parts of io requests and nwxfer

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 62 of file io_pargrp.c.

◆ tioreq_bobtype

const struct m0_bob_type tioreq_bobtype
Initial value:
= {
.bt_name = "target_ioreq",
.bt_magix_offset = offsetof(struct target_ioreq, ti_magic),
.bt_magix = M0_TIOREQ_MAGIC,
.bt_check = NULL,
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

Definition at line 63 of file io_nw_xfer.c.