Motr  M0
tx_group_format.c File Reference
#include <string.h>
#include "be/tx_group_format.h"
#include "ut/stob.h"
#include "ut/ut.h"
#include "be/ut/helper.h"
#include "be/seg.h"
#include "be/op.h"
#include "be/log_discard.h"
#include "be/pd.h"
#include "lib/arith.h"
#include "lib/memory.h"
#include "stob/stob.h"
#include "stob/domain.h"
Include dependency graph for tx_group_format.c:

Go to the source code of this file.

Data Structures

struct  be_ut_tgf_tx
 
struct  be_ut_tgf_reg
 
struct  be_ut_tgf_group
 
struct  be_ut_tgf_ctx
 

Enumerations

enum  {
  BE_UT_TGF_SEG_ADDR = 0x300000000000ULL, BE_UT_TGF_SEG_SIZE = 1024 * 1024, BE_UT_TGF_LOG_SIZE = 1024 * 1024, BE_UT_TGF_LOG_STOB_DOMAIN_KEY = 100,
  BE_UT_TGF_LOG_STOB_KEY = 42, BE_UT_TGF_LOG_RBUF_NR = 8, BE_UT_TGF_SEG_NR_MAX = 256, BE_UT_TGF_MAGIC = 0xfffe
}
 

Functions

static void be_ut_tgf_log_got_space_cb (struct m0_be_log *log)
 
static void be_ut_tgf_log_cfg_set (struct m0_be_log_cfg *log_cfg, struct m0_stob_domain *sdom, struct m0_mutex *lock)
 
static void be_ut_tgf_log_init (struct be_ut_tgf_ctx *ctx)
 
static void be_ut_tgf_log_fini (struct be_ut_tgf_ctx *ctx)
 
static void be_ut_tgf_log_open (struct be_ut_tgf_ctx *ctx)
 
static void be_ut_tgf_log_close (struct be_ut_tgf_ctx *ctx)
 
static void be_ut_tgf_seg_init (struct be_ut_tgf_ctx *ctx)
 
static void be_ut_tgf_seg_fini (struct be_ut_tgf_ctx *ctx)
 
static void be_ut_tgf_rnd_fill (void *buf, size_t size)
 
static void be_ut_tgf_buf_init (struct be_ut_tgf_ctx *ctx, struct be_ut_tgf_group *group)
 
static void be_ut_tgf_buf_fini (struct be_ut_tgf_ctx *ctx, struct be_ut_tgf_group *group)
 
static void be_ut_tgf_group_init (struct be_ut_tgf_ctx *ctx, struct be_ut_tgf_group *group)
 
static void be_ut_tgf_group_fini (struct be_ut_tgf_ctx *ctx, struct be_ut_tgf_group *group)
 
static void be_ut_tgf_group_write (struct be_ut_tgf_ctx *ctx, struct be_ut_tgf_group *group, bool seg_write)
 
static void be_ut_tgf_group_read_check (struct be_ut_tgf_ctx *ctx, struct be_ut_tgf_group *group, bool seg_check)
 
static void be_ut_tgf_ldsc_sync (struct m0_be_log_discard *ld, struct m0_be_op *op, struct m0_be_log_discard_item *ldi)
 
static void be_ut_tgf_ldsc_discard (struct m0_be_log_discard *ld, struct m0_be_log_discard_item *ldi)
 
static void be_ut_tgf_test (int group_nr, struct be_ut_tgf_group *groups)
 
void m0_be_ut_group_format (void)
 

Variables

static const char * be_ut_tgf_log_sdom_location = "linuxstob:./log"
 
static const char * be_ut_tgf_log_sdom_init_cfg = "directio=true"
 
static const char * be_ut_tgf_log_sdom_create_cfg = ""
 
static bool be_ut_tgf_do_discard
 
static struct be_ut_tgf_tx be_ut_tgf_txs0 []
 
static struct be_ut_tgf_reg be_ut_tgf_regs0 []
 
static struct be_ut_tgf_tx be_ut_tgf_txs1 []
 
static struct be_ut_tgf_reg be_ut_tgf_regs1 []
 
static struct be_ut_tgf_tx be_ut_tgf_txs2 []
 
static struct be_ut_tgf_reg be_ut_tgf_regs2 []
 
