Motr
M0
|
Go to the source code of this file.
Macros | |
#define | __MOTR_UT_H__ |
#define | M0_DEFAULT_EP "0@lo:12345:45:101" |
#define | M0_DEFAULT_HA_ADDR "0@lo:12345:66:1" |
#define | M0_DEFAULT_PROFILE "<0x7000000000000001:0>" |
#define | M0_DEFAULT_PROC_FID "<0x7200000000000000:0>" |
#define | SET_DEFAULT_CONFIG() |
#define | INIT(instance) do_init(instance) |
#define | M0T1FS_LAYOUT_P 4 |
#define | M0T1FS_LAYOUT_N 2 |
#define | M0T1FS_LAYOUT_K 1 |
#define | M0T1FS_LAYOUT_S 1 |
#define | DUMMY_PTR 0xdeafdead |
#define | UT_DEFAULT_BLOCK_SIZE (1ULL << M0_DEFAULT_BUF_SHIFT) |
Variables | |
struct m0_config | default_config |
struct m0_layout_enum | ut_layout_enum |
struct m0_layout_instance_ops | ut_layout_instance_ops |
const struct pargrp_iomap_ops | mock_iomap_ops |
#define SET_DEFAULT_CONFIG | ( | ) |
#define UT_DEFAULT_BLOCK_SIZE (1ULL << M0_DEFAULT_BUF_SHIFT) |
|
inlinestatic |
void dummy_ioreq_fop_cb | ( | struct m0_sm_group * | grp, |
struct m0_sm_ast * | ast | ||
) |
Callback for a ioreq_fop. Executed when an rpc reply is received.
Definition at line 508 of file io_dummy.c.
M0_INTERNAL struct data_buf* ut_dummy_data_buf_create | ( | void | ) |
Creates a UT dummy data_buf. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 200 of file io_dummy.c.
M0_INTERNAL void ut_dummy_data_buf_delete | ( | struct data_buf * | db | ) |
Deletes a UT dummy data_buf. Call this function once for each dummy created.
Definition at line 209 of file io_dummy.c.
M0_INTERNAL void ut_dummy_data_buf_fini | ( | struct data_buf * | db | ) |
Finalises a UT dummy data_buf.
Definition at line 232 of file io_dummy.c.
M0_INTERNAL void ut_dummy_data_buf_init | ( | struct data_buf * | db | ) |
Initialises a UT dummy data_buf.
Definition at line 215 of file io_dummy.c.
Creates a UT dummy m0_op_io. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 366 of file io_dummy.c.
Deletes a UT dummy m0_op_io. Call this function once for each dummy created.
Definition at line 463 of file io_dummy.c.
M0_INTERNAL struct ioreq_fop* ut_dummy_ioreq_fop_create | ( | void | ) |
Creates a UT dummy ioreq_fop. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 512 of file io_dummy.c.
M0_INTERNAL void ut_dummy_ioreq_fop_delete | ( | struct ioreq_fop * | fop | ) |
Deletes a UT dummy ioreq_fop. Call this function once for each dummy created.
Definition at line 526 of file io_dummy.c.
M0_INTERNAL struct m0_obj* ut_dummy_obj_create | ( | void | ) |
Creates a UT dummy m0_obj. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 64 of file io_dummy.c.
M0_INTERNAL void ut_dummy_obj_delete | ( | struct m0_obj * | obj | ) |
Deletes a UT dummy m0_obj. Call this function once for each dummy created.
Definition at line 73 of file io_dummy.c.
M0_INTERNAL struct pargrp_iomap* ut_dummy_pargrp_iomap_create | ( | struct m0_client * | instance, |
int | num_blocks | ||
) |
Allocate an iomap structure, to be freed by ut_dummy_pargrp_iomap_delete.
instance | The client instance to use. |
num_blocks | The number of 4K blocks you will read/write with this map. This value must be <= M0T1FS_LAYOUT_N; |
Definition at line 301 of file io_dummy.c.
M0_INTERNAL void ut_dummy_pargrp_iomap_delete | ( | struct pargrp_iomap * | map, |
struct m0_client * | instance | ||
) |
Deletes a UT dummy pargrp_iomap. Call this function once for each dummy created.
Definition at line 340 of file io_dummy.c.
M0_INTERNAL void ut_dummy_paritybufs_create | ( | struct pargrp_iomap * | map, |
bool | do_alloc | ||
) |
Definition at line 251 of file io_dummy.c.
M0_INTERNAL void ut_dummy_paritybufs_delete | ( | struct pargrp_iomap * | map, |
bool | do_free | ||
) |
Definition at line 281 of file io_dummy.c.
M0_INTERNAL struct m0_pdclust_instance* ut_dummy_pdclust_instance_create | ( | struct m0_pdclust_layout * | pdl | ) |
Creates a UT dummy m0_pdclust_instance. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 118 of file io_dummy.c.
M0_INTERNAL void ut_dummy_pdclust_instance_delete | ( | struct m0_pdclust_instance * | pdi | ) |
Deletes a UT dummy m0_pdclust_instance. Call this function once for each dummy created.
Definition at line 158 of file io_dummy.c.
M0_INTERNAL struct m0_pdclust_layout* ut_dummy_pdclust_layout_create | ( | struct m0_client * | instance | ) |
Creates a UT dummy m0_pdclust_layout. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 79 of file io_dummy.c.
M0_INTERNAL void ut_dummy_pdclust_layout_delete | ( | struct m0_pdclust_layout * | pl, |
struct m0_client * | instance | ||
) |
Deletes a UT dummy pdclust_layout. Call this function once for each dummy created.
Definition at line 108 of file io_dummy.c.
M0_INTERNAL int ut_dummy_poolmach_create | ( | struct m0_pool_version * | pv | ) |
Creates a UT dummy pool machine.
Definition at line 563 of file io_dummy.c.
M0_INTERNAL void ut_dummy_poolmach_delete | ( | struct m0_pool_version * | pv | ) |
Deletes a UT dummy pool machine.
Definition at line 628 of file io_dummy.c.
M0_INTERNAL struct target_ioreq* ut_dummy_target_ioreq_create | ( | void | ) |
Creates a UT dummy target_ioreq. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 532 of file io_dummy.c.
M0_INTERNAL void ut_dummy_target_ioreq_delete | ( | struct target_ioreq * | ti | ) |
Deletes a UT dummy target_ioreq. Call this function once for each dummy created.
Definition at line 552 of file io_dummy.c.
M0_INTERNAL struct nw_xfer_request* ut_dummy_xfer_req_create | ( | void | ) |
Creates a UT dummy nw_xfer_request. This allows passing some invariants() forced by the lower layers of Motr.
Definition at line 178 of file io_dummy.c.
M0_INTERNAL void ut_dummy_xfer_req_delete | ( | struct nw_xfer_request * | xfer | ) |
Deletes a UT dummy nw_xfer_request. Call this function once for each dummy created.
Definition at line 193 of file io_dummy.c.
M0_INTERNAL void ut_dummy_xfer_req_fini | ( | struct nw_xfer_request * | xfer | ) |
Finalises a UT dummy nw_xfer_request.
Definition at line 187 of file io_dummy.c.
M0_INTERNAL void ut_dummy_xfer_req_init | ( | struct nw_xfer_request * | xfer | ) |
Initialises a UT dummy nw_xfer_request.
Definition at line 171 of file io_dummy.c.
M0_INTERNAL int ut_fini | ( | void | ) |
M0_INTERNAL struct m0_pdclust_layout* ut_get_pdclust_layout_from_ioo | ( | struct m0_op_io * | ioo | ) |
Returns the pdclust_layout of an ioo.
Definition at line 456 of file io_dummy.c.
M0_INTERNAL int ut_init | ( | void | ) |
void ut_layout_domain_empty | ( | struct m0_client * | cinst | ) |
Empties a layout domain that has been filled via ut_layout_domain_fill().
cinst | client instance. |
Definition at line 218 of file obj.c.
void ut_layout_domain_fill | ( | struct m0_client * | cinst | ) |
Fills the layout_domain of a m0_ instance, so it contains only a layout's id. This only guarantees m0_layout_find(M0_DEFAULT_LAYOUT_ID) returns something.
layout | layout to be added to the domain. |
cinst | client instance. |
Definition at line 208 of file obj.c.
M0_INTERNAL void ut_m0_client_fini | ( | struct m0_client ** | instance | ) |
A version of m0_client_fini for use in unit tests. This will finalise whatever was done in ut_m0_client_init.
instance | A pointer to where the instance should be stored. |
Definition at line 354 of file client.c.
M0_INTERNAL int ut_m0_client_init | ( | struct m0_client ** | instance | ) |
A version of m0_client_init for use in unit tests. This will initialise client as far as we can in this environment.
instance | A pointer to where the instance should be stored. |
Definition at line 265 of file client.c.
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 | ||
) |
M0_INTERNAL void ut_shuffle_test_order | ( | struct m0_ut_suite * | suite | ) |
M0_INTERNAL void ut_striped_layout_fini | ( | struct m0_striped_layout * | stl, |
struct m0_layout_domain * | dom | ||
) |
M0_INTERNAL void ut_striped_layout_init | ( | struct m0_striped_layout * | stl, |
struct m0_layout_domain * | dom | ||
) |
const struct pargrp_iomap_ops mock_iomap_ops |
Definition at line 670 of file io_dummy.c.
struct m0_layout_enum ut_layout_enum |
struct m0_layout_instance_ops ut_layout_instance_ops |