Motr  M0
layout.c File Reference
#include "lib/trace.h"
#include "motr/client.h"
#include "motr/layout.h"
#include "motr/st/st.h"
#include "motr/st/st_misc.h"
#include "motr/st/st_assert.h"
#include "lib/memory.h"
#include "lib/vec.h"
#include "lib/types.h"
#include "lib/errno.h"
#include <stdlib.h>
#include <unistd.h>
Include dependency graph for layout.c:

Go to the source code of this file.

Data Structures

struct  composite_extent
 
struct  io_seg
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT
 

Enumerations

enum  { CHAR_NUM = 6 }
 

Functions

static int create_obj (struct m0_uint128 id)
 
static int write_obj (struct m0_uint128 id)
 
static void layout_op_get_obj (void)
 
static int layout_create_capture_obj (struct m0_client_layout *layout, struct m0_uint128 *ret_id)
 
static void layout_capture (void)
 
static void layout_capture_io (void)
 
static int layout_composite_create_obj (struct m0_client_layout *layout, struct m0_uint128 *ret_id)
 
static int layout_composite_add_layers (struct m0_client_layout *layout, int nr_layers, struct m0_uint128 *layer_ids)
 
static void layout_composite_create (void)
 
static void layout_composite_create_then_get (void)
 
static int write_io_segs (struct m0_uint128 id, int nr_io_segs, struct io_seg *io_segs)
 
static int fill_ext_kv_pairs (struct composite_extent *exts, int nr_exts, struct m0_bufvec *keys, struct m0_bufvec *vals)
 
static int do_add_extents (struct m0_uint128 id, struct m0_bufvec *keys, struct m0_bufvec *vals, int *rcs)
 
static int add_extents (struct m0_uint128 id, int nr_exts, struct composite_extent *exts)
 
static void layout_composite_io_one_layer (void)
 
static void layout_composite_io_multi_layers (void)
 
static void layout_composite_io_overlapping_layers (void)
 
static void layout_composite_io_on_capture_layer (void)
 
static void layout_composite_extent_idx (void)
 
static int st_layout_suite_init (void)
 
static int st_layout_suite_fini (void)
 

Variables

static char pattern [CHAR_NUM] = {'C', 'L', 'O', 'V', 'I', 'S'}
 
static struct m0_uint128 test_id
 
struct m0_container st_layout_container
 
static uint64_t layout_id
 
static uint32_t unit_size = DEFAULT_PARGRP_UNIT_SIZE
 
struct st_suite st_suite_layout
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT

Definition at line 23 of file layout.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CHAR_NUM 

Definition at line 47 of file layout.c.

Function Documentation

◆ add_extents()

static int add_extents ( struct m0_uint128  id,
int  nr_exts,
struct composite_extent exts 
)
static

Definition at line 709 of file layout.c.

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

◆ create_obj()

static int create_obj ( struct m0_uint128  id)
static

Creates an object.

Definition at line 58 of file layout.c.

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

◆ do_add_extents()

static int do_add_extents ( struct m0_uint128  id,
struct m0_bufvec keys,
struct m0_bufvec vals,
int *  rcs 
)
static

Definition at line 679 of file layout.c.

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

◆ fill_ext_kv_pairs()

static int fill_ext_kv_pairs ( struct composite_extent exts,
int  nr_exts,
struct m0_bufvec keys,
struct m0_bufvec vals 
)
static

Definition at line 652 of file layout.c.

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

◆ layout_capture()

static void layout_capture ( void  )
static

Test m0_client_layout_capture() and create an object with capture layout.

Definition at line 256 of file layout.c.

Here is the call graph for this function:

◆ layout_capture_io()

static void layout_capture_io ( void  )
static

Test IO on an object with capture layout.

Definition at line 327 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_add_layers()

static int layout_composite_add_layers ( struct m0_client_layout layout,
int  nr_layers,
struct m0_uint128 layer_ids 
)
static

Definition at line 435 of file layout.c.

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

◆ layout_composite_create()

static void layout_composite_create ( void  )
static

