Motr  M0
io_pargrp.c File Reference
#include "layout/layout.h"
#include "lib/trace.h"
#include "lib/uuid.h"
#include "ut/ut.h"
#include "motr/ut/client.h"
#include "motr/io_pargrp.c"
#include "layout/layout_internal.h"
Include dependency graph for io_pargrp.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT
 
#define DUMMY_PTR   0xdeafdead
 
#define UT_DEFAULT_BLOCK_SHIFT   M0_DEFAULT_BUF_SHIFT
 
#define UT_DEFAULT_BLOCK_SIZE   (1ULL << M0_DEFAULT_BUF_SHIFT)
 

Functions

static void ut_test_data_buf_invariant (void)
 
static void ut_test_data_buf_invariant_nr (void)
 
static void ut_test_data_buf_init (void)
 
static void ut_test_data_buf_fini (void)
 
static void ut_test_data_buf_dealloc_fini (void)
 
static void ut_test_data_buf_alloc_init (void)
 
static void ut_test_pargrp_iomap_invariant (void)
 
static void ut_test_pargrp_iomap_invariant_nr (void)
 
static void ut_test_seg_collate (void)
 
static void ut_pargrp_iomap_free_data_buf (struct pargrp_iomap *map, int row, int col)
 
static void ut_test_pargrp_iomap_populate (void)
 
static void ut_test_pargrp_iomap_fullpages_count (void)
 
static void ut_test_pargrp_iomap_seg_process (void)
 
static void ut_test_pargrp_iomap_databuf_alloc (void)
 
static void ut_test_pargrp_iomap_auxbuf_alloc (void)
 
static void ut_test_pargrp_iomap_readold_auxbuf_alloc (void)
 
static void ut_test_pargrp_iomap_readrest (void)
 
static void ut_test_pargrp_iomap_parity_recalc (void)
 
static void ut_test_pargrp_iomap_paritybufs_alloc (void)
 
static void ut_test_pargrp_iomap_spans_seg (void)
 
static void ut_free_pargrp_iomap (struct pargrp_iomap *map)
 
static void ut_test_pargrp_iomap_init (void)
 
static void ut_test_pargrp_iomap_fini (void)
 
 M0_BOB_DECLARE (M0_INTERNAL, m0_layout_enum)
 
