Motr
M0
|
Data Structures | |
struct | m0_vec |
struct | m0_vec_cursor |
struct | m0_indexvec |
struct | m0_bufvec |
struct | m0_bufvec_cursor |
struct | m0_ivec_cursor |
struct | m0_0vec |
struct | m0_ioseg |
struct | m0_io_indexvec |
struct | m0_io_indexvec_seq |
struct | m0_indexvec_varr |
struct | m0_ivec_varr_cursor |
Macros | |
#define | M0_BUFVEC_INIT_BUF(addr_ptr, count_ptr) |
#define | M0_BUFVEC_FOR2(c0, c1, frag) |
#define | M0_BUFVEC_ENDFOR2 } } |
Functions | |
M0_INTERNAL int | m0_0vec_page_add (struct m0_0vec *zvec, struct page *pg, m0_bindex_t index) |
M0_BASSERT (M0_SEG_SIZE==M0_0VEC_ALIGN) | |
static m0_bcount_t | vec_count (const struct m0_vec *vec, uint32_t i) |
M0_INTERNAL m0_bcount_t | m0_vec_count (const struct m0_vec *vec) |
M0_INTERNAL bool | m0_vec_is_empty (const struct m0_vec *vec) |
static bool | m0_vec_cursor_invariant (const struct m0_vec_cursor *cur) |
static void | m0_vec_cursor_normalize (struct m0_vec_cursor *cur) |
M0_INTERNAL void | m0_vec_cursor_init (struct m0_vec_cursor *cur, const struct m0_vec *vec) |
M0_INTERNAL bool | m0_vec_cursor_move (struct m0_vec_cursor *cur, m0_bcount_t count) |
M0_INTERNAL m0_bcount_t | m0_vec_cursor_step (const struct m0_vec_cursor *cur) |
M0_INTERNAL m0_bcount_t | m0_vec_cursor_end (const struct m0_vec_cursor *cur) |
static int | bufvec_alloc (struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift, bool pack) |
static int | m0__bufvec_alloc (struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift) |
M0_INTERNAL int | m0_bufvec_empty_alloc (struct m0_bufvec *bufvec, uint32_t num_segs) |
M0_INTERNAL int | m0_bufvec_alloc (struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size) |
M0_INTERNAL int | m0_bufvec_extend (struct m0_bufvec *bufvec, uint32_t num_segs) |
M0_INTERNAL int | m0_bufvec_merge (struct m0_bufvec *dst_bufvec, struct m0_bufvec *src_bufvec) |
M0_INTERNAL int | m0__bufvec_dont_dump (struct m0_bufvec *bufvec) |
M0_INTERNAL int | m0_bufvec_alloc_aligned (struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift) |
M0_INTERNAL int | m0_bufvec_alloc_aligned_packed (struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift) |
static void | m0_bufvec__free (struct m0_bufvec *bufvec, bool free_bufs) |
M0_INTERNAL void | m0_bufvec_free (struct m0_bufvec *bufvec) |
M0_INTERNAL void | m0_bufvec_free2 (struct m0_bufvec *bufvec) |
M0_INTERNAL void | bufvec_free_aligned (struct m0_bufvec *bufvec, unsigned shift, bool pack) |
M0_INTERNAL void | m0_bufvec_free_aligned (struct m0_bufvec *bufvec, unsigned shift) |
M0_INTERNAL void | m0_bufvec_free_aligned_packed (struct m0_bufvec *bufvec, unsigned shift) |
static uint32_t | vec_pack (uint32_t nr, m0_bcount_t *cnt, m0_bindex_t *idx) |
M0_INTERNAL uint32_t | m0_bufvec_pack (struct m0_bufvec *bv) |
M0_INTERNAL int | m0_bufvec_splice (const struct m0_bufvec *bvec, m0_bcount_t nr, struct m0_buf *buf) |
M0_INTERNAL uint32_t | m0_indexvec_pack (struct m0_indexvec *iv) |
M0_INTERNAL int | m0_indexvec_alloc (struct m0_indexvec *ivec, uint32_t len) |
M0_INTERNAL void | m0_indexvec_free (struct m0_indexvec *ivec) |
M0_INTERNAL void | m0_bufvec_cursor_init (struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec) |
M0_INTERNAL bool | m0_bufvec_cursor_move (struct m0_bufvec_cursor *cur, m0_bcount_t count) |
M0_INTERNAL m0_bcount_t | m0_bufvec_cursor_step (const struct m0_bufvec_cursor *cur) |
M0_INTERNAL void * | bufvec_cursor_addr (struct m0_bufvec_cursor *cur) |
M0_INTERNAL void * | m0_bufvec_cursor_addr (struct m0_bufvec_cursor *cur) |
M0_INTERNAL bool | m0_bufvec_cursor_align (struct m0_bufvec_cursor *cur, uint64_t alignment) |
M0_INTERNAL m0_bcount_t | m0_bufvec_cursor_copy (struct m0_bufvec_cursor *dcur, struct m0_bufvec_cursor *scur, m0_bcount_t num_bytes) |
M0_INTERNAL int | m0_bufvec_cursor_cmp (struct m0_bufvec_cursor *c0, struct m0_bufvec_cursor *c1) |
M0_INTERNAL m0_bcount_t | m0_bufvec_cursor_prefix (struct m0_bufvec_cursor *c0, struct m0_bufvec_cursor *c1) |
M0_INTERNAL m0_bcount_t | m0_bufvec_cursor_copyto (struct m0_bufvec_cursor *dcur, void *sdata, m0_bcount_t num_bytes) |
M0_INTERNAL m0_bcount_t | m0_bufvec_cursor_copyfrom (struct m0_bufvec_cursor *scur, void *ddata, m0_bcount_t num_bytes) |
M0_INTERNAL void | m0_ivec_cursor_init (struct m0_ivec_cursor *cur, const struct m0_indexvec *ivec) |
M0_INTERNAL bool | m0_ivec_cursor_move (struct m0_ivec_cursor *cur, m0_bcount_t count) |
M0_INTERNAL m0_bcount_t | m0_ivec_cursor_step (const struct m0_ivec_cursor *cur) |
M0_INTERNAL m0_bindex_t | m0_ivec_cursor_index (const struct m0_ivec_cursor *cur) |
M0_INTERNAL bool | m0_ivec_cursor_move_to (struct m0_ivec_cursor *cur, m0_bindex_t dest) |
M0_INTERNAL m0_bindex_t | m0_ivec_cursor_conti (const struct m0_ivec_cursor *cur, m0_bindex_t dest) |
M0_INTERNAL void | m0_0vec_fini (struct m0_0vec *zvec) |
static bool | addr_is_4k_aligned (void *addr) |
static bool | m0_0vec_invariant (const struct m0_0vec *zvec) |
M0_INTERNAL int | m0_0vec_init (struct m0_0vec *zvec, uint32_t segs_nr) |
M0_INTERNAL void | m0_0vec_bvec_init (struct m0_0vec *zvec, const struct m0_bufvec *src, const m0_bindex_t *index) |
M0_INTERNAL void | m0_0vec_bufs_init (struct m0_0vec *zvec, void **bufs, const m0_bindex_t *index, const m0_bcount_t *counts, uint32_t segs_nr) |
M0_INTERNAL int | m0_0vec_cbuf_add (struct m0_0vec *zvec, const struct m0_buf *buf, const m0_bindex_t *index) |
static void | data_to_bufvec (struct m0_bufvec *src_buf, void **data, size_t *len) |
M0_INTERNAL int | m0_data_to_bufvec_copy (struct m0_bufvec_cursor *cur, void *data, size_t len) |
M0_INTERNAL int | m0_bufvec_to_data_copy (struct m0_bufvec_cursor *cur, void *data, size_t len) |
M0_INTERNAL m0_bcount_t | m0_bufvec_copy (struct m0_bufvec *dst, struct m0_bufvec *src, m0_bcount_t num_bytes) |
M0_INTERNAL m0_bcount_t | m0_io_count (const struct m0_io_indexvec *io_info) |
static uint32_t | ivec_nr_or_prepare (struct m0_indexvec *in, m0_bcount_t offset, int req, uint32_t bshift, struct m0_indexvec *out) |
M0_INTERNAL int | m0_indexvec_split (struct m0_indexvec *in, m0_bcount_t curr_pos, m0_bcount_t nb_len, uint32_t bshift, struct m0_indexvec *out) |
M0_INTERNAL int | m0_indexvec_wire2mem (struct m0_io_indexvec *wire_ivec, int max_frags_nr, uint32_t bshift, struct m0_indexvec *mem_ivec) |
M0_INTERNAL int | m0_indexvec_mem2wire (struct m0_indexvec *mem_ivec, int max_frags_nr, uint32_t bshift, struct m0_io_indexvec *wire_ivec) |
M0_INTERNAL int | m0_indexvec_universal_set (struct m0_indexvec *iv) |
M0_INTERNAL bool | m0_indexvec_is_universal (const struct m0_indexvec *iv) |
M0_INTERNAL int | m0_indexvec_varr_alloc (struct m0_indexvec_varr *ivec, uint32_t len) |
M0_INTERNAL void | m0_indexvec_varr_free (struct m0_indexvec_varr *ivec) |
static void | m0_ivec_varr_cursor_normalize (struct m0_ivec_varr_cursor *cur) |
M0_INTERNAL void | m0_ivec_varr_cursor_init (struct m0_ivec_varr_cursor *cur, struct m0_indexvec_varr *ivec) |
M0_INTERNAL bool | m0_ivec_varr_cursor_move (struct m0_ivec_varr_cursor *cur, m0_bcount_t count) |
M0_INTERNAL m0_bcount_t | m0_ivec_varr_cursor_step (const struct m0_ivec_varr_cursor *cur) |
M0_INTERNAL m0_bindex_t | m0_ivec_varr_cursor_index (const struct m0_ivec_varr_cursor *cur) |
M0_INTERNAL bool | m0_ivec_varr_cursor_move_to (struct m0_ivec_varr_cursor *cur, m0_bindex_t dest) |
M0_INTERNAL m0_bindex_t | m0_ivec_varr_cursor_conti (const struct m0_ivec_varr_cursor *cur, m0_bindex_t dest) |
M0_INTERNAL int | m0_bufvec_to_buf_copy (struct m0_buf *buf, const struct m0_bufvec *bvec) |
M0_INTERNAL int | m0_buf_to_bufvec_copy (struct m0_bufvec *bvec, const struct m0_buf *buf) |
struct m0_vec | M0_XCA_DOMAIN (rpc) |
Variables | |
struct m0_vec_cursor | M0_XCA_DOMAIN |
#define M0_BUFVEC_FOR2 | ( | c0, | |
c1, | |||
frag | |||
) |
Iterates over fragments of 2 bufvecs.
Bit-wise OR used below to ensure both cursors get moved without short-circuit logic.
#define M0_BUFVEC_INIT_BUF | ( | addr_ptr, | |
count_ptr | |||
) |
Initialize a m0_bufvec containing a single segment of the specified size. The intended usage is as follows:
|
static |
|
static |
M0_INTERNAL void* bufvec_cursor_addr | ( | struct m0_bufvec_cursor * | cur | ) |
M0_INTERNAL void bufvec_free_aligned | ( | struct m0_bufvec * | bufvec, |
unsigned | shift, | ||
bool | pack | ||
) |
|
static |
|
static |
M0_INTERNAL void m0_0vec_bufs_init | ( | struct m0_0vec * | zvec, |
void ** | bufs, | ||
const m0_bindex_t * | indices, | ||
const m0_bcount_t * | counts, | ||
uint32_t | segs_nr | ||
) |
Init the m0_0vec structure from array of buffers with indices and counts. This API does not copy data. Just pointers are copied.
zvec | The m0_0vec structure to be initialized. |
bufs | Array of IO buffers. |
indices | Array of target object indices. |
counts | Array of buffer counts. |
segs_nr | Number of segments contained in the buf array. |
Definition at line 876 of file vec.c.
M0_INTERNAL void m0_0vec_bvec_init | ( | struct m0_0vec * | zvec, |
const struct m0_bufvec * | bufvec, | ||
const m0_bindex_t * | indices | ||
) |
Init the m0_0vec structure from given m0_bufvec structure and array of indices. This API does not copy data. Only pointers are copied.
zvec | The m0_0vec structure to be initialized. |
bufvec | The m0_bufvec containing buffer starting addresses and with number of buffers and their byte counts. |
indices | Target object indices to start the IO from. |
Definition at line 853 of file vec.c.
M0_INTERNAL int m0_0vec_cbuf_add | ( | struct m0_0vec * | zvec, |
const struct m0_buf * | buf, | ||
const m0_bindex_t * | index | ||
) |
Add a m0_buf structure at given target index to m0_0vec structure.
zvec | The m0_0vec structure to be initialized. |
buf | The m0_buf structure containing starting address of buffer and number of bytes in buffer. |
index | Index of target object to start IO from. |
Definition at line 903 of file vec.c.
M0_INTERNAL void m0_0vec_fini | ( | struct m0_0vec * | zvec | ) |
Finalize a m0_0vec structure.
The | m0_0vec structure to be deallocated. |
Definition at line 794 of file vec.c.
M0_INTERNAL int m0_0vec_init | ( | struct m0_0vec * | zvec, |
uint32_t | segs_nr | ||
) |
Initialize a pre-allocated m0_0vec structure.
zvec | The m0_0vec structure to be initialized. |
segs_nr | Number of segments in zero vector. |
Definition at line 826 of file vec.c.
|
static |
M0_INTERNAL int m0_0vec_page_add | ( | struct m0_0vec * | zvec, |
struct page * | pg, | ||
m0_bindex_t | index | ||
) |
Add a struct page to contents of m0_0vec structure. Struct page is kernel representation of a buffer.
zvec | The m0_0vec struct to be initialized. |
pages | Array of kernel pages. |
index | The target object offset for page. |
Definition at line 28 of file kvec.c.
|
static |
M0_INTERNAL int m0__bufvec_dont_dump | ( | struct m0_bufvec * | bufvec | ) |
M0_BASSERT | ( | M0_SEG_SIZE | = =M0_0VEC_ALIGN | ) |
|
static |
M0_INTERNAL int m0_bufvec_alloc | ( | struct m0_bufvec * | bufvec, |
uint32_t | num_segs, | ||
m0_bcount_t | seg_size | ||
) |
Allocates memory for a struct m0_bufvec. All segments are of equal size. The internal struct m0_vec is also allocated by this routine.
bufvec | Pointer to buffer vector to be initialized. |
num_segs | Number of memory segments. |
seg_size | Size of each segment. |
0 | On success. |
-errno | On failure. |
Definition at line 220 of file vec.c.
M0_INTERNAL int m0_bufvec_alloc_aligned | ( | struct m0_bufvec * | bufvec, |
uint32_t | num_segs, | ||
m0_bcount_t | seg_size, | ||
unsigned | shift | ||
) |
M0_INTERNAL int m0_bufvec_alloc_aligned_packed | ( | struct m0_bufvec * | bufvec, |
uint32_t | num_segs, | ||
m0_bcount_t | seg_size, | ||
unsigned | shift | ||
) |
M0_INTERNAL m0_bcount_t m0_bufvec_copy | ( | struct m0_bufvec * | dst, |
struct m0_bufvec * | src, | ||
m0_bcount_t | num_bytes | ||
) |
M0_INTERNAL void * m0_bufvec_cursor_addr | ( | struct m0_bufvec_cursor * | cur | ) |
Return the buffer address at the cursor's current position.
cur | Pointer to the struct m0_bufvec_cursor. |
Pointer | into buffer. |
Definition at line 597 of file vec.c.
M0_INTERNAL bool m0_bufvec_cursor_align | ( | struct m0_bufvec_cursor * | cur, |
uint64_t | alignment | ||
) |
Advances the cursor with some count such that cursor will be aligned to "alignment". Return convention is same as m0_bufvec_cursor_move().
Definition at line 604 of file vec.c.
M0_INTERNAL int m0_bufvec_cursor_cmp | ( | struct m0_bufvec_cursor * | c0, |
struct m0_bufvec_cursor * | c1 | ||
) |
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copy | ( | struct m0_bufvec_cursor * | dcur, |
struct m0_bufvec_cursor * | scur, | ||
m0_bcount_t | num_bytes | ||
) |
Copy bytes from one buffer to another using cursors. Both cursors are advanced by the number of bytes copied.
dcur | Pointer to the destination buffer cursor positioned appropriately. |
scur | Pointer to the source buffer cursor positioned appropriately. |
num_bytes | The number of bytes to copy. |
bytes_copied | The number of bytes actually copied. This will be equal to num_bytes only if there was adequate space in the buffers. |
Definition at line 620 of file vec.c.
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copyfrom | ( | struct m0_bufvec_cursor * | scur, |
void * | ddata, | ||
m0_bcount_t | num_bytes | ||
) |
Copy data with specified size from a cursor.
scur | Pointer to the source buffer cursor positioned appropriately. |
ddata | Pointer to area where the data is to be copied to. |
num_bytes | The number of bytes to copy. |
Definition at line 692 of file vec.c.
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copyto | ( | struct m0_bufvec_cursor * | dcur, |
void * | sdata, | ||
m0_bcount_t | num_bytes | ||
) |
Copy data with specified size to a cursor.
dcur | Pointer to the destination buffer cursor positioned appropriately. |
sdata | Pointer to area where the data is to be copied from. |
num_bytes | The number of bytes to copy. |
Definition at line 677 of file vec.c.
M0_INTERNAL void m0_bufvec_cursor_init | ( | struct m0_bufvec_cursor * | cur, |
const struct m0_bufvec * | bvec | ||
) |
Initialize a struct m0_bufvec cursor.
cur | Pointer to the struct m0_bufvec_cursor. |
bvec | Pointer to the struct m0_bufvec. |
Definition at line 563 of file vec.c.
M0_INTERNAL bool m0_bufvec_cursor_move | ( | struct m0_bufvec_cursor * | cur, |
m0_bcount_t | count | ||
) |
Advance the cursor "count" bytes further through the buffer vector.
cur | Pointer to the struct m0_bufvec_cursor. |
Definition at line 574 of file vec.c.
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_prefix | ( | struct m0_bufvec_cursor * | c0, |
struct m0_bufvec_cursor * | c1 | ||
) |
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_step | ( | const struct m0_bufvec_cursor * | cur | ) |
Return number of bytes that the cursor have to be moved to reach the next segment in its vector (or to move into end of the vector position, when the cursor is already at the last segment).
cur | Pointer to the struct m0_bufvec_cursor. |
Count |
Definition at line 581 of file vec.c.
M0_INTERNAL int m0_bufvec_empty_alloc | ( | struct m0_bufvec * | bufvec, |
uint32_t | num_segs | ||
) |
The same as m0_bufvec_alloc(), but doesn't allocate memory for segments.
Definition at line 213 of file vec.c.
M0_INTERNAL int m0_bufvec_extend | ( | struct m0_bufvec * | bufvec, |
uint32_t | num_segs | ||
) |
Assumes that all segments are of equal size. All additional segments are of the size of the initial segment in bufvec. The internal struct m0_vec is also allocated by this routine.
bufvec | Pointer to buffer vector to be extended. |
num_segs | Number of memory segments by which bufvec is to be extended. |
Definition at line 228 of file vec.c.
M0_INTERNAL void m0_bufvec_free | ( | struct m0_bufvec * | bufvec | ) |
Frees the buffers pointed to by m0_bufvec.ov_buf and the m0_bufvec.ov_vec vector, using m0_free().
bufvec | Pointer to the m0_bufvec. |
Definition at line 395 of file vec.c.
M0_INTERNAL void m0_bufvec_free2 | ( | struct m0_bufvec * | bufvec | ) |
The same as m0_bufvec_free(), but doesn't free the buffers pointed by m0_bufvec->ov_buf[]. Only m0_bufvec structure is freed.
Definition at line 401 of file vec.c.
M0_INTERNAL void m0_bufvec_free_aligned | ( | struct m0_bufvec * | bufvec, |
unsigned | shift | ||
) |
Frees the buffers pointed to by m0_bufvec.ov_buf and the m0_bufvec.ov_vec vector, using m0_free_aligned().
bufvec | Pointer to the m0_bufvec. |
Definition at line 436 of file vec.c.
M0_INTERNAL void m0_bufvec_free_aligned_packed | ( | struct m0_bufvec * | bufvec, |
unsigned | shift | ||
) |
Definition at line 443 of file vec.c.
Merges the source bufvec to the destination bufvec. Assumes that all segments are of equal size. Does not allocate bufvec->ov_buf, but does pointer manipulation such that src_bufvec's ov_bufs are appended to dst_bufvec's ov_bufs.
dst_bufvec | Pointer to the destination buffer in which the new bufvec is to be merged. |
src_bufvec | Pointer to the source buffer which is to be merged. |
Definition at line 280 of file vec.c.
M0_INTERNAL uint32_t m0_bufvec_pack | ( | struct m0_bufvec * | bufvec | ) |
M0_INTERNAL int m0_bufvec_splice | ( | const struct m0_bufvec * | bvec, |
m0_bcount_t | nr, | ||
struct m0_buf * | buf | ||
) |
M0_INTERNAL int m0_bufvec_to_data_copy | ( | struct m0_bufvec_cursor * | cur, |
void * | data, | ||
size_t | len | ||
) |
M0_INTERNAL int m0_data_to_bufvec_copy | ( | struct m0_bufvec_cursor * | cur, |
void * | data, | ||
size_t | len | ||
) |
M0_INTERNAL int m0_indexvec_alloc | ( | struct m0_indexvec * | ivec, |
uint32_t | len | ||
) |
Allocate memory for index array and counts array in index vector.
len | Number of elements to allocate memory for. |
Definition at line 532 of file vec.c.
M0_INTERNAL void m0_indexvec_free | ( | struct m0_indexvec * | ivec | ) |
Deallocates the memory buffers pointed to by index array and counts array. Also sets the array count to zero. If ivec->iv_index == NULL - does nothing.
Definition at line 553 of file vec.c.
M0_INTERNAL bool m0_indexvec_is_universal | ( | const struct m0_indexvec * | iv | ) |
M0_INTERNAL int m0_indexvec_mem2wire | ( | struct m0_indexvec * | mem_ivec, |
int | max_frags_nr, | ||
uint32_t | bshift, | ||
struct m0_io_indexvec * | wire_ivec | ||
) |
M0_INTERNAL uint32_t m0_indexvec_pack | ( | struct m0_indexvec * | ivec | ) |
M0_INTERNAL int m0_indexvec_split | ( | struct m0_indexvec * | in, |
m0_bcount_t | curr_pos, | ||
m0_bcount_t | nb_len, | ||
uint32_t | bshift, | ||
struct m0_indexvec * | out | ||
) |
Function to split the indexvec from the given offset to the lenth specified.
mem_ivec | Indexvec memory format. |
curr_pos | Start position for new indexvec. |
nb_len | Size of the data for new indexvec. |
bshift | Shift value for the data to align index vecs. |
Definition at line 1039 of file vec.c.
M0_INTERNAL int m0_indexvec_universal_set | ( | struct m0_indexvec * | iv | ) |
Creates an indexvec with a single extent, which spans the range [0. ~0). Since the range spanned by this indexvec represents union of all possible ranges that any indexvec can hold, it is referred as a universal indexvec.
iv | Input indexvec. |
Definition at line 1116 of file vec.c.
M0_INTERNAL int m0_indexvec_varr_alloc | ( | struct m0_indexvec_varr * | ivec, |
uint32_t | len | ||
) |
Allocates memory in m0_varr for index array and counts array in index vector.
len | Number of elements to allocate memory for. |
Definition at line 1136 of file vec.c.
M0_INTERNAL void m0_indexvec_varr_free | ( | struct m0_indexvec_varr * | ivec | ) |
M0_INTERNAL int m0_indexvec_wire2mem | ( | struct m0_io_indexvec * | wire_ivec, |
int | max_frags_nr, | ||
uint32_t | bshift, | ||
struct m0_indexvec * | mem_ivec | ||
) |
Function to convert the on-wire indexvec to in-memory indexvec format. Since m0_io_indexvec (on-wire structure) and m0_indexvec (in-memory structures are different, conversion is needed.
wire_ivec | Indexvec wire format. |
mem_ivec | Indexvec memory format. |
max_frags_nr | Number of fragments from the wire_ivec. |
Definition at line 1058 of file vec.c.
M0_INTERNAL m0_bcount_t m0_io_count | ( | const struct m0_io_indexvec * | io_info | ) |
M0_INTERNAL m0_bindex_t m0_ivec_cursor_conti | ( | const struct m0_ivec_cursor * | cur, |
m0_bindex_t | dest | ||
) |
M0_INTERNAL m0_bindex_t m0_ivec_cursor_index | ( | const struct m0_ivec_cursor * | cur | ) |
M0_INTERNAL void m0_ivec_cursor_init | ( | struct m0_ivec_cursor * | cur, |
const struct m0_indexvec * | ivec | ||
) |
M0_INTERNAL bool m0_ivec_cursor_move | ( | struct m0_ivec_cursor * | cur, |
m0_bcount_t | count | ||
) |
Moves the index vector cursor forward by .
cur | Given index vector cursor. |
count | Count by which cursor has to be moved. true iff end of vector has been reached while moving cursor by . Returns false otherwise. |
Definition at line 718 of file vec.c.
M0_INTERNAL bool m0_ivec_cursor_move_to | ( | struct m0_ivec_cursor * | cursor, |
m0_bindex_t | dest | ||
) |
Moves index vector cursor forward until it reaches index .
dest | Index uptil which cursor has to be moved. true iff end of vector has been reached while moving cursor. Returns false otherwise. |
Definition at line 745 of file vec.c.
M0_INTERNAL m0_bcount_t m0_ivec_cursor_step | ( | const struct m0_ivec_cursor * | cur | ) |
M0_INTERNAL m0_bindex_t m0_ivec_varr_cursor_conti | ( | const struct m0_ivec_varr_cursor * | cur, |
m0_bindex_t | dest | ||
) |
Returns the latest index through the contiguous segments up to .
cur | cursor to start from. |
dest | uptil where to check. |
Definition at line 1271 of file vec.c.
M0_INTERNAL m0_bindex_t m0_ivec_varr_cursor_index | ( | const struct m0_ivec_varr_cursor * | cur | ) |
M0_INTERNAL void m0_ivec_varr_cursor_init | ( | struct m0_ivec_varr_cursor * | cur, |
struct m0_indexvec_varr * | ivec | ||
) |
M0_INTERNAL bool m0_ivec_varr_cursor_move | ( | struct m0_ivec_varr_cursor * | cur, |
m0_bcount_t | count | ||
) |
Moves the index vector cursor forward by .
cur | Given index vector cursor. |
count | Count by which cursor has to be moved. true iff end of vector has been reached while moving cursor by . Returns false otherwise. |
Definition at line 1198 of file vec.c.
M0_INTERNAL bool m0_ivec_varr_cursor_move_to | ( | struct m0_ivec_varr_cursor * | cur, |
m0_bindex_t | dest | ||
) |
Moves index vector cursor forward until it reaches index .
dest | Index uptil which cursor has to be moved. true iff end of vector has been reached while moving cursor. Returns false otherwise. |
Definition at line 1250 of file vec.c.
|
static |
M0_INTERNAL m0_bcount_t m0_ivec_varr_cursor_step | ( | const struct m0_ivec_varr_cursor * | cur | ) |
Returns the number of bytes needed to move cursor to next segment in given index vector.
cur | Index vector to be moved. Number of bytes needed to move the cursor to next segment. |
Definition at line 1224 of file vec.c.
M0_INTERNAL m0_bcount_t m0_vec_count | ( | const struct m0_vec * | vec | ) |
M0_INTERNAL m0_bcount_t m0_vec_cursor_end | ( | const struct m0_vec_cursor * | cur | ) |
M0_INTERNAL void m0_vec_cursor_init | ( | struct m0_vec_cursor * | cur, |
const struct m0_vec * | vec | ||
) |
|
static |
M0_INTERNAL bool m0_vec_cursor_move | ( | struct m0_vec_cursor * | cur, |
m0_bcount_t | count | ||
) |
Move cursor count bytes further through the vector.
m0_vec_cursor_move(cur, 0) is guaranteed to return true iff cursor is in end of the vector position without modifying cursor in any way.
Definition at line 102 of file vec.c.
|
static |
M0_INTERNAL m0_bcount_t m0_vec_cursor_step | ( | const struct m0_vec_cursor * | cur | ) |
Return number of bytes that the cursor have to be moved to reach the next segment in its vector (or to move into end of the vector position, when the cursor is already at the last segment).
Definition at line 125 of file vec.c.
M0_INTERNAL bool m0_vec_is_empty | ( | const struct m0_vec * | vec | ) |
struct m0_vec M0_XCA_DOMAIN | ( | rpc | ) |
|
static |
|
static |
struct m0_indexvec_varr M0_XCA_DOMAIN |