Motr  M0
dtm0_log.c File Reference
#include "be/dtm0_log.h"
#include "be/alloc.h"
#include "dtm0/clk_src.h"
#include "lib/buf.h"
#include "be/list.h"
#include "be/op.h"
#include "be/tx.h"
#include "be/tx_credit.h"
#include "be/seg.h"
#include "lib/assert.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/trace.h"
#include "dtm0/fop.h"
#include "motr/magic.h"
Include dependency graph for dtm0_log.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM0
 

Functions

 M0_TL_DESCR_DEFINE (lrec, "DTM0 Log", static, struct m0_dtm0_log_rec, u.dlr_tlink, dlr_magic, M0_BE_DTM0_LOG_REC_MAGIX, M0_BE_DTM0_LOG_MAGIX)
 
 M0_TL_DEFINE (lrec, static, struct m0_dtm0_log_rec)
 
 M0_BE_LIST_DESCR_DEFINE (lrec, "DTM0 PLog", static, struct m0_dtm0_log_rec, u.dlr_link, dlr_magic, M0_BE_DTM0_LOG_REC_MAGIX, M0_BE_DTM0_LOG_MAGIX)
 
 M0_BE_LIST_DEFINE (lrec, static, struct m0_dtm0_log_rec)
 
static bool m0_be_dtm0_log__invariant (const struct m0_be_dtm0_log *log)
 
static bool m0_dtm0_log_rec__invariant (const struct m0_dtm0_log_rec *rec)
 
M0_INTERNAL int m0_be_dtm0_log_alloc (struct m0_be_dtm0_log **out)
 
M0_INTERNAL int m0_be_dtm0_log_init (struct m0_be_dtm0_log *log, struct m0_be_seg *seg, struct m0_dtm0_clk_src *cs, bool is_plog)
 
M0_INTERNAL void m0_be_dtm0_log_fini (struct m0_be_dtm0_log *log)
 
M0_INTERNAL void m0_be_dtm0_log_free (struct m0_be_dtm0_log **in_log)
 
static void log_rec_partial_insert_credit (struct m0_dtm0_tx_desc *txd, struct m0_be_seg *seg, struct m0_be_tx_credit *accum)
 
static void log_rec_full_insert_credit (struct m0_dtm0_tx_desc *txd, struct m0_buf *payload, struct m0_be_seg *seg, struct m0_be_tx_credit *accum)
 
