Motr  M0
log.c File Reference
#include "be/io.h"
#include "be/log.h"
#include "lib/chan.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "stob/domain.h"
#include "stob/stob.h"
#include "ut/stob.h"
#include "ut/threads.h"
#include "ut/ut.h"
Include dependency graph for log.c:

Go to the source code of this file.

Data Structures

struct  be_ut_log_thread_ctx
 

Enumerations

enum  {
  BE_UT_LOG_SIZE = 1024 * 1024, BE_UT_LOG_RESERVE_SIZE = 4096 * 3, BE_UT_LOG_LIO_SIZE = 1600, BE_UT_LOG_THREAD_NR = 24,
  BE_UT_LOG_STOB_DOMAIN_KEY = 100, BE_UT_LOG_STOB_KEY = 42
}
 

Functions

static void be_ut_log_got_space_cb (struct m0_be_log *log)
 
static void be_ut_log_cfg_set (struct m0_be_log_cfg *log_cfg, struct m0_mutex *lock)
 
static void be_ut_log_init (struct m0_be_log *log, struct m0_mutex *lock)
 
static void be_ut_log_fini (struct m0_be_log *log)
 
static int be_ut_log_open (struct m0_be_log *log, struct m0_mutex *lock)
 
static void be_ut_log_multi_thread (struct be_ut_log_thread_ctx *ctx)
 
 M0_UT_THREADS_DEFINE (be_ut_log, be_ut_log_multi_thread)
 
static void be_ut_log_multi_ut (int thread_nr, bool discard, int lio_nr, m0_bcount_t lio_size)
 
static void be_ut_log_record_init_write_one (struct m0_be_log_record *record, struct m0_be_log *log, struct m0_mutex *lock, struct m0_be_op *op)
 
static void be_ut_log_record_wait_fini_one (struct m0_be_log_record *record, struct m0_mutex *lock, struct m0_be_op *op, bool discard)
 
static void be_ut_log_record_write_sync (struct m0_be_log *log, struct m0_mutex *lock, m0_bindex_t *index, m0_bcount_t *size)
 
static void be_ut_log_curr_pos_check (struct m0_be_log *log, m0_bindex_t pos)
 
static void be_ut_log_header_repair_test (int header_nr, int new_nr, m0_bindex_t lsn_old, m0_bcount_t size_old, m0_bindex_t lsn_new, m0_bcount_t size_new, int valid_index)
 
void m0_be_ut_log_multi (void)
 
static void be_ut_log_recover_and_discard (struct m0_be_log *log, struct m0_mutex *lock)
 
void m0_be_ut_log_unplaced (void)
 
void m0_be_ut_log_header (void)
 
void m0_be_ut_log_api (void)
 
void m0_be_ut_log_user (void)
 

Variables

const char * be_ut_log_sdom_location = "linuxstob:./log"
 
const char * be_ut_log_sdom_init_cfg = "directio=true"
 
const char * be_ut_log_sdom_create_cfg = ""
 
struct m0_stob_domainbe_ut_log_stob_domain
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BE_UT_LOG_SIZE 
BE_UT_LOG_RESERVE_SIZE 
BE_UT_LOG_LIO_SIZE 
BE_UT_LOG_THREAD_NR 
BE_UT_LOG_STOB_DOMAIN_KEY 
BE_UT_LOG_STOB_KEY 

Definition at line 34 of file log.c.

Function Documentation

◆ be_ut_log_cfg_set()

static void be_ut_log_cfg_set ( struct m0_be_log_cfg log_cfg,
struct m0_mutex lock 
)
static

Definition at line 55 of file log.c.

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

◆ be_ut_log_curr_pos_check()

static void be_ut_log_curr_pos_check ( struct m0_be_log log,
m0_bindex_t  pos 
)
static

Definition at line 380 of file log.c.

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

◆ be_ut_log_fini()

static void be_ut_log_fini ( struct m0_be_log log)
static

Definition at line 94 of file log.c.

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

