26 #ifndef __MOTR_BE_LOG_H__ 27 #define __MOTR_BE_LOG_H__ 318 #define BL_F "(lg_current=%" PRIu64 " lg_discarded=%" PRIu64 \ 319 " lg_free=%" PRIu64 ")" 320 #define BL_P(log) (log)->lg_current, (log)->lg_discarded, (log)->lg_free 378 #define BLR_F "(lgr_last_discarded=%" PRIu64 " lgr_position=%" PRIu64 " " \ 379 "lgr_size=%" PRIu64 " " \ 380 "lgr_prev_pos=%" PRIu64 " lgr_prev_size=%" PRIu64 ")" 381 #define BLR_P(record) (record)->lgr_last_discarded, (record)->lgr_position, \ 382 (record)->lgr_size, \ 383 (record)->lgr_prev_pos, (record)->lgr_prev_size
M0_INTERNAL void m0_be_log_record_io_size_set(struct m0_be_log_record *record, int index, m0_bcount_t size)
m0_bcount_t lg_prev_record_size
M0_INTERNAL struct m0_bufvec * m0_be_log_record_io_bufvec(struct m0_be_log_record *record, int index)
void(* m0_be_log_record_cb_t)(struct m0_be_log_record *record)
struct m0_be_fmt_log_record_header lri_header
struct m0_be_op lg_header_read_op
M0_INTERNAL int m0_be_log_record_iter_init(struct m0_be_log_record_iter *iter)
M0_INTERNAL bool m0_be_log_recovery_record_available(struct m0_be_log *log)
struct m0_be_recovery_cfg lc_recovery_cfg
M0_INTERNAL int m0_be_log_record_allocate(struct m0_be_log_record *record)
M0_INTERNAL int m0_be_log_record_initial(struct m0_be_log *log, struct m0_be_log_record_iter *curr)
M0_INTERNAL void m0_be_log_record_io_launch(struct m0_be_log_record *record, struct m0_be_op *op)
struct m0_be_log_store lg_store
struct m0_be_log_sched_cfg lc_sched_cfg
M0_INTERNAL int m0_be_log_open(struct m0_be_log *log, struct m0_be_log_cfg *log_cfg)
M0_INTERNAL bool m0_be_fmt_log_record_header__invariant(struct m0_be_fmt_log_record_header *header, struct m0_be_log *log)
M0_INTERNAL m0_bindex_t m0_be_log_recovery_discarded(struct m0_be_log *log)
M0_INTERNAL m0_bcount_t m0_be_log_reserved_size(struct m0_be_log *log, m0_bcount_t *lio_size, int lio_nr)
struct m0_be_log_io * lgr_io[M0_BE_LOG_RECORD_IO_NR_MAX]
M0_INTERNAL void m0_be_log_record_io_prepare(struct m0_be_log_record *record, enum m0_stob_io_opcode opcode, m0_bcount_t size_reserved)
M0_INTERNAL int m0_be_log_record_prev(struct m0_be_log *log, const struct m0_be_log_record_iter *curr, struct m0_be_log_record_iter *prev)
m0_bindex_t lri_log_header_discarded
struct m0_be_fmt_log_record_footer lgr_footer
struct m0_tlink lgr_sched_linkage
m0_bindex_t lgr_log_header_discarded
struct m0_module lg_module
M0_INTERNAL m0_bindex_t m0_be_log_record_discarded(const struct m0_be_log_record *record)
M0_INTERNAL int m0_be_log_record_io_create(struct m0_be_log_record *record, m0_bcount_t size_max)
M0_INTERNAL void m0_be_log_module_setup(struct m0_be_log *log, struct m0_be_log_cfg *lg_cfg, bool create_mode)
M0_INTERNAL bool m0_be_log_header__repair(struct m0_be_fmt_log_header **hdrs, int nr, struct m0_be_fmt_log_header *out)
struct m0_be_op * lgr_user_op
struct m0_be_recovery lg_recovery
M0_INTERNAL int m0_be_log_record_next(struct m0_be_log *log, const struct m0_be_log_record_iter *curr, struct m0_be_log_record_iter *next)
struct m0_be_log_store_cfg lc_store_cfg
M0_INTERNAL void m0_be_log_record_assign(struct m0_be_log_record *record, struct m0_be_log_record_iter *iter, bool need_discard)
struct m0_mutex * lc_lock
m0_bindex_t lg_prev_record
M0_INTERNAL void m0_be_log_close(struct m0_be_log *log)
struct m0_be_log * lgr_log
M0_INTERNAL bool m0_be_log__invariant(struct m0_be_log *log)
void(* m0_be_log_got_space_cb_t)(struct m0_be_log *log)
struct m0_be_fmt_log_record_header lgr_header
m0_be_log_got_space_cb_t lg_got_space_cb
M0_INTERNAL void m0_be_log_record_fini(struct m0_be_log_record *record)
m0_be_log_got_space_cb_t lc_got_space_cb
struct m0_mutex lg_record_state_lock
M0_INTERNAL int m0_be_log_create(struct m0_be_log *log, struct m0_be_log_cfg *log_cfg)
m0_bcount_t lgr_prev_size
M0_INTERNAL void m0_be_log_header__set(struct m0_be_fmt_log_header *hdr, m0_bindex_t discarded, m0_bindex_t lsn, m0_bcount_t size)
M0_INTERNAL void m0_be_log_record_discard(struct m0_be_log *log, m0_bcount_t size)
M0_INTERNAL void m0_be_log_record_reset(struct m0_be_log_record *record)
struct m0_mutex * lg_external_lock
struct m0_be_op lgr_record_op
M0_INTERNAL int m0_be_log_reserve(struct m0_be_log *log, m0_bcount_t size)
M0_INTERNAL void m0_be_log_recovery_record_get(struct m0_be_log *log, struct m0_be_log_record_iter *iter)
struct m0_be_op lg_header_write_op
struct m0_be_log_cfg lg_cfg
M0_INTERNAL m0_bindex_t m0_be_log_record_position(const struct m0_be_log_record *record)
M0_INTERNAL bool m0_be_log_header__is_eq(struct m0_be_fmt_log_header *hdr1, struct m0_be_fmt_log_header *hdr2)
M0_INTERNAL void m0_be_log_destroy(struct m0_be_log *log)
M0_INTERNAL void m0_be_log_record_iter_copy(struct m0_be_log_record_iter *dest, struct m0_be_log_record_iter *src)
m0_bcount_t lg_unplaced_size
M0_INTERNAL int m0_be_log_header_read(struct m0_be_log *log, struct m0_be_fmt_log_header *log_hdr)
m0_be_log_full_cb_t lc_full_cb
struct m0_be_op * lgr_op[M0_BE_LOG_RECORD_IO_NR_MAX]
m0_bindex_t lgr_last_discarded
M0_INTERNAL void m0_be_log_record_iter_fini(struct m0_be_log_record_iter *iter)
struct m0_tlink lgr_linkage
void(* m0_be_log_full_cb_t)(struct m0_be_log *log)
struct m0_tlink lri_linkage
m0_bcount_t lc_full_threshold
M0_INTERNAL void m0_be_log_record_deallocate(struct m0_be_log_record *record)
struct m0_be_log_sched lg_sched
M0_INTERNAL bool m0_be_log_contains_stob(struct m0_be_log *log, const struct m0_stob_id *stob_id)
M0_INTERNAL void m0_be_log_record_skip_discard(struct m0_be_log_record *record)
m0_bindex_t lg_unplaced_pos
M0_INTERNAL void m0_be_log_record_init(struct m0_be_log_record *record, struct m0_be_log *log)
struct m0_pdclust_src_addr src
M0_INTERNAL uint32_t m0_be_log_bshift(struct m0_be_log *log)
M0_INTERNAL void m0_be_log_record_ext(struct m0_be_log_record *record, struct m0_ext *ext)
struct m0_be_fmt_log_header lg_header
M0_INTERNAL void m0_be_log_unreserve(struct m0_be_log *log, m0_bcount_t size)