Motr  M0
stubs.c File Reference
#include "lib/errno.h"
#include "lib/memory.h"
#include "be/domain.h"
#include "be/tx.h"
#include "be/seg_internal.h"
#include "be/ut/helper.h"
#include "lib/trace.h"
Include dependency graph for stubs.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_BE
 

Functions

M0_INTERNAL void m0_be_alloc (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void **ptr, m0_bcount_t size)
 
M0_INTERNAL void m0_be_alloc_aligned (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void **ptr, m0_bcount_t size, unsigned shift, uint64_t zonemask)
 
M0_INTERNAL void m0_be_allocator_credit (struct m0_be_allocator *a, enum m0_be_allocator_op optype, m0_bcount_t size, unsigned shift, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_be_free (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void *ptr)
 
M0_INTERNAL void m0_be_free_aligned (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void *ptr)
 
M0_INTERNAL void m0_be_op_init (struct m0_be_op *op)
 
M0_INTERNAL void m0_be_op_fini (struct m0_be_op *op)
 
M0_INTERNAL void m0_be_op_wait (struct m0_be_op *op)
 
M0_INTERNAL void m0_be_op_active (struct m0_be_op *op)
 
M0_INTERNAL void m0_be_op_done (struct m0_be_op *op)
 
M0_INTERNAL bool m0_be_op_is_done (struct m0_be_op *op)
 
M0_INTERNAL struct m0_be_allocatorm0_be_seg_allocator (struct m0_be_seg *seg)
 
M0_INTERNAL void m0_be_seg_init (struct m0_be_seg *seg, struct m0_stob *stob, struct m0_be_domain *dom, uint64_t seg_id)
 
M0_INTERNAL void m0_be_seg_fini (struct m0_be_seg *seg)
 
M0_INTERNAL int m0_be_seg_open (struct m0_be_seg *seg)
 
M0_INTERNAL void m0_be_seg_close (struct m0_be_seg *seg)
 
M0_INTERNAL bool m0_be_seg_contains (const struct m0_be_seg *seg, const void *addr)
 
M0_INTERNAL void m0_be_tx_init (struct m0_be_tx *tx, uint64_t tid, struct m0_be_domain *dom, struct m0_sm_group *sm_group, m0_be_tx_cb_t persistent, m0_be_tx_cb_t discarded, void(*filler)(struct m0_be_tx *tx, void *payload), void *datum)
 
M0_INTERNAL void m0_be_tx_fini (struct m0_be_tx *tx)
 
M0_INTERNAL void m0_be_tx_get (struct m0_be_tx *tx)
 
M0_INTERNAL void m0_be_tx_put (struct m0_be_tx *tx)
 
M0_INTERNAL void m0_be_tx_prep (struct m0_be_tx *tx, const struct m0_be_tx_credit *credit)
 
M0_INTERNAL void m0_be_tx_payload_prep (struct m0_be_tx *tx, m0_bcount_t size)
 
M0_INTERNAL void m0_be_tx_open (struct m0_be_tx *tx)
 
M0_INTERNAL void m0_be_tx_capture (struct m0_be_tx *tx, const struct m0_be_reg *reg)
 
M0_INTERNAL void m0_be_tx_close (struct m0_be_tx *tx)
 
M0_INTERNAL int m0_be_tx_open_sync (struct m0_be_tx *tx)
 
M0_INTERNAL void m0_be_tx_close_sync (struct m0_be_tx *tx)
 
M0_INTERNAL enum m0_be_tx_state m0_be_tx_state (const struct m0_be_tx *tx)
 
M0_INTERNAL int m0_be_tx_timedwait (struct m0_be_tx *tx, uint64_t states, m0_time_t deadline)
 
M0_INTERNAL bool m0_be_seg__invariant (const struct m0_be_seg *seg)
 
void m0_be_ut_backend_cfg_default (struct m0_be_domain_cfg *cfg)
 
M0_INTERNAL int m0_be_ut_backend_init_cfg (struct m0_be_ut_backend *ut_be, const struct m0_be_domain_cfg *cfg, bool mkfs)
 
void m0_be_ut_backend_init (struct m0_be_ut_backend *ut_be)
 
void m0_be_ut_backend_fini (struct m0_be_ut_backend *ut_be)
 
void m0_be_ut_seg_allocator_init (struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be)
 
void m0_be_ut_seg_allocator_fini (struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be)
 
void m0_be_ut_seg_init (struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be, m0_bcount_t size)
 
void m0_be_ut_seg_fini (struct m0_be_ut_seg *ut_seg)
 
void m0_be_ut_seg_reload (struct m0_be_ut_seg *ut_seg)
 
struct m0_sm_groupm0_be_ut_backend_sm_group_lookup (struct m0_be_ut_backend *ut_be)
 
void m0_be_ut_backend_thread_exit (struct m0_be_ut_backend *ut_be)
 
void m0_be_ut_tx_init (struct m0_be_tx *tx, struct m0_be_ut_backend *ut_be)
 
M0_INTERNAL struct m0_be_segm0_be_domain_seg0_get (struct m0_be_domain *dom)
 
int m0_be_tx_fol_add (struct m0_be_tx *tx, struct m0_fol_rec *rec)
 
M0_INTERNAL void m0_be_ut_alloc (struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg, void **ptr, m0_bcount_t size)
 
M0_INTERNAL void m0_be_ut_free (struct m0_be_ut_backend *ut_be, struct m0_be_ut_seg *ut_seg, void *ptr)
 
M0_INTERNAL void m0_be_queue_put (struct m0_be_queue *bq, struct m0_be_op *op, const struct m0_buf *data)
 
M0_INTERNAL void m0_be_queue_lock (struct m0_be_queue *bq)
 
M0_INTERNAL void m0_be_queue_unlock (struct m0_be_queue *bq)
 

Variables

static struct m0_be_seg_hdr khdr
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_BE

Definition at line 31 of file stubs.c.

Function Documentation

◆ m0_be_domain_seg0_get()

M0_INTERNAL struct m0_be_seg* m0_be_domain_seg0_get ( struct m0_be_domain dom)

Definition at line 290 of file stubs.c.

◆ m0_be_op_active()

M0_INTERNAL void m0_be_op_active ( struct m0_be_op op)

Moves op to M0_BOS_ACTIVE state.

Definition at line 100 of file stubs.c.

◆ m0_be_op_done()

M0_INTERNAL void m0_be_op_done ( struct m0_be_op op)

Moves op to M0_BOS_DONE state.

Definition at line 104 of file stubs.c.

◆ m0_be_op_fini()

M0_INTERNAL void m0_be_op_fini ( struct m0_be_op op)

Definition at line 92 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_op_init()

M0_INTERNAL void m0_be_op_init ( struct m0_be_op op)

Definition at line 87 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_op_is_done()

M0_INTERNAL bool m0_be_op_is_done ( struct m0_be_op op)

Is op in M0_BOS_DONE state?

Definition at line 108 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_op_wait()

M0_INTERNAL void m0_be_op_wait ( struct m0_be_op op)

Waits for the operation to complete.

See also
M0_BE_OP_SYNC(), M0_BE_OP_SYNC_RET()

Definition at line 96 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_queue_lock()

M0_INTERNAL void m0_be_queue_lock ( struct m0_be_queue bq)

Definition at line 321 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_queue_put()

M0_INTERNAL void m0_be_queue_put ( struct m0_be_queue bq,
struct m0_be_op op,
const struct m0_buf data 
)

Definition at line 315 of file stubs.c.

◆ m0_be_queue_unlock()

M0_INTERNAL void m0_be_queue_unlock ( struct m0_be_queue bq)

Definition at line 325 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg__invariant()

M0_INTERNAL bool m0_be_seg__invariant ( const struct m0_be_seg seg)

Definition at line 221 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg_allocator()

M0_INTERNAL struct m0_be_allocator * m0_be_seg_allocator ( struct m0_be_seg seg)

Definition at line 113 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg_close()

M0_INTERNAL void m0_be_seg_close ( struct m0_be_seg seg)

Definition at line 140 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg_contains()

M0_INTERNAL bool m0_be_seg_contains ( const struct m0_be_seg seg,
const void *  addr 
)

Definition at line 144 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg_fini()

M0_INTERNAL void m0_be_seg_fini ( struct m0_be_seg seg)

Definition at line 128 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg_init()

M0_INTERNAL void m0_be_seg_init ( struct m0_be_seg seg,
struct m0_stob stob,
struct m0_be_domain dom,
uint64_t  seg_id 
)

Definition at line 118 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_seg_open()

M0_INTERNAL int m0_be_seg_open ( struct m0_be_seg seg)

Opens existing stob, reads segment header from it, etc.

Definition at line 132 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_capture()

M0_INTERNAL void m0_be_tx_capture ( struct m0_be_tx tx,
const struct m0_be_reg reg 
)

Definition at line 190 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_close()

M0_INTERNAL void m0_be_tx_close ( struct m0_be_tx tx)

Definition at line 194 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_close_sync()

M0_INTERNAL void m0_be_tx_close_sync ( struct m0_be_tx tx)

Calls m0_be_tx_close() and then waits until transaction reaches M0_BTS_DONE state.

Definition at line 205 of file stubs.c.

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

◆ m0_be_tx_fini()

M0_INTERNAL void m0_be_tx_fini ( struct m0_be_tx tx)

Definition at line 163 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_fol_add()

M0_INTERNAL int m0_be_tx_fol_add ( struct m0_be_tx tx,
struct m0_fol_rec rec 
)

Adds fol record into the transaction payload

Definition at line 295 of file stubs.c.

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

◆ m0_be_tx_get()

M0_INTERNAL void m0_be_tx_get ( struct m0_be_tx tx)

Gets additional reference to the transaction.

Precondition
!M0_IN(m0_be_tx_state(tx), (M0_BTS_FAILED, M0_BTS_DONE))
See also
m0_be_tx_put()

Definition at line 167 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_init()

M0_INTERNAL void m0_be_tx_init ( struct m0_be_tx tx,
uint64_t  tid,
struct m0_be_domain dom,
struct m0_sm_group sm_group,
m0_be_tx_cb_t  persistent,
m0_be_tx_cb_t  discarded,
void(*)(struct m0_be_tx *tx, void *payload filler,
void *  datum 
)

Definition at line 150 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_open()

M0_INTERNAL void m0_be_tx_open ( struct m0_be_tx tx)

Definition at line 184 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_open_sync()

M0_INTERNAL int m0_be_tx_open_sync ( struct m0_be_tx tx)

Calls m0_be_tx_open() and then waits until transaction reaches M0_BTS_ACTIVE or M0_BTS_FAILED state.

Postcondition
equi(rc == 0, m0_be_tx_state(tx) == M0_BTS_ACTIVE)
equi(rc != 0, m0_be_tx_state(tx) == M0_BTS_FAILED)

Definition at line 199 of file stubs.c.

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

◆ m0_be_tx_payload_prep()

M0_INTERNAL void m0_be_tx_payload_prep ( struct m0_be_tx tx,
m0_bcount_t  size 
)

Accumulates transaction payload size.

This function adds size to the number of bytes which is allocated for the payload area.

See also
m0_be_tx::t_payload

Definition at line 180 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_prep()

M0_INTERNAL void m0_be_tx_prep ( struct m0_be_tx tx,
const struct m0_be_tx_credit credit 
)

Definition at line 175 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_put()

M0_INTERNAL void m0_be_tx_put ( struct m0_be_tx tx)

Puts reference to the transaction.

Transaction is not shifted to M0_BTS_DONE state until number of m0_be_tx_get() calls is equal to the number of m0_be_tx_put() calls for the transaction.

See also
m0_be_tx_get()

Definition at line 171 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_tx_state()

M0_INTERNAL enum m0_be_tx_state m0_be_tx_state ( const struct m0_be_tx tx)

Definition at line 210 of file stubs.c.

◆ m0_be_tx_timedwait()

M0_INTERNAL int m0_be_tx_timedwait ( struct m0_be_tx tx,
uint64_t  states,
m0_time_t  deadline 
)

Waits until transacion reaches one of the given states.

Note
To wait for a M0_BTS_PLACED state, caller must guarantee that the transaction are not in M0_BTS_DONE state, e.g., by calling m0_be_tx_get().

Definition at line 215 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_alloc()

M0_INTERNAL void m0_be_ut_alloc ( struct m0_be_ut_backend ut_be,
struct m0_be_ut_seg ut_seg,
void **  ptr,
m0_bcount_t  size 
)

Definition at line 300 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_backend_cfg_default()

void m0_be_ut_backend_cfg_default ( struct m0_be_domain_cfg cfg)

Definition at line 227 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_backend_fini()

void m0_be_ut_backend_fini ( struct m0_be_ut_backend ut_be)

Definition at line 242 of file stubs.c.

◆ m0_be_ut_backend_init()

void m0_be_ut_backend_init ( struct m0_be_ut_backend ut_be)

Definition at line 238 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_backend_init_cfg()

M0_INTERNAL int m0_be_ut_backend_init_cfg ( struct m0_be_ut_backend ut_be,
const struct m0_be_domain_cfg cfg,
bool  mkfs 
)

Definition at line 231 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_backend_sm_group_lookup()

struct m0_sm_group* m0_be_ut_backend_sm_group_lookup ( struct m0_be_ut_backend ut_be)

Definition at line 277 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_backend_thread_exit()

void m0_be_ut_backend_thread_exit ( struct m0_be_ut_backend ut_be)

Definition at line 282 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_free()

M0_INTERNAL void m0_be_ut_free ( struct m0_be_ut_backend ut_be,
struct m0_be_ut_seg ut_seg,
void *  ptr 
)

Definition at line 308 of file stubs.c.

◆ m0_be_ut_seg_allocator_fini()

void m0_be_ut_seg_allocator_fini ( struct m0_be_ut_seg ut_seg,
struct m0_be_ut_backend ut_be 
)

Definition at line 251 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_seg_allocator_init()

void m0_be_ut_seg_allocator_init ( struct m0_be_ut_seg ut_seg,
struct m0_be_ut_backend ut_be 
)

Definition at line 246 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_seg_fini()

void m0_be_ut_seg_fini ( struct m0_be_ut_seg ut_seg)

Definition at line 267 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_seg_init()

void m0_be_ut_seg_init ( struct m0_be_ut_seg ut_seg,
struct m0_be_ut_backend ut_be,
m0_bcount_t  size 
)

Definition at line 256 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_seg_reload()

void m0_be_ut_seg_reload ( struct m0_be_ut_seg ut_seg)

Definition at line 272 of file stubs.c.

Here is the caller graph for this function:

◆ m0_be_ut_tx_init()

void m0_be_ut_tx_init ( struct m0_be_tx tx,
struct m0_be_ut_backend ut_be 
)

Definition at line 286 of file stubs.c.

Here is the caller graph for this function:

Variable Documentation

◆ khdr

struct m0_be_seg_hdr khdr
static

Definition at line 41 of file stubs.c.