Motr  M0
vec.c File Reference
#include "lib/arith.h"
#include "lib/vec.h"
#include "lib/assert.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/errno.h"
#include "lib/finject.h"
#include "lib/trace.h"
Include dependency graph for vec.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB
 

Functions

 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)
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB

Definition at line 31 of file vec.c.