Motr  M0
read.c File Reference
#include "lib/trace.h"
#include "motr/client.h"
#include "motr/st/st.h"
#include "motr/st/st_misc.h"
#include "motr/st/st_assert.h"
#include "lib/memory.h"
Include dependency graph for read.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT
 

Enumerations

enum  { MAX_READ_OID_NUM = 256 }
 
enum  { CHAR_NUM = 6 }
 

Functions

static struct m0_uint128 read_oid_get (int idx)
 
static int create_objs (int nr_objs)
 
static int write_objs (void)
 
void read_block_has_val (struct m0_bufvec *data, int block_idx, char val)
 
static void read_one_block (void)
 
static void read_multiple_blocks (void)
 
static void read_multiple_blocks_into_aligned_buffers (void)
 
static void read_objs_in_parallel (void)
 
static int st_read_suite_init (void)
 
static int st_read_suite_fini (void)
 

Variables

struct m0_container st_read_container
 
struct m0_addb_ctx m0_addb_ctx
 
static uint32_t unit_size = DEFAULT_PARGRP_UNIT_SIZE
 
static uint64_t layout_id
 
static int read_oid_num = 0
 
static struct m0_uint128 read_oids [MAX_READ_OID_NUM]
 
static char pattern [CHAR_NUM] = {'C', 'L', 'O', 'V', 'I', 'S'}
 
struct st_suite st_suite_m0_read
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT

Definition at line 28 of file read.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_READ_OID_NUM 

Definition at line 43 of file read.c.

◆ anonymous enum

anonymous enum
Enumerator
CHAR_NUM 

Definition at line 114 of file read.c.

Function Documentation

◆ create_objs()

static int create_objs ( int  nr_objs)
static

Definition at line 61 of file read.c.

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

◆ read_block_has_val()

void read_block_has_val ( struct m0_bufvec data,
int  block_idx,
char  val 
)

Examine if data is read correctly from an object which is written in a known pattern (for example, all zero).

Definition at line 210 of file read.c.

Here is the caller graph for this function:

◆ read_multiple_blocks()

static void read_multiple_blocks ( void  )
static

Read multiple blocks from an object, test the expected value is returned.

Definition at line 296 of file read.c.

Here is the call graph for this function:

◆ read_multiple_blocks_into_aligned_buffers()

static void read_multiple_blocks_into_aligned_buffers ( void  )
static

Read multiple blocks from an object into aligned buffers, test the expected value is returned.

Definition at line 382 of file read.c.

Here is the call graph for this function:

◆ read_objs_in_parallel()

static void read_objs_in_parallel ( void  )
static

Definition at line 476 of file read.c.

Here is the call graph for this function:

◆ read_oid_get()

static struct m0_uint128 read_oid_get ( int  idx)
static

Definition at line 48 of file read.c.

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

◆ read_one_block()

static void read_one_block ( void  )
static

Read a single block from an object, test the expected value is returned.

Definition at line 221 of file read.c.

Here is the call graph for this function:

◆ st_read_suite_fini()

static int st_read_suite_fini ( void  )
static

Finalises the read suite's environment.

Definition at line 625 of file read.c.

◆ st_read_suite_init()

static int st_read_suite_init ( void  )
static

Initialises the read suite's environment.

Definition at line 582 of file read.c.

Here is the call graph for this function:

◆ write_objs()

static int write_objs ( void  )
static

Definition at line 117 of file read.c.

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

Variable Documentation

◆ layout_id

uint64_t layout_id
static

Definition at line 41 of file read.c.

◆ m0_addb_ctx

struct m0_addb_ctx m0_addb_ctx

◆ pattern

char pattern[CHAR_NUM] = {'C', 'L', 'O', 'V', 'I', 'S'}
static

Definition at line 115 of file read.c.

◆ read_oid_num

int read_oid_num = 0
static

Definition at line 45 of file read.c.

◆ read_oids

struct m0_uint128 read_oids[MAX_READ_OID_NUM]
static

Definition at line 46 of file read.c.

◆ st_read_container

struct m0_container st_read_container

Definition at line 38 of file read.c.

◆ st_suite_m0_read

struct st_suite st_suite_m0_read
Initial value:
= {
.ss_name = "m0_read_st",
.ss_init = st_read_suite_init,
.ss_fini = st_read_suite_fini,
.ss_tests = {
{ "read_one_block",
{ "read_multiple_blocks",
{ "read_multiple_blocks_into_aligned_buffers",
{ "read_objs_in_parallel",
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static int st_read_suite_fini(void)
Definition: read.c:625
static void read_multiple_blocks(void)
Definition: read.c:296
static void read_objs_in_parallel(void)
Definition: read.c:476
static void read_multiple_blocks_into_aligned_buffers(void)
Definition: read.c:382
static void read_one_block(void)
Definition: read.c:221
static int st_read_suite_init(void)
Definition: read.c:582

Definition at line 630 of file read.c.

◆ unit_size

uint32_t unit_size = DEFAULT_PARGRP_UNIT_SIZE
static

Definition at line 40 of file read.c.