Motr  M0
balloc.c File Reference
#include <stdlib.h>
#include <errno.h>
#include <sys/time.h>
#include <err.h>
#include "lib/trace.h"
#include "lib/arith.h"
#include "lib/misc.h"
#include "lib/assert.h"
#include "lib/memory.h"
#include "lib/thread.h"
#include "lib/getopts.h"
#include "dtm/dtm.h"
#include "motr/magic.h"
#include "ut/ut.h"
#include "ut/be.h"
#include "balloc/balloc.h"
#include "be/ut/helper.h"
#include "stob/ad.h"
Include dependency graph for balloc.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_BALLOC
 
#define BALLOC_DBNAME   "./__balloc_db"
 
#define GROUP_SIZE
 
#define BALLOC_DEBUG
 

Enumerations

enum  balloc_invariant_enum { INVAR_ALLOC, INVAR_FREE }
 

Functions

bool balloc_ut_invariant (struct m0_balloc *motr_balloc, struct m0_ext alloc_ext, int balloc_invariant_flag)
 
int test_balloc_ut_ops (struct m0_be_ut_backend *ut_be, struct m0_be_seg *seg, bool is_reserve)
 
void test_balloc ()
 
void test_reserve_extent ()
 

Variables

static const int MAX = 10
 
static m0_bcount_t prev_free_blocks
 
m0_bcount_tprev_group_info_free_blocks
 
struct m0_ut_suite balloc_ut
 

Macro Definition Documentation

◆ BALLOC_DBNAME

#define BALLOC_DBNAME   "./__balloc_db"

Definition at line 44 of file balloc.c.

◆ BALLOC_DEBUG

#define BALLOC_DEBUG

Definition at line 49 of file balloc.c.

◆ GROUP_SIZE

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_BALLOC

Definition at line 28 of file balloc.c.

Enumeration Type Documentation

◆ balloc_invariant_enum

Enumerator
INVAR_ALLOC 
INVAR_FREE 

Definition at line 55 of file balloc.c.

Function Documentation

◆ balloc_ut_invariant()

bool balloc_ut_invariant ( struct m0_balloc motr_balloc,
struct m0_ext  alloc_ext,
int  balloc_invariant_flag 
)

Definition at line 60 of file balloc.c.

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

◆ test_balloc()

void test_balloc ( )

Definition at line 268 of file balloc.c.

Here is the call graph for this function:

◆ test_balloc_ut_ops()

int test_balloc_ut_ops ( struct m0_be_ut_backend ut_be,
struct m0_be_seg seg,
bool  is_reserve 
)

Verifies balloc operations.

Parameters
is_reservetrue to reserve an extent. false to allocate an extent.
Returns
0 on success. -errno on failure.

Definition at line 99 of file balloc.c.

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

◆ test_reserve_extent()

void test_reserve_extent ( )

Definition at line 285 of file balloc.c.

Here is the call graph for this function:

Variable Documentation

◆ balloc_ut

struct m0_ut_suite balloc_ut
Initial value:
= {
.ts_name = "balloc-ut",
.ts_init = NULL,
.ts_fini = NULL,
.ts_tests = {
{ "balloc", test_balloc},
{ "reserve blocks for extmap", test_reserve_extent},
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
void test_balloc()
Definition: balloc.c:268
void test_reserve_extent()
Definition: balloc.c:285

Definition at line 302 of file balloc.c.

◆ MAX

const int MAX = 10
static

Definition at line 51 of file balloc.c.

◆ prev_free_blocks

m0_bcount_t prev_free_blocks
static

Definition at line 52 of file balloc.c.

◆ prev_group_info_free_blocks

m0_bcount_t* prev_group_info_free_blocks

Definition at line 53 of file balloc.c.