Motr
M0
|
#include "layout/layout.h"
#include "lib/trace.h"
#include "ut/ut.h"
#include "motr/ut/client.h"
#include "motr/client_internal.h"
#include "motr/pg.h"
#include "motr/io.h"
#include <stdlib.h>
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) |
Variables | |
static const struct m0_bob_type | layout_instance_bob |
static const struct m0_bob_type | pdclust_instance_bob |
static const struct m0_bob_type | pdclust_bob |
const struct pargrp_iomap_ops | mock_iomap_ops |
#define DUMMY_PTR 0xdeafdead |
Definition at line 34 of file io_dummy.c.
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT |
Definition at line 25 of file io_dummy.c.
#define UT_DEFAULT_BLOCK_SHIFT M0_DEFAULT_BUF_SHIFT |
Definition at line 36 of file io_dummy.c.
#define UT_DEFAULT_BLOCK_SIZE (1ULL << M0_DEFAULT_BUF_SHIFT) |
Definition at line 37 of file io_dummy.c.
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_BOB_DEFINE | ( | static | , |
& | layout_instance_bob, | ||
m0_layout_instance | |||
) |
M0_BOB_DEFINE | ( | static | , |
& | pdclust_instance_bob, | ||
m0_pdclust_instance | |||
) |
M0_BOB_DEFINE | ( | static | , |
& | pdclust_bob, | ||
m0_pdclust_layout | |||
) |
|
static |
Definition at line 657 of file io_dummy.c.
|
static |
Definition at line 665 of file io_dummy.c.
|
static |
Mock operation for Calculating parity.
map | The parity group to calculate the parity for. |
Definition at line 652 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 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.
|
static |
Definition at line 39 of file io_dummy.c.
const struct pargrp_iomap_ops mock_iomap_ops |
Definition at line 670 of file io_dummy.c.
|
static |
Definition at line 56 of file io_dummy.c.
|
static |
Definition at line 47 of file io_dummy.c.