107 .lsc_stob_domain_init_cfg =
"directio=true",
108 .lsc_stob_domain_key = 0x1000,
109 .lsc_stob_domain_create_cfg =
NULL,
112 .lsc_stob_create_cfg =
NULL,
195 static uint64_t
seed;
209 void *
addr =
ctx->tgfc_seg_addr;
215 for (
i = 0;
i <
group->tgfg_tx_nr; ++
i) {
223 for (
i = 0;
i <
group->tgfg_reg_nr; ++
i) {
224 reg = &
group->tgfg_regs[
i];
237 .fgc_tx_nr_max =
group->tgfg_tx_nr,
238 .fgc_reg_nr_max =
group->tgfg_reg_nr,
239 .fgc_payload_size_max = payload_max,
240 .fgc_reg_size_max = ra_size_max,
243 .gfc_log = &
ctx->tgfc_log,
244 .gfc_log_discard = &
ctx->tgfc_log_discard,
245 .gfc_pd = &
ctx->tgfc_pd,
254 for (
i = 0;
i <
group->tgfg_tx_nr; ++
i) {
257 for (
i = 0;
i <
group->tgfg_reg_nr; ++
i) {
302 reserved_size *=
group->tgfg_tx_nr;
310 for (
i = 0;
i <
group->tgfg_tx_nr; ++
i) {
315 for (
i = 0;
i <
group->tgfg_reg_nr; ++
i) {
316 reg = &
group->tgfg_regs[
i];
380 for (
i = 0;
i <
nr; ++
i) {
392 for (
i = 0;
i <
nr; ++
i) {
393 reg = &
group->tgfg_regs[
i];
415 for (
i = 0;
i <
nr; ++
i) {
416 reg = &
group->tgfg_regs[
i];
451 .tgfc_group_nr = group_nr,
452 .tgfc_groups = groups,
453 .tgfc_log_discard_cfg = {
454 .ldsc_items_max = group_nr,
455 .ldsc_items_threshold = group_nr,
456 .ldsc_items_pending_max = group_nr,
463 .bpdc_seg_io_nr = group_nr,
473 for (
i = 0;
i < group_nr; ++
i)
477 for (
i = 1;
i < group_nr; ++
i) {
490 &
ctx.tgfc_pd_cfg.bpdc_io_credit);
492 &
ctx.tgfc_log_discard_cfg);
498 for (
i = 0;
i < group_nr; ++
i) {
512 &
ctx.tgfc_log_discard_cfg);
518 for (
i = 0;
i < group_nr; ++
i) {
522 for (
i = 0;
i < group_nr; ++
i) {
527 for (
i = 0;
i < group_nr; ++
i)
541 { .tgfr_size = 1024, },
542 { .tgfr_size = 1024, },
546 { .tgft_payload_size = 513, .tgft_id = 2, },
547 { .tgft_payload_size = 100, .tgft_id = 3, },
551 { .tgfr_size = 1023, },
555 { .tgft_payload_size = 500, .tgft_id = 1ULL << 62, },
559 { .tgfr_size = 100, },
560 { .tgfr_size = 1000, },
static struct m0_mutex lock
uint64_t fgc_payload_size_max
M0_INTERNAL void m0_be_group_format_prepare(struct m0_be_group_format *gft, struct m0_be_op *op)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
M0_INTERNAL void m0_be_group_format_log_read(struct m0_be_group_format *gft, struct m0_be_op *op)
M0_INTERNAL int m0_be_pd_init(struct m0_be_pd *pd, struct m0_be_pd_cfg *pd_cfg)
struct m0_be_log_discard_cfg tgfc_log_discard_cfg
M0_INTERNAL void m0_be_group_format_seg_io_credit(struct m0_be_group_format_cfg *gft_cfg, struct m0_be_io_credit *io_cred)
M0_INTERNAL void m0_be_group_format_reg_get(const struct m0_be_group_format *gft, uint32_t index, struct m0_be_reg_d *rd)
M0_INTERNAL void m0_be_seg_fini(struct m0_be_seg *seg)
M0_INTERNAL void m0_be_group_format_recovery_prepare(struct m0_be_group_format *gft, struct m0_be_log *log)
char * lsc_stob_domain_location
struct m0_mutex tgfc_lock
M0_INTERNAL bool m0_be_log_recovery_record_available(struct m0_be_log *log)
M0_INTERNAL void m0_be_group_format_reset(struct m0_be_group_format *gft)
struct m0_be_log tgfc_log
M0_INTERNAL const struct m0_fid * m0_stob_domain_id_get(const struct m0_stob_domain *dom)
M0_INTERNAL void m0_be_log_discard_flush(struct m0_be_log_discard *ld, struct m0_be_op *op)
M0_INTERNAL int m0_stob_domain_destroy(struct m0_stob_domain *dom)
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 int m0_be_seg_create(struct m0_be_seg *seg, m0_bcount_t size, void *addr)
#define M0_BE_OP_SYNC(op_obj, action)
M0_INTERNAL int m0_be_log_open(struct m0_be_log *log, struct m0_be_log_cfg *log_cfg)
M0_INTERNAL void m0_be_group_format_encode(struct m0_be_group_format *gft)
struct m0_be_pd_cfg tgfc_pd_cfg
M0_INTERNAL int m0_be_group_format_allocate(struct m0_be_group_format *gft)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
#define M0_BE_REG(seg, size, addr)
M0_INTERNAL void m0_be_group_format_discard(struct m0_be_log_discard *ld, struct m0_be_log_discard_item *ldi)
M0_INTERNAL int m0_be_log_discard_init(struct m0_be_log_discard *ld, struct m0_be_log_discard_cfg *ld_cfg)
#define M0_BE_REG_D(reg, buf)
M0_INTERNAL void m0_be_seg_close(struct m0_be_seg *seg)
struct m0_buf tgft_payload
M0_INTERNAL void m0_be_group_format_reg_seg_add(struct m0_be_group_format *gft, const struct m0_be_reg_d *rd)
#define M0_BE_TX_CREDIT(nr, size)
#define M0_BE_FMT_TX(payload, id)
struct m0_be_seg tgfc_seg
struct m0_be_log_store_cfg lc_store_cfg
M0_INTERNAL struct m0_stob * m0_ut_stob_linux_get(void)
M0_INTERNAL int m0_stob_domain_create(const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out)
M0_INTERNAL uint32_t m0_be_group_format_reg_nr(const struct m0_be_group_format *gft)
uint64_t fgc_reg_size_max
M0_INTERNAL void m0_be_log_close(struct m0_be_log *log)
#define M0_BE_OP_SYNC_RET(op_obj, action, member)
M0_INTERNAL void m0_be_group_format_seg_place(struct m0_be_group_format *gft, struct m0_be_op *op)
M0_INTERNAL void m0_be_group_format_log_write(struct m0_be_group_format *gft, struct m0_be_op *op)
M0_INTERNAL void m0_be_group_format_tx_add(struct m0_be_group_format *gft, struct m0_be_fmt_tx *ftx)
struct m0_stob * tgfc_seg_stob
M0_INTERNAL void m0_stob_id_make(uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
M0_INTERNAL void m0_be_group_format_log_use(struct m0_be_group_format *gft, m0_bcount_t size_reserved)
M0_INTERNAL int m0_buf_alloc(struct m0_buf *buf, size_t size)
void * m0_alloc(size_t size)
M0_INTERNAL void m0_be_group_format_reg_log_add(struct m0_be_group_format *gft, const struct m0_be_reg_d *rd)
M0_INTERNAL int m0_be_log_create(struct m0_be_log *log, struct m0_be_log_cfg *log_cfg)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
struct be_ut_tgf_group * tgfc_groups
M0_INTERNAL void m0_be_op_done(struct m0_be_op *op)
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
M0_INTERNAL int m0_be_group_format_init(struct m0_be_group_format *gft, struct m0_be_group_format_cfg *gft_cfg, struct m0_be_tx_group *group, struct m0_be_log *log)
struct m0_buf bft_payload
M0_INTERNAL void m0_ut_stob_put(struct m0_stob *stob, bool destroy)
M0_INTERNAL void m0_be_log_discard_fini(struct m0_be_log_discard *ld)
M0_INTERNAL int m0_be_log_reserve(struct m0_be_log *log, m0_bcount_t size)
struct m0_be_group_format tgfg_gft
M0_INTERNAL void m0_be_group_format_deallocate(struct m0_be_group_format *gft)
M0_INTERNAL void m0_be_group_format_seg_place_prepare(struct m0_be_group_format *gft)
M0_INTERNAL void m0_be_group_format_fini(struct m0_be_group_format *gft)
struct be_ut_tgf_tx * tgfg_txs
struct m0_be_log_discard tgfc_log_discard
M0_INTERNAL void m0_be_op_active(struct m0_be_op *op)
M0_INTERNAL uint64_t m0_rnd64(uint64_t *seed)
M0_INTERNAL void m0_be_pd_fini(struct m0_be_pd *pd)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
M0_INTERNAL uint32_t m0_be_group_format_tx_nr(const struct m0_be_group_format *gft)
M0_INTERNAL void m0_be_log_destroy(struct m0_be_log *log)
m0_bcount_t tgft_payload_size
M0_INTERNAL int m0_be_seg_destroy(struct m0_be_seg *seg)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL m0_bcount_t m0_be_group_format_log_reserved_size(struct m0_be_log *log, struct m0_be_tx_credit *cred, m0_bcount_t cred_payload)
M0_INTERNAL int m0_be_seg_open(struct m0_be_seg *seg)
static struct m0_be_seg * seg
M0_INTERNAL int m0_be_group_format_decode(struct m0_be_group_format *gft)
struct be_ut_tgf_reg * tgfg_regs
M0_INTERNAL void m0_be_log_record_skip_discard(struct m0_be_log_record *record)
M0_INTERNAL struct m0_be_fmt_group_info * m0_be_group_format_group_info(struct m0_be_group_format *gft)
M0_INTERNAL void m0_be_group_format_tx_get(const struct m0_be_group_format *gft, uint32_t index, struct m0_be_fmt_tx *ftx)
struct m0_be_group_format_cfg tgfg_cfg
struct m0_stob_id lsc_stob_id
struct m0_stob_domain * tgfc_sdom
static struct m0_stob_domain * sdom