static void log_rec_del_credit (struct m0_be_seg *seg, struct m0_dtm0_log_rec *rec, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void log_destroy_credit (struct m0_be_seg *seg, struct m0_be_tx_credit *accum)
 
static void log_create_credit (struct m0_be_seg *seg, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_be_dtm0_log_credit (enum m0_be_dtm0_log_credit_op op, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload, struct m0_be_seg *seg, struct m0_dtm0_log_rec *rec, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_be_dtm0_log_create (struct m0_be_tx *tx, struct m0_be_seg *seg, struct m0_be_dtm0_log **out)
 
M0_INTERNAL void m0_be_dtm0_log_destroy (struct m0_be_tx *tx, struct m0_be_dtm0_log **log)
 
M0_INTERNAL struct m0_dtm0_log_recm0_be_dtm0_log_find (struct m0_be_dtm0_log *log, const struct m0_dtm0_tid *id)
 
static int log_rec_init (struct m0_dtm0_log_rec **rec, struct m0_be_tx *tx, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload)
 
static int plog_rec_init (struct m0_dtm0_log_rec **out, struct m0_be_tx *tx, struct m0_be_seg *seg, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload)
 
static void log_rec_fini (struct m0_dtm0_log_rec **rec, struct m0_be_tx *tx)
 
static void plog_rec_fini (struct m0_dtm0_log_rec **dl_lrec, struct m0_be_dtm0_log *log, struct m0_be_tx *tx)
 
static int dtm0_log__insert (struct m0_be_dtm0_log *log, struct m0_be_tx *tx, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload)
 
static int dtm0_log__set (struct m0_be_dtm0_log *log, struct m0_be_tx *tx, const struct m0_dtm0_tx_desc *txd, const struct m0_buf *payload, struct m0_dtm0_log_rec *rec)
 
M0_INTERNAL int m0_be_dtm0_log_update (struct m0_be_dtm0_log *log, struct m0_be_tx *tx, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload)
 
M0_INTERNAL int m0_be_dtm0_log_prune (struct m0_be_dtm0_log *log, struct m0_be_tx *tx, const struct m0_dtm0_tid *id)
 
M0_INTERNAL void m0_be_dtm0_log_clear (struct m0_be_dtm0_log *log)
 
M0_INTERNAL int m0_be_dtm0_volatile_log_insert (struct m0_be_dtm0_log *log, struct m0_dtm0_log_rec *rec)
 
M0_INTERNAL void m0_be_dtm0_volatile_log_update (struct m0_be_dtm0_log *log, struct m0_dtm0_log_rec *rec)
 
M0_INTERNAL bool m0_be_dtm0_plog_can_prune (struct m0_be_dtm0_log *log, const struct m0_dtm0_tid *id, struct m0_be_tx_credit *accum)
 
M0_INTERNAL int m0_be_dtm0_plog_prune (struct m0_be_dtm0_log *log, struct m0_be_tx *tx, const struct m0_dtm0_tid *id)
 
M0_INTERNAL void m0_be_dtm0_log_pmsg_post (struct m0_be_dtm0_log *log, struct m0_fop *fop)
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM0

Definition at line 22 of file dtm0_log.c.

Function Documentation

◆ dtm0_log__insert()

static int dtm0_log__insert ( struct m0_be_dtm0_log log,
struct m0_be_tx tx,
struct m0_dtm0_tx_desc txd,
struct m0_buf payload 
)
static

Definition at line 399 of file dtm0_log.c.

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

◆ dtm0_log__set()

static int dtm0_log__set ( struct m0_be_dtm0_log log,
struct m0_be_tx tx,
const struct m0_dtm0_tx_desc txd,
const struct m0_buf payload,
struct m0_dtm0_log_rec rec 
)
static

Definition at line 424 of file dtm0_log.c.

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

◆ log_create_credit()

static void log_create_credit ( struct m0_be_seg seg,
struct m0_be_tx_credit accum 
)
static

Definition at line 186 of file dtm0_log.c.

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

◆ log_destroy_credit()

M0_INTERNAL void log_destroy_credit ( struct m0_be_seg seg,
struct m0_be_tx_credit accum 
)

Definition at line 179 of file dtm0_log.c.

◆ log_rec_del_credit()

static void log_rec_del_credit ( struct m0_be_seg seg,
struct m0_dtm0_log_rec rec,
struct m0_be_tx_credit accum 
)
static

Definition at line 167 of file dtm0_log.c.

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

◆ log_rec_fini()

static void log_rec_fini ( struct m0_dtm0_log_rec **  rec,
struct m0_be_tx tx 
)
static

Definition at line 368 of file dtm0_log.c.

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

◆ log_rec_full_insert_credit()

static void log_rec_full_insert_credit ( struct m0_dtm0_tx_desc txd,
struct m0_buf payload,
struct m0_be_seg seg,
struct m0_be_tx_credit accum 
)
static

Definition at line 158 of file dtm0_log.c.

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

◆ log_rec_init()

static int log_rec_init ( struct m0_dtm0_log_rec **  rec,
struct m0_be_tx tx,
struct m0_dtm0_tx_desc txd,
struct m0_buf payload 
)
static

Definition at line 294 of file dtm0_log.c.

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

◆ log_rec_partial_insert_credit()

static void log_rec_partial_insert_credit ( struct m0_dtm0_tx_desc txd,
struct m0_be_seg seg,
struct m0_be_tx_credit accum 
)
static

Calculate credits for a partial update. A partial update (for example, PERSISTENT message) does not have user-specific information required to replay the record, it carries only a transaction descriptor (tx_desc).

Definition at line 136 of file dtm0_log.c.

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

◆ m0_be_dtm0_log__invariant()

static bool m0_be_dtm0_log__invariant ( const struct m0_be_dtm0_log log)
static

Definition at line 52 of file dtm0_log.c.

Here is the caller graph for this function:

◆ M0_BE_LIST_DEFINE()

M0_BE_LIST_DEFINE ( lrec  ,
static  ,
struct m0_dtm0_log_rec   
)

◆ M0_BE_LIST_DESCR_DEFINE()

M0_BE_LIST_DESCR_DEFINE ( lrec  ,
"DTM0 PLog"  ,
static  ,
struct m0_dtm0_log_rec  ,
u.  dlr_link,
dlr_magic  ,
M0_BE_DTM0_LOG_REC_MAGIX  ,
M0_BE_DTM0_LOG_MAGIX   
)

◆ m0_dtm0_log_rec__invariant()

static bool m0_dtm0_log_rec__invariant ( const struct m0_dtm0_log_rec rec)
static

Definition at line 60 of file dtm0_log.c.

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

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( lrec  ,
static  ,
struct m0_dtm0_log_rec   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( lrec  ,
"DTM0 Log"  ,
static  ,
struct m0_dtm0_log_rec  ,
u.  dlr_tlink,
dlr_magic  ,
M0_BE_DTM0_LOG_REC_MAGIX  ,
M0_BE_DTM0_LOG_MAGIX   
)

◆ plog_rec_fini()

static void plog_rec_fini ( struct m0_dtm0_log_rec **  dl_lrec,
struct m0_be_dtm0_log log,
struct m0_be_tx tx 
)
static

Definition at line 386 of file dtm0_log.c.

Here is the caller graph for this function:

◆ plog_rec_init()

static int plog_rec_init ( struct m0_dtm0_log_rec **  out,
struct m0_be_tx tx,
struct m0_be_seg seg,
struct m0_dtm0_tx_desc txd,
struct m0_buf payload 
)
static

Definition at line 323 of file dtm0_log.c.

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