static void mock_layout_enum_get (const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
 
static struct m0_layout_enummock_layout_instance_to_enum (const struct m0_layout_instance *li)
 
M0_INTERNAL void ut_set_device_state (struct m0_poolmach *pm, int dev, enum m0_pool_nd_state state)
 
M0_INTERNAL void ut_set_node_state (struct m0_poolmach *pm, int node, enum m0_pool_nd_state state)
 
static void ut_test_pargrp_src_addr (void)
 
static void ut_test_pargrp_id_find (void)
 
static void ut_test_gobj_offset (void)
 
static void ut_test_is_page_read (void)
 
static void ut_test_data_page_offset_get (void)
 
static void ut_test_pargrp_iomap_pages_mark_as_failed (void)
 
static void ut_test_unit_state (void)
 
static void ut_test_io_spare_map (void)
 
static void ut_test_mark_page_as_read_failed (void)
 
static void ut_test_pargrp_iomap_dgmode_process (void)
 
static void ut_test_pargrp_iomap_dgmode_postprocess (void)
 
static void ut_test_pargrp_iomap_dgmode_recover (void)
 
M0_INTERNAL int ut_io_pargrp_init (void)
 
M0_INTERNAL int ut_io_pargrp_fini (void)
 

Variables

static struct m0_clientdummy_instance
 
struct m0_ut_suite ut_suite_io_pargrp
 
static struct m0_fid mock_fid
 
static struct m0_layout_enum_ops mock_layout_enum_ops
 
static struct m0_layout_enum_type mock_layout_enum_type
 
static struct m0_layout_enum mock_layout_enum
 
static struct m0_layout_instance_ops mock_layout_instance_ops
 

Macro Definition Documentation

◆ DUMMY_PTR

#define DUMMY_PTR   0xdeafdead

Definition at line 49 of file io_pargrp.c.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CLIENT

Definition at line 25 of file io_pargrp.c.

◆ UT_DEFAULT_BLOCK_SHIFT

#define UT_DEFAULT_BLOCK_SHIFT   M0_DEFAULT_BUF_SHIFT

Definition at line 51 of file io_pargrp.c.

◆ UT_DEFAULT_BLOCK_SIZE

#define UT_DEFAULT_BLOCK_SIZE   (1ULL << M0_DEFAULT_BUF_SHIFT)

Definition at line 52 of file io_pargrp.c.

Function Documentation

◆ M0_BOB_DECLARE()

M0_BOB_DECLARE ( M0_INTERNAL  ,
m0_layout_enum   
)

◆ mock_layout_enum_get()

static void mock_layout_enum_get ( const struct m0_layout_enum e,
uint32_t  idx,
const struct m0_fid gfid,
struct m0_fid out 
)
static

Definition at line 979 of file io_pargrp.c.

Here is the call graph for this function:

◆ mock_layout_instance_to_enum()

static struct m0_layout_enum* mock_layout_instance_to_enum ( const struct m0_layout_instance li)
static

Definition at line 994 of file io_pargrp.c.

◆ ut_free_pargrp_iomap()

static void ut_free_pargrp_iomap ( struct pargrp_iomap map)
static

Definition at line 853 of file io_pargrp.c.

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

◆ ut_io_pargrp_fini()

M0_INTERNAL int ut_io_pargrp_fini ( void  )

Definition at line 1255 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_io_pargrp_init()

M0_INTERNAL int ut_io_pargrp_init ( void  )

Definition at line 1232 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_pargrp_iomap_free_data_buf()

static void ut_pargrp_iomap_free_data_buf ( struct pargrp_iomap map,
int  row,
int  col 
)
static

Definition at line 265 of file io_pargrp.c.

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

◆ ut_set_device_state()

M0_INTERNAL void ut_set_device_state ( struct m0_poolmach pm,
int  dev,
enum m0_pool_nd_state  state 
)

Definition at line 1006 of file io_pargrp.c.

Here is the caller graph for this function:

◆ ut_set_node_state()

M0_INTERNAL void ut_set_node_state ( struct m0_poolmach pm,
int  node,
enum m0_pool_nd_state  state 
)

Definition at line 1012 of file io_pargrp.c.

Here is the caller graph for this function:

◆ ut_test_data_buf_alloc_init()

static void ut_test_data_buf_alloc_init ( void  )
static

Tests data_buf_alloc_init().

Definition at line 184 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_data_buf_dealloc_fini()

static void ut_test_data_buf_dealloc_fini ( void  )
static

Tests data_buf_dealloc_fini().

Definition at line 172 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_data_buf_fini()

static void ut_test_data_buf_fini ( void  )
static

Tests data_buf_fini().

Definition at line 153 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_data_buf_init()

static void ut_test_data_buf_init ( void  )
static

Tests data_buf_init().

Definition at line 132 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_data_buf_invariant()

static void ut_test_data_buf_invariant ( void  )
static

Tests data_buf_invariant().

Definition at line 57 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_data_buf_invariant_nr()

static void ut_test_data_buf_invariant_nr ( void  )
static

Tests data_buf_invariant_nr().

Definition at line 93 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_data_page_offset_get()

static void ut_test_data_page_offset_get ( void  )
static

Definition at line 1090 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_gobj_offset()

static void ut_test_gobj_offset ( void  )
static

Definition at line 1026 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_io_spare_map()

static void ut_test_io_spare_map ( void  )
static

No tests for the following functions by now as don't know how to set sns repair related parameters and unit_state

Definition at line 1144 of file io_pargrp.c.

◆ ut_test_is_page_read()

static void ut_test_is_page_read ( void  )
static

Definition at line 1055 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_mark_page_as_read_failed()

static void ut_test_mark_page_as_read_failed ( void  )
static

Definition at line 1148 of file io_pargrp.c.

◆ ut_test_pargrp_id_find()

static void ut_test_pargrp_id_find ( void  )
static

Definition at line 1022 of file io_pargrp.c.

◆ ut_test_pargrp_iomap_auxbuf_alloc()

static void ut_test_pargrp_iomap_auxbuf_alloc ( void  )
static

Definition at line 574 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_databuf_alloc()

static void ut_test_pargrp_iomap_databuf_alloc ( void  )
static

Tests pargrp_iomap_databuf_alloc().

Definition at line 529 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_dgmode_postprocess()

static void ut_test_pargrp_iomap_dgmode_postprocess ( void  )
static

Definition at line 1156 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_dgmode_process()

static void ut_test_pargrp_iomap_dgmode_process ( void  )
static

Definition at line 1152 of file io_pargrp.c.

◆ ut_test_pargrp_iomap_dgmode_recover()

static void ut_test_pargrp_iomap_dgmode_recover ( void  )
static

Definition at line 1184 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_fini()

static void ut_test_pargrp_iomap_fini ( void  )
static

Tests pargrp_iomap_fini().

Definition at line 925 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_fullpages_count()

static void ut_test_pargrp_iomap_fullpages_count ( void  )
static

Definition at line 423 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_init()

static void ut_test_pargrp_iomap_init ( void  )
static

Tests pargrp_iomap_init().

Definition at line 890 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_invariant()

static void ut_test_pargrp_iomap_invariant ( void  )
static

Tests pargrp_iomap_invariant().

Definition at line 214 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_invariant_nr()

static void ut_test_pargrp_iomap_invariant_nr ( void  )
static

Tests pargrp_iomap_invariant_nr().

Definition at line 241 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_pages_mark_as_failed()

static void ut_test_pargrp_iomap_pages_mark_as_failed ( void  )
static

Definition at line 1110 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_parity_recalc()

static void ut_test_pargrp_iomap_parity_recalc ( void  )
static

Definition at line 702 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_paritybufs_alloc()

static void ut_test_pargrp_iomap_paritybufs_alloc ( void  )
static

Definition at line 758 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_populate()

static void ut_test_pargrp_iomap_populate ( void  )
static

Definition at line 273 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_readold_auxbuf_alloc()

static void ut_test_pargrp_iomap_readold_auxbuf_alloc ( void  )
static

Definition at line 609 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_readrest()

static void ut_test_pargrp_iomap_readrest ( void  )
static

Definition at line 649 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_seg_process()

static void ut_test_pargrp_iomap_seg_process ( void  )
static

Definition at line 444 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_iomap_spans_seg()

static void ut_test_pargrp_iomap_spans_seg ( void  )
static

Tests pargrp_iomap_spans_seg().

Definition at line 808 of file io_pargrp.c.

Here is the call graph for this function:

◆ ut_test_pargrp_src_addr()

static void ut_test_pargrp_src_addr ( void  )
static

Definition at line 1018 of file io_pargrp.c.

◆ ut_test_seg_collate()

static void ut_test_seg_collate ( void  )
static

Definition at line 257 of file io_pargrp.c.

◆ ut_test_unit_state()

static void ut_test_unit_state ( void  )
static

Definition at line 1136 of file io_pargrp.c.

Variable Documentation

◆ dummy_instance

struct m0_client* dummy_instance
static

Definition at line 46 of file io_pargrp.c.

◆ mock_fid

struct m0_fid mock_fid
static

Definition at line 978 of file io_pargrp.c.

◆ mock_layout_enum

struct m0_layout_enum mock_layout_enum
static

Definition at line 991 of file io_pargrp.c.

◆ mock_layout_enum_ops

struct m0_layout_enum_ops mock_layout_enum_ops
static
Initial value:
= {
.leo_get = &mock_layout_enum_get,
}
static void mock_layout_enum_get(const struct m0_layout_enum *e, uint32_t idx, const struct m0_fid *gfid, struct m0_fid *out)
Definition: io_pargrp.c:979

Definition at line 986 of file io_pargrp.c.

◆ mock_layout_enum_type

struct m0_layout_enum_type mock_layout_enum_type
static

Definition at line 990 of file io_pargrp.c.

◆ mock_layout_instance_ops

struct m0_layout_instance_ops mock_layout_instance_ops
static
Initial value:
= {
}
static struct m0_layout_enum * mock_layout_instance_to_enum(const struct m0_layout_instance *li)
Definition: io_pargrp.c:994

Definition at line 1002 of file io_pargrp.c.

◆ ut_suite_io_pargrp

struct m0_ut_suite ut_suite_io_pargrp

Definition at line 47 of file io_pargrp.c.