Motr  M0
storage.c File Reference
#include "lib/misc.h"
#include "lib/vec.h"
#include "lib/chan.h"
#include "lib/trace.h"
#include "lib/assert.h"
#include "lib/memory.h"
#include "lib/errno.h"
#include "lib/tlist.h"
#include "lib/mutex.h"
#include "xcode/xcode.h"
#include "stob/stob.h"
#include "stob/domain.h"
#include "stob/io.h"
#include "addb2/addb2.h"
#include "addb2/storage.h"
#include "addb2/internal.h"
#include "addb2/addb2_xc.h"
#include "addb2/storage_xc.h"
Include dependency graph for storage.c:

Go to the source code of this file.

Data Structures

struct  frame
 
struct  m0_addb2_storage
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_ADDB
 
#define PLACE(cur, obj, count)
 

Enumerations

enum  { MAX_INFLIGHT = 8, IO_FRAG = 2 }
 
enum  { M0_ADDB2_STOB_KEY = 2 }
 

Functions

 M0_TL_DESCR_DEFINE (frame, "addb2 frames", static, struct frame, f_linkage, f_magix, M0_ADDB2_FRAME_MAGIC, M0_ADDB2_FRAME_HEAD_MAGIC)
 
 M0_TL_DEFINE (frame, static, struct frame)
 
static bool trace_tryadd (struct m0_addb2_storage *stor, struct m0_addb2_trace *trace)
 
static bool trace_fits (const struct frame *frame, const struct m0_addb2_trace *trace)
 
static void trace_add (struct frame *frame, struct m0_addb2_trace *trace)
 
static int frame_init (struct frame *frame, struct m0_addb2_storage *stor)
 
static void frame_fini (struct frame *frame)
 
static void frame_clear (struct frame *frame)
 
static void frame_submit (struct frame *frame)
 
static void frame_idle (struct frame *frame)
 
static void frame_done (struct frame *frame)
 
static int frame_try (struct frame *frame)
 
static void frame_io_pack (struct frame *frame)
 
static void frame_io_open (struct frame *frame)
 
static bool frame_invariant (const struct frame *frame)
 
static bool frame_endio (struct m0_clink *link)
 
static struct frameframe_cur (const struct m0_addb2_storage *stor)
 
static bool stor_invariant (const struct m0_addb2_storage *stor)
 
static void stor_fini (struct m0_addb2_storage *stor)
 
static void stor_balance (struct m0_addb2_storage *stor, int delta)
 
static void stor_drain (struct m0_addb2_storage *stor)
 
static void stor_update (struct m0_addb2_storage *stor, const struct m0_addb2_frame_header *header)
 
static m0_bindex_t stor_round (const struct m0_addb2_storage *stor, m0_bindex_t index)
 
static bool stor_rounded (const struct m0_addb2_storage *stor, m0_bindex_t index)
 
static int stor_dom_init (struct m0_addb2_storage *stor, const char *location, uint64_t key, bool mkfs, bool force)
 
static void stor_dom_fini (struct m0_addb2_storage *stor)
 
static int stor_stob_init (struct m0_addb2_storage *stor, uint64_t key)
 
static void stor_stob_fini (struct m0_addb2_storage *stor)
 
M0_INTERNAL struct m0_addb2_storagem0_addb2_storage_init (const char *location, uint64_t key, bool mkfs, bool force, const struct m0_addb2_storage_ops *ops, m0_bcount_t size, void *cookie)
 
M0_INTERNAL void m0_addb2_storage_fini (struct m0_addb2_storage *stor)
 
M0_INTERNAL void * m0_addb2_storage_cookie (const struct m0_addb2_storage *stor)
 
M0_INTERNAL void m0_addb2_storage_stop (struct m0_addb2_storage *stor)
 
M0_INTERNAL int m0_addb2_storage_submit (struct m0_addb2_storage *stor, struct m0_addb2_trace_obj *obj)
 
M0_INTERNAL bool m0_addb2_storage__is_not_locked (const struct m0_addb2_storage *stor)
 

Variables

static const struct m0_format_tag frame_tag
 
M0_INTERNAL const uint64_t m0_addb2_stob_key = M0_ADDB2_STOB_KEY
 

Macro Definition Documentation

◆ PLACE

#define PLACE (   cur,
  obj,
  count 
)
Value:
do { \
M0_PRE(M0_IS_8ALIGNED(cur)); \
size_t __nob = (count) * sizeof *(obj); \
memcpy((cur), (obj), __nob); \
(cur) += __nob; \
M0_POST(M0_IS_8ALIGNED(cur)); \
} while (0)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
Definition: addb2.c:791
static struct foo * obj
Definition: tlist.c:302
static m0_bcount_t count
Definition: xcode.c:167
#define M0_IS_8ALIGNED(val)
Definition: arith.h:190