static struct be_ut_tgf_group be_ut_tgf_groups []
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BE_UT_TGF_SEG_ADDR 
BE_UT_TGF_SEG_SIZE 
BE_UT_TGF_LOG_SIZE 
BE_UT_TGF_LOG_STOB_DOMAIN_KEY 
BE_UT_TGF_LOG_STOB_KEY 
BE_UT_TGF_LOG_RBUF_NR 
BE_UT_TGF_SEG_NR_MAX 
BE_UT_TGF_MAGIC 

Definition at line 76 of file tx_group_format.c.

Function Documentation

◆ be_ut_tgf_buf_fini()

static void be_ut_tgf_buf_fini ( struct be_ut_tgf_ctx ctx,
struct be_ut_tgf_group group 
)
static

Definition at line 249 of file tx_group_format.c.

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

◆ be_ut_tgf_buf_init()

static void be_ut_tgf_buf_init ( struct be_ut_tgf_ctx ctx,
struct be_ut_tgf_group group 
)
static

Definition at line 203 of file tx_group_format.c.

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

◆ be_ut_tgf_group_fini()

static void be_ut_tgf_group_fini ( struct be_ut_tgf_ctx ctx,
struct be_ut_tgf_group group 
)
static

Definition at line 275 of file tx_group_format.c.

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

◆ be_ut_tgf_group_init()

static void be_ut_tgf_group_init ( struct be_ut_tgf_ctx ctx,
struct be_ut_tgf_group group 
)
static

Definition at line 262 of file tx_group_format.c.

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

◆ be_ut_tgf_group_read_check()

static void be_ut_tgf_group_read_check ( struct be_ut_tgf_ctx ctx,
struct be_ut_tgf_group group,
bool  seg_check 
)
static

Definition at line 348 of file tx_group_format.c.

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

◆ be_ut_tgf_group_write()

static void be_ut_tgf_group_write ( struct be_ut_tgf_ctx ctx,
struct be_ut_tgf_group group,
bool  seg_write 
)
static

Definition at line 282 of file tx_group_format.c.

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

◆ be_ut_tgf_ldsc_discard()

static void be_ut_tgf_ldsc_discard ( struct m0_be_log_discard ld,
struct m0_be_log_discard_item ldi 
)
static

Definition at line 436 of file tx_group_format.c.

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

◆ be_ut_tgf_ldsc_sync()

static void be_ut_tgf_ldsc_sync ( struct m0_be_log_discard ld,
struct m0_be_op op,
struct m0_be_log_discard_item ldi 
)
static

Definition at line 428 of file tx_group_format.c.

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

◆ be_ut_tgf_log_cfg_set()

static void be_ut_tgf_log_cfg_set ( struct m0_be_log_cfg log_cfg,
struct m0_stob_domain sdom,
struct m0_mutex lock 
)
static

Definition at line 99 of file tx_group_format.c.

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

◆ be_ut_tgf_log_close()

static void be_ut_tgf_log_close ( struct be_ut_tgf_ctx ctx)
static

Definition at line 161 of file tx_group_format.c.

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

◆ be_ut_tgf_log_fini()

static void be_ut_tgf_log_fini ( struct be_ut_tgf_ctx ctx)
static

Definition at line 140 of file tx_group_format.c.

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

◆ be_ut_tgf_log_got_space_cb()

static void be_ut_tgf_log_got_space_cb ( struct m0_be_log log)
static

Definition at line 95 of file tx_group_format.c.

Here is the caller graph for this function:

◆ be_ut_tgf_log_init()

static void be_ut_tgf_log_init ( struct be_ut_tgf_ctx ctx)
static

Definition at line 123 of file tx_group_format.c.

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

◆ be_ut_tgf_log_open()

static void be_ut_tgf_log_open ( struct be_ut_tgf_ctx ctx)
static

Definition at line 150 of file tx_group_format.c.

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

◆ be_ut_tgf_rnd_fill()

static void be_ut_tgf_rnd_fill ( void *  buf,
size_t  size 
)
static

Definition at line 193 of file tx_group_format.c.

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

◆ be_ut_tgf_seg_fini()

static void be_ut_tgf_seg_fini ( struct be_ut_tgf_ctx ctx)
static

Definition at line 182 of file tx_group_format.c.

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

◆ be_ut_tgf_seg_init()

static void be_ut_tgf_seg_init ( struct be_ut_tgf_ctx ctx)
static

Definition at line 166 of file tx_group_format.c.

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

◆ be_ut_tgf_test()

static void be_ut_tgf_test ( int  group_nr,
struct be_ut_tgf_group groups 
)
static

