26 #include "fol/fol_xc.h" 31 #include "fid/fid_xc.h" 175 static m0_lsn_t
last;
179 rc = m0_db_tx_commit(&tx);
182 rc = m0_db_tx_init(&tx, &db, 0);
188 d->rd_lsn = m0_fol_lsn_allocate(&fol);
196 static void ub_lookup(
int i)
203 rc = m0_fol_rec_lookup(&fol, &tx, lsn, &rec);
205 m0_fol_lookup_rec_fini(&rec);
210 static void ub_insert_buf(
int i)
212 d->rd_lsn = m0_fol_lsn_allocate(&fol);
213 rc = m0_fol_add_buf(&fol, &tx, d, &
buf);
226 { .ub_name =
"insert",
230 { .ub_name =
"lookup",
232 .ub_round = ub_lookup },
234 { .ub_name =
"insert-buf",
236 .ub_round = ub_insert_buf },
M0_INTERNAL void m0_fol_fini(struct m0_fol *fol)
M0_INTERNAL void m0_ut_backend_fini(struct m0_be_ut_backend *be, struct m0_be_ut_seg *seg)
int(* rpo_undo)(struct m0_fol_frag *frag, struct m0_be_tx *tx)
static struct m0_be_tx g_tx
static struct m0_be_ut_backend g_ut_be
M0_INTERNAL void m0_fol_rec_fini(struct m0_fol_rec *rec)
static void test_fol_frag_type_reg(void)
const struct m0_fol_frag_ops * rp_ops
M0_INTERNAL int m0_fol_frag_type_register(struct m0_fol_frag_type *type)
M0_INTERNAL void m0_fol_frag_init(struct m0_fol_frag *frag, void *data, const struct m0_fol_frag_type *type)
static void checkpoint(void)
M0_INTERNAL void m0_ut_be_tx_end(struct m0_be_tx *tx)
M0_INTERNAL void m0_ut_be_tx_begin2(struct m0_be_tx *tx, struct m0_be_ut_backend *ut_be, struct m0_be_tx_credit *cred, m0_bcount_t payload_cred)
static void test_fini(void)
static struct m0_fol_rec g_rec
static void ub_fini(void)
#define M0_BE_TX_CREDIT(nr, size)
static void test_fol_frag_encdec(void)
M0_INTERNAL void m0_fol_rec_init(struct m0_fol_rec *rec, struct m0_fol *fol)
static void test_init(void)
M0_INTERNAL void m0_fol_init(struct m0_fol *fol)
static int verify_frag_data(struct m0_fol_frag *frag, struct m0_be_tx *tx)
static struct m0_fol g_fol
static struct m0_be_ut_seg g_ut_seg
struct m0_ut_suite fol_ut
static void ub_insert(int i)
M0_FOL_FRAG_TYPE_DECLARE(ut_frag, static, verify_frag_data, NULL, NULL, NULL)
static int ub_init(const char *opts M0_UNUSED)
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL void m0_fol_frag_add(struct m0_fol_rec *rec, struct m0_fol_frag *frag)
#define M0_FOL_FRAG_TYPE_XC_OPS(name, frag_xc, frag_type_ops)
M0_INTERNAL void m0_fol_frag_type_deregister(struct m0_fol_frag_type *type)
struct m0_ub_set m0_fol_ub
#define m0_tl_for(name, head, obj)
M0_INTERNAL void m0_ut_backend_init(struct m0_be_ut_backend *be, struct m0_be_ut_seg *seg)
static struct m0_addb2_frame_header last
M0_INTERNAL int m0_fol_rec_encode(struct m0_fol_rec *rec, struct m0_buf *at)
static void test_fol_frag_type_unreg(void)
M0_INTERNAL int m0_fol_rec_decode(struct m0_fol_rec *rec, struct m0_buf *at)