Motr  M0
Collaboration diagram for Serialization:

Functions

 M0_BASSERT (sizeof(long)==8)
 
 M0_BASSERT (sizeof(void *)==8)
 
 M0_BASSERT (sizeof(int)==4)
 
static void net_test_serialize_cpu_to_le (char *d, char *s, m0_bcount_t len)
 
static void net_test_serialize_le_to_cpu (char *d, char *s, m0_bcount_t len)
 
static void net_test_serialize_reorder (enum m0_net_test_serialize_op op, char *buf, char *data, m0_bcount_t len)
 
static m0_bcount_t net_test_serialize_data (enum m0_net_test_serialize_op op, void *data, m0_bcount_t data_len, bool plain_data, struct m0_bufvec *bv, m0_bcount_t bv_offset, m0_bcount_t bv_length)
 
m0_bcount_t m0_net_test_serialize_data (enum m0_net_test_serialize_op op, void *data, m0_bcount_t data_len, bool plain_data, struct m0_bufvec *bv, m0_bcount_t bv_offset)
 
m0_bcount_t m0_net_test_serialize (enum m0_net_test_serialize_op op, void *obj, const struct m0_net_test_descr descr[], size_t descr_nr, struct m0_bufvec *bv, m0_bcount_t bv_offset)
 

Detailed Description

See also
Motr Network Benchmark

Function Documentation

◆ M0_BASSERT() [1/3]

M0_BASSERT ( sizeof(long)  = =8)

Environment have LP64 data model

◆ M0_BASSERT() [2/3]

M0_BASSERT ( sizeof(void *)  = =8)

◆ M0_BASSERT() [3/3]

M0_BASSERT ( sizeof(int)  = =4)

◆ m0_net_test_serialize()

m0_bcount_t m0_net_test_serialize ( enum m0_net_test_serialize_op  op,
void *  obj,
const struct m0_net_test_descr  descr[],
size_t  descr_nr,
struct m0_bufvec bv,
m0_bcount_t  bv_offset 
)

Serialize or deserialize data structure with the given description.

Parameters
opOperation. Can be M0_NET_TEST_SERIALIZE or M0_NET_TEST_DESERIALIZE.
objPointer to data structure.
descrArray of data field descriptions.
descr_nrDescribed fields number in descr.
bvm0_bufvec. Can be NULL - in this case bv_offset is ignored.
bv_offsetOffset in bv.
Returns
0 No free space in buffer or descr_nr == 0.
>0 Number of bytes read/written/will be written to/from buffer.
Precondition
op == M0_NET_TEST_SERIALIZE || op == M0_NET_TEST_DESERIALIZE
obj != NULL
descr != NULL
Note
m0_net_test_descr.ntd_length can't be > 8 if m0_net_test_descr.ntd_plain_data is true.

Definition at line 176 of file serialize.c.

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

◆ m0_net_test_serialize_data()

m0_bcount_t m0_net_test_serialize_data ( enum m0_net_test_serialize_op  op,
void *  data,
m0_bcount_t  data_len,
bool  plain_data,
struct m0_bufvec bv,
m0_bcount_t  bv_offset 
)

Serialize or deserialize data.

Precondition
data_len > 0
plain_data || data_len == 1 || data_len == 2 || data_len == 4 || data_len == 8
See also
m0_net_test_serialize().

Definition at line 163 of file serialize.c.

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

◆ net_test_serialize_cpu_to_le()

static void net_test_serialize_cpu_to_le ( char *  d,
char *  s,
m0_bcount_t  len 
)
static

Definition at line 45 of file serialize.c.

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

◆ net_test_serialize_data()

static m0_bcount_t net_test_serialize_data ( enum m0_net_test_serialize_op  op,
void *  data,
m0_bcount_t  data_len,
bool  plain_data,
struct m0_bufvec bv,
m0_bcount_t  bv_offset,
m0_bcount_t  bv_length 
)
static

Serialize/deserialize object field to buffer. Converts field to little-endian representation while serializing and reads field as little-endian from buffer while deserializing.

Note
bv_length is cached version of m0_vec_count(&bv->ov_vec). This value is ignored if bv == NULL.
Precondition
data_len > 0
plain_data || data_len == 1 || data_len == 2 || data_len == 4 || data_len == 8
See also
m0_net_test_serialize().

Definition at line 105 of file serialize.c.

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

◆ net_test_serialize_le_to_cpu()

static void net_test_serialize_le_to_cpu ( char *  d,
char *  s,
m0_bcount_t  len 
)
static

Definition at line 61 of file serialize.c.

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

◆ net_test_serialize_reorder()

static void net_test_serialize_reorder ( enum m0_net_test_serialize_op  op,
char *  buf,
char *  data,
m0_bcount_t  len 
)
static

Convert data to little endian representation.

Precondition
len == 1 || len == 2 || len == 4 || len == 8

Definition at line 81 of file serialize.c.

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