Test creating a new object with composite layout.

Definition at line 475 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_create_obj()

static int layout_composite_create_obj ( struct m0_client_layout layout,
struct m0_uint128 ret_id 
)
static

Definition at line 399 of file layout.c.

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

◆ layout_composite_create_then_get()

static void layout_composite_create_then_get ( void  )
static

Test creating a new object with composite layout then issuing LAYOUT_GET op to verify.

Definition at line 504 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_extent_idx()

static void layout_composite_extent_idx ( void  )
static

Definition at line 1053 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_io_multi_layers()

static void layout_composite_io_multi_layers ( void  )
static

Definition at line 811 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_io_on_capture_layer()

static void layout_composite_io_on_capture_layer ( void  )
static

Definition at line 927 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_io_one_layer()

static void layout_composite_io_one_layer ( void  )
static

Definition at line 744 of file layout.c.

Here is the call graph for this function:

◆ layout_composite_io_overlapping_layers()

static void layout_composite_io_overlapping_layers ( void  )
static

Definition at line 867 of file layout.c.

Here is the call graph for this function:

◆ layout_create_capture_obj()

static int layout_create_capture_obj ( struct m0_client_layout layout,
struct m0_uint128 ret_id 
)
static

Definition at line 219 of file layout.c.

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

◆ layout_op_get_obj()

static void layout_op_get_obj ( void  )
static

Test m0_layout_op() on normal object.

Definition at line 170 of file layout.c.

Here is the call graph for this function:

◆ st_layout_suite_fini()

static int st_layout_suite_fini ( void  )
static

Finalises the obj suite's environment.

Definition at line 1135 of file layout.c.

◆ st_layout_suite_init()

static int st_layout_suite_init ( void  )
static

Initialises the obj suite's environment.

Definition at line 1109 of file layout.c.

Here is the call graph for this function:

◆ write_io_segs()

static int write_io_segs ( struct m0_uint128  id,
int  nr_io_segs,
struct io_seg io_segs 
)
static

Definition at line 582 of file layout.c.

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

◆ write_obj()

static int write_obj ( struct m0_uint128  id)
static

Definition at line 90 of file layout.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 52 of file layout.c.

◆ pattern

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

Definition at line 48 of file layout.c.

◆ st_layout_container

struct m0_container st_layout_container

Definition at line 51 of file layout.c.

◆ st_suite_layout

struct st_suite st_suite_layout
Initial value:
= {
.ss_name = "layout_st",
.ss_tests = {
{ "layout_op_get_obj",
{ "layout_capture",
{ "layout_capture_io",
{ "layout_composite_create",
{ "layout_composite_create_then_get",
{ "layout_composite_extent_idx",
{ "layout_composite_io_one_layer",
{ "layout_composite_io_multi_layers",
{ "layout_composite_io_overlapping_layers",
{ "layout_composite_io_on_capture_layer",
{ NULL, NULL }
}
}
static int st_layout_suite_fini(void)
Definition: layout.c:1135
#define NULL
Definition: misc.h:38
static void layout_composite_io_overlapping_layers(void)
Definition: layout.c:867
static void layout_composite_create_then_get(void)
Definition: layout.c:504
static void layout_op_get_obj(void)
Definition: layout.c:170
static int st_layout_suite_init(void)
Definition: layout.c:1109
static void layout_capture(void)
Definition: layout.c:256
static void layout_composite_extent_idx(void)
Definition: layout.c:1053
static void layout_composite_io_one_layer(void)
Definition: layout.c:744
static void layout_composite_io_on_capture_layer(void)
Definition: layout.c:927
static void layout_composite_create(void)
Definition: layout.c:475
static void layout_capture_io(void)
Definition: layout.c:327
static void layout_composite_io_multi_layers(void)
Definition: layout.c:811

Definition at line 1140 of file layout.c.

◆ test_id

struct m0_uint128 test_id
static

Definition at line 50 of file layout.c.

◆ unit_size

uint32_t unit_size = DEFAULT_PARGRP_UNIT_SIZE
static

Definition at line 53 of file layout.c.