Definition at line 443 of file tx_group_format.c.

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

◆ m0_be_ut_group_format()

void m0_be_ut_group_format ( void  )

Definition at line 584 of file tx_group_format.c.

Here is the call graph for this function:

Variable Documentation

◆ be_ut_tgf_do_discard

bool be_ut_tgf_do_discard
static

Definition at line 93 of file tx_group_format.c.

◆ be_ut_tgf_groups

struct be_ut_tgf_group be_ut_tgf_groups[]
static
Initial value:
= {
{
.tgfg_tx_nr = ARRAY_SIZE(be_ut_tgf_txs0),
.tgfg_txs = be_ut_tgf_txs0,
.tgfg_reg_nr = ARRAY_SIZE(be_ut_tgf_regs0),
.tgfg_regs = be_ut_tgf_regs0,
},
{
.tgfg_tx_nr = ARRAY_SIZE(be_ut_tgf_txs1),
.tgfg_txs = be_ut_tgf_txs1,
.tgfg_reg_nr = ARRAY_SIZE(be_ut_tgf_regs1),
.tgfg_regs = be_ut_tgf_regs1,
},
{
.tgfg_tx_nr = ARRAY_SIZE(be_ut_tgf_txs2),
.tgfg_txs = be_ut_tgf_txs2,
.tgfg_reg_nr = ARRAY_SIZE(be_ut_tgf_regs2),
.tgfg_regs = be_ut_tgf_regs2,
},
}
static struct be_ut_tgf_tx be_ut_tgf_txs2[]
static struct be_ut_tgf_reg be_ut_tgf_regs0[]
static struct be_ut_tgf_tx be_ut_tgf_txs0[]
static struct be_ut_tgf_reg be_ut_tgf_regs2[]
static struct be_ut_tgf_tx be_ut_tgf_txs1[]
static struct be_ut_tgf_reg be_ut_tgf_regs1[]
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 563 of file tx_group_format.c.

◆ be_ut_tgf_log_sdom_create_cfg

const char* be_ut_tgf_log_sdom_create_cfg = ""
static

Definition at line 92 of file tx_group_format.c.

◆ be_ut_tgf_log_sdom_init_cfg

const char* be_ut_tgf_log_sdom_init_cfg = "directio=true"
static

Definition at line 91 of file tx_group_format.c.

◆ be_ut_tgf_log_sdom_location

const char* be_ut_tgf_log_sdom_location = "linuxstob:./log"
static

Definition at line 90 of file tx_group_format.c.

◆ be_ut_tgf_regs0

struct be_ut_tgf_reg be_ut_tgf_regs0[]
static
Initial value:
= {
{ .tgfr_size = 1024, },
{ .tgfr_size = 1024, },
{ .tgfr_size = 1024, },
}

Definition at line 539 of file tx_group_format.c.

◆ be_ut_tgf_regs1

struct be_ut_tgf_reg be_ut_tgf_regs1[]
static
Initial value:
= {
{ .tgfr_size = 1024, },
{ .tgfr_size = 1023, },
}

Definition at line 549 of file tx_group_format.c.

◆ be_ut_tgf_regs2

struct be_ut_tgf_reg be_ut_tgf_regs2[]
static
Initial value:
= {
{ .tgfr_size = 512, },
{ .tgfr_size = 100, },
{ .tgfr_size = 1000, },
}

Definition at line 557 of file tx_group_format.c.

◆ be_ut_tgf_txs0

struct be_ut_tgf_tx be_ut_tgf_txs0[]
static
Initial value:
= {
{ .tgft_payload_size = 1024, .tgft_id = 1, },
}

Definition at line 536 of file tx_group_format.c.

◆ be_ut_tgf_txs1

struct be_ut_tgf_tx be_ut_tgf_txs1[]
static
Initial value:
= {
{ .tgft_payload_size = 1024, .tgft_id = 1, },
{ .tgft_payload_size = 513, .tgft_id = 2, },
{ .tgft_payload_size = 100, .tgft_id = 3, },
}

Definition at line 544 of file tx_group_format.c.

◆ be_ut_tgf_txs2

struct be_ut_tgf_tx be_ut_tgf_txs2[]
static
Initial value:
= {
{ .tgft_payload_size = 1000, .tgft_id = 1ULL << 63, },
{ .tgft_payload_size = 500, .tgft_id = 1ULL << 62, },
}

Definition at line 553 of file tx_group_format.c.