36 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ADDB 54 #include "addb2/storage_xc.h" 141 if (
it->s_cursor.cu_trace !=
NULL)
162 *
out = &
it->s_cursor.cu_rec;
163 }
else if (result == 0) {
170 return M0_RC(result);
202 uint64_t last_frame_end;
223 if (
header.he_offset >= last_frame_end &&
224 header.he_prev_offset < last_frame_end)
233 return M0_RC(result);
246 it->s_bshift = shift;
285 return M0_RC(result);
305 it->s_trace_ptr +=
it->s_trace.tr_nr + 1;
325 return M0_RC(result);
342 it->s_payload[
i++] =
it->s_trace_idx;
352 .va_data =
it->s_payload
376 memcmp(h, &
copy,
sizeof *h) == 0 ? 0 :
M0_ERR(-EAGAIN);
378 it->s_trace_ptr = ((
void *)
it->s_buf) +
sizeof *h;
384 return M0_RC(result);
428 char *
body = (
char *)
it->s_trace.tr_body;
456 return M0_RC(result);
466 it->s_trace.tr_nr = *
it->s_trace_ptr;
467 it->s_trace.tr_body =
it->s_trace_ptr + 1;
472 #undef M0_TRACE_SUBSYSTEM
#define M0_BUFVEC_INIT_BUF(addr_ptr, count_ptr)
M0_INTERNAL int m0_xcode_encdec(struct m0_xcode_obj *obj, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
M0_INTERNAL int m0_stob_io_bufvec_launch(struct m0_stob *stob, struct m0_bufvec *bufvec, int op_code, m0_bindex_t offset)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
static void it_free(struct m0_addb2_sit *it)
static int it_alloc(struct m0_addb2_sit *it, struct m0_stob *stob)
static struct m0t1fs_fsync_interactions copy
static m0_bindex_t header_next(const struct m0_addb2_sit *it, const struct m0_addb2_frame_header *h)
int m0_addb2_cursor_next(struct m0_addb2_cursor *cur)
void m0_addb2_cursor_fini(struct m0_addb2_cursor *cur)
static struct m0_be_emap_cursor it
M0_INTERNAL void m0_free_aligned(void *data, size_t size, unsigned shift)
static bool it_is_in(const struct m0_addb2_sit *it, m0_bindex_t index)
static int it_load(struct m0_addb2_sit *it)
static int it_read(const struct m0_addb2_sit *it, void *buf, m0_bindex_t offset, m0_bcount_t count)
static bool it_rounded(const struct m0_addb2_sit *it, m0_bindex_t index)
M0_INTERNAL uint64_t m0_round_up(uint64_t val, uint64_t size)
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
return M0_ERR(-EOPNOTSUPP)
struct m0_addb2_frame_header s_current
static void it_trace_set(struct m0_addb2_sit *it)
struct m0_addb2_source * m0_addb2_sit_source(struct m0_addb2_sit *it)
static struct m0_stob * stob
struct m0_addb2_source s_src
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
static int header_read(struct m0_addb2_sit *it, struct m0_addb2_frame_header *h, m0_bindex_t offset)
M0_INTERNAL void * m0_stob_addr_pack(const void *buf, uint32_t shift)
int m0_addb2_sit_init(struct m0_addb2_sit **out, struct m0_stob *stob, m0_bindex_t start)
void m0_addb2_consume(struct m0_addb2_source *src, const struct m0_addb2_record *rec)
static bool header_is_valid(const struct m0_addb2_sit *it, const struct m0_addb2_frame_header *h)
static m0_bindex_t offset
void m0_addb2_cursor_init(struct m0_addb2_cursor *cur, const struct m0_addb2_trace *trace)
static int it_init(struct m0_addb2_sit *it, struct m0_addb2_frame_header *h, m0_bindex_t start)
static void it_rec(struct m0_addb2_sit *it, struct m0_addb2_record **out)
int m0_addb2_sit_next(struct m0_addb2_sit *it, struct m0_addb2_record **out)
struct m0_addb2_record s_rec
#define M0_ALLOC_PTR(ptr)
struct m0_addb2_trace s_trace
static int start(struct m0_fom *fom)
static bool it_invariant(const struct m0_addb2_sit *it)
static int it_next(struct m0_addb2_sit *it, struct m0_addb2_record **out)
struct m0_addb2_cursor s_cursor
void m0_addb2_source_fini(struct m0_addb2_source *src)
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
void m0_addb2_source_init(struct m0_addb2_source *src)
M0_INTERNAL void m0_stob_get(struct m0_stob *stob)
M0_INTERNAL void m0_stob_put(struct m0_stob *stob)
M0_INTERNAL int m0_addb2_storage_header(struct m0_stob *stob, struct m0_addb2_frame_header *h)
void m0_addb2_sit_fini(struct m0_addb2_sit *it)