Motr  M0
ad.c File Reference
#include "lib/arith.h"
#include "lib/misc.h"
#include "lib/memory.h"
#include "lib/ub.h"
#include "lib/assert.h"
#include "ut/stob.h"
#include "ut/ut.h"
#include "dtm/dtm.h"
#include "stob/ad.h"
#include "stob/ad_private.h"
#include "stob/domain.h"
#include "stob/io.h"
#include "stob/stob.h"
#include "balloc/balloc.h"
#include "be/ut/helper.h"
#include "lib/errno.h"
Include dependency graph for ad.c:

Go to the source code of this file.

Data Structures

struct  mock_balloc
 

Macros

#define AD_CS_SZ   16
 

Enumerations

enum  { NR = 4, MIN_BUF_SIZE = 4096, MIN_BUF_SIZE_IN_BLOCKS = 4, SEG_SIZE = 1 << 24 }
 
enum  { UB_ITER = 100 }
 

Functions

void m0_stob_ut_ad_init (struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg, bool use_small_credits)
 
void m0_stob_ut_ad_fini (struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg)
 
static struct mock_ballocb2mock (struct m0_ad_balloc *ballroom)
 
static int mock_balloc_init (struct m0_ad_balloc *ballroom, struct m0_be_seg *seg, uint32_t bshift, m0_bindex_t container_size, m0_bcount_t groupsize, m0_bcount_t spare_reserve)
 
static void mock_balloc_fini (struct m0_ad_balloc *ballroom)
 
static int mock_balloc_alloc (struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_type)
 
static int mock_balloc_free (struct m0_ad_balloc *ballroom, struct m0_dtx *dtx, struct m0_ext *ext)
 
static int malloc_reserve_extent (struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
 
static void init_vecs ()
 
static int test_ad_init (bool use_small_credits)
 
static int test_ad_fini (void)
 
static void test_write (int nr, struct m0_dtx *tx)
 
static void test_read (int nr)
 
static void test_punch (int nr)
 
static void test_ad_rw_unordered ()
 
static void test_ad (void)
 
static void punch_test (void)
 
static void test_ad_undo (void)
 
void m0_stob_ut_adieu_ad (void)
 
static void ub_write (int i)
 
static void ub_read (int i)
 
static int ub_init (const char *opts M0_UNUSED)
 
static void ub_fini (void)
 

Variables

static struct m0_stob_domaindom_back
 
static struct m0_stob_domaindom_fore
 
static struct m0_stobobj_back
 
static struct m0_stobobj_fore
 
static struct m0_stob_io io
 
static m0_bcount_t user_vc [NR]
 
static m0_bcount_t stob_vc [NR]
 
static char * user_buf [NR]
 
static char * user_cksm_buf [NR]
 
static char * read_buf [NR]
 
static char * read_cksm_buf [NR]
 
static char * zero_buf [NR]
 
static char * user_bufs [NR]
 
static char * read_bufs [NR]
 
static m0_bindex_t stob_vi [NR]
 
static struct m0_clink clink
 
static struct m0_dtx g_tx
 
struct m0_be_ut_backend ut_be
 
struct m0_be_ut_seg ut_seg
 
static uint32_t block_shift
 
static uint32_t buf_size
 
static const struct m0_ad_balloc_ops mock_balloc_ops
 
struct mock_balloc mb
 
struct m0_ub_set m0_ad_ub