◆ be_ut_log_got_space_cb()

static void be_ut_log_got_space_cb ( struct m0_be_log log)
static

Definition at line 50 of file log.c.

Here is the caller graph for this function:

◆ be_ut_log_header_repair_test()

static void be_ut_log_header_repair_test ( int  header_nr,
int  new_nr,
m0_bindex_t  lsn_old,
m0_bcount_t  size_old,
m0_bindex_t  lsn_new,
m0_bcount_t  size_new,
int  valid_index 
)
static

Definition at line 394 of file log.c.

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

◆ be_ut_log_init()

static void be_ut_log_init ( struct m0_be_log log,
struct m0_mutex lock 
)
static

Definition at line 78 of file log.c.

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

◆ be_ut_log_multi_thread()

static void be_ut_log_multi_thread ( struct be_ut_log_thread_ctx ctx)
static

Definition at line 127 of file log.c.

Here is the call graph for this function:

◆ be_ut_log_multi_ut()

static void be_ut_log_multi_ut ( int  thread_nr,
bool  discard,
int  lio_nr,
m0_bcount_t  lio_size 
)
static

Definition at line 173 of file log.c.

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

◆ be_ut_log_open()

static int be_ut_log_open ( struct m0_be_log log,
struct m0_mutex lock 
)
static

Definition at line 103 of file log.c.

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

◆ be_ut_log_record_init_write_one()

static void be_ut_log_record_init_write_one ( struct m0_be_log_record record,
struct m0_be_log log,
struct m0_mutex lock,
struct m0_be_op op 
)
static

Definition at line 315 of file log.c.

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

◆ be_ut_log_record_wait_fini_one()

static void be_ut_log_record_wait_fini_one ( struct m0_be_log_record record,
struct m0_mutex lock,
struct m0_be_op op,
bool  discard 
)
static

Definition at line 342 of file log.c.

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

◆ be_ut_log_record_write_sync()

static void be_ut_log_record_write_sync ( struct m0_be_log log,
struct m0_mutex lock,
m0_bindex_t index,
m0_bcount_t size 
)
static

Definition at line 365 of file log.c.

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

◆ be_ut_log_recover_and_discard()

static void be_ut_log_recover_and_discard ( struct m0_be_log log,
struct m0_mutex lock 
)
static
See also
be_ut_recovery_iter_count()

Definition at line 450 of file log.c.

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

◆ m0_be_ut_log_api()

void m0_be_ut_log_api ( void  )

Definition at line 638 of file log.c.

Here is the call graph for this function:

◆ m0_be_ut_log_header()

void m0_be_ut_log_header ( void  )

Definition at line 576 of file log.c.

Here is the call graph for this function:

◆ m0_be_ut_log_multi()

void m0_be_ut_log_multi ( void  )

Definition at line 438 of file log.c.

Here is the call graph for this function:

◆ m0_be_ut_log_unplaced()

void m0_be_ut_log_unplaced ( void  )

Definition at line 491 of file log.c.

Here is the call graph for this function:

◆ m0_be_ut_log_user()

void m0_be_ut_log_user ( void  )

Definition at line 680 of file log.c.

Here is the call graph for this function:

◆ M0_UT_THREADS_DEFINE()

M0_UT_THREADS_DEFINE ( be_ut_log  ,
be_ut_log_multi_thread   
)

Variable Documentation

◆ be_ut_log_sdom_create_cfg

const char* be_ut_log_sdom_create_cfg = ""

Definition at line 46 of file log.c.

◆ be_ut_log_sdom_init_cfg

const char* be_ut_log_sdom_init_cfg = "directio=true"

Definition at line 45 of file log.c.

◆ be_ut_log_sdom_location

const char* be_ut_log_sdom_location = "linuxstob:./log"

Definition at line 44 of file log.c.

◆ be_ut_log_stob_domain

struct m0_stob_domain* be_ut_log_stob_domain

Definition at line 48 of file log.c.