23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_BE 105 "si_user=(count=%"PRIu32" size=%llu) " 106 "si_stob=(count=%"PRIu32" size=%llu)",
143 uint32_t
nr = u_vec->
v_nr;
144 void *ptr_user_packed;
156 u_buf [
nr - 1] + u_vec->
v_count[
nr - 1] == ptr_user_packed &&
157 s_offs[
nr - 1] + s_vec->
v_count[
nr - 1] == offset_stob_packed) {
163 u_buf[
nr] = ptr_user_packed;
165 s_offs[
nr] = offset_stob_packed;
235 uint32_t nr_total = 0;
262 _0C(nr_total <= bio->bio_used.bic_reg_nr) &&
263 _0C(count_total <= bio->bio_used.bic_reg_size);
340 index_ptr = &iv[
index];
348 ov_count[
i] = ov_count[
i - 1];
349 iv_count[
i] = iv_count[
i - 1];
383 if (&iv[
i] == iv_ptr)
432 M0_PRE(win_start < win_end && offset >= win_start &&
451 end = iv[
i] + iv_count[
i];
455 iv_count[
i] -= end - win_end;
456 ov_count[
i] = iv_count[
i];
457 iv_count[
i + 1] = end - win_end;
458 ov_count[
i + 1] = iv_count[
i + 1];
459 iv[
i + 1] = win_start;
460 ov[
i + 1] = (
char*)ov[
i] + ov_count[
i];
464 offset = end >= win_end ? end - win_end + win_start : end;
491 for (
i = 0;
i <
nr; ++
i) {
532 uint64_t finished_nr;
548 "failed I/O part number: %u, rc = %d",
571 "bio = %p, sio = %p, sio->si_rc = %d",
572 bio, sio, sio->
si_rc);
604 M0_ENTRY(
"bio=%p op=%p sync=%d opcode=%d " 605 "m0_be_io_size(bio)=%"PRIu64,
643 return io->bio_opcode;
718 #define EXT(start, end) (struct m0_ext){ .e_start = (start), .e_end = (end) } static bool be_io_part_add(struct m0_be_io_part *bip, void *ptr_user, m0_bindex_t offset_stob, m0_bcount_t size)
struct m0_be_io * bip_bio
struct m0_be_io_part * bio_part
struct m0_stob_io bip_sio
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL m0_bcount_t m0_be_io_size(struct m0_be_io *bio)
M0_INTERNAL void m0_be_io_vec_pack(struct m0_be_io *bio)
struct m0_clink bip_clink
M0_INTERNAL void m0_stob_io_fini(struct m0_stob_io *io)
M0_INTERNAL void m0_be_io_sync_enable(struct m0_be_io *bio)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static bool be_io_part_intersect(const struct m0_be_io_part *bip1, const struct m0_be_io_part *bip2)
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
static void be_io_vec_cut(struct m0_be_io *bio, struct m0_be_io_part *bip)
static struct m0_sm_group * grp
#define M0_LOG(level,...)
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
struct m0_be_io_credit bio_used
M0_INTERNAL const struct m0_fid * m0_stob_fid_get(struct m0_stob *stob)
#define container_of(ptr, type, member)
#define BE_IOCRED_P(iocred)
M0_INTERNAL void m0_be_op_rc_set(struct m0_be_op *op, int rc)
static m0_bcount_t be_io_size_pack(m0_bcount_t size, uint32_t bshift)
static void be_io_part_reset(struct m0_be_io_part *bip)
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
static struct m0_sm_ast ast[NR]
M0_INTERNAL void m0_be_io_configure(struct m0_be_io *bio, enum m0_stob_io_opcode opcode)
M0_INTERNAL void m0_be_io_err_send(uint32_t errcode, uint8_t location, uint8_t io_opcode)
M0_INTERNAL void m0_be_io_add_nostob(struct m0_be_io *bio, void *ptr_user, m0_bindex_t offset_stob, m0_bcount_t size)
M0_INTERNAL void m0_be_io_fini(struct m0_be_io *bio)
#define M0_ERR_INFO(rc, fmt,...)
M0_INTERNAL void * m0_be_io_user_data(struct m0_be_io *bio)
struct m0_atomic64 bio_stob_io_finished_nr
static void be_io_finished(struct m0_be_io *bio)
M0_INTERNAL int m0_stob_io_prepare_and_launch(struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
struct m0_indexvec si_stob
static struct m0_stob * stob
M0_INTERNAL int m0_be_io_single(struct m0_stob *stob, enum m0_stob_io_opcode opcode, void *ptr_user, m0_bindex_t offset_stob, m0_bcount_t size)
M0_INTERNAL void m0_be_io_credit_add(struct m0_be_io_credit *iocred0, const struct m0_be_io_credit *iocred1)
static void be_io_empty_ast(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static m0_bindex_t be_io_stob_offset_pack(m0_bindex_t offset, uint32_t bshift)
M0_INTERNAL void m0_be_io_stob_move(struct m0_be_io *bio, struct m0_stob *stob, m0_bindex_t offset, m0_bindex_t win_start, m0_bcount_t win_size)
static void be_io_part_init(struct m0_be_io_part *bip, struct m0_be_io *bio)
struct m0_bufvec bio_bv_user
M0_INTERNAL bool m0_be_io_offset_stob_is_eq(const struct m0_be_io *bio1, const struct m0_be_io *bio2)
M0_INTERNAL void * m0_stob_addr_pack(const void *buf, uint32_t shift)
M0_INTERNAL int m0_be_io_init(struct m0_be_io *bio)
M0_INTERNAL bool m0_be_io_credit_le(const struct m0_be_io_credit *iocred0, const struct m0_be_io_credit *iocred1)
static void be_io_free(struct m0_be_io *bio)
M0_INTERNAL bool m0_be_io_sync_is_enabled(struct m0_be_io *bio)
M0_INTERNAL bool m0_be_io_intersect(const struct m0_be_io *bio1, const struct m0_be_io *bio2)
M0_INTERNAL void m0_be_op_done(struct m0_be_op *op)
static m0_bindex_t offset
static bool be_io_part_invariant(struct m0_be_io_part *bip)
struct m0_stob * bip_stob
#define M0_BE_IO_CREDIT(reg_nr, reg_size, part_nr)
static struct m0_stob_io io
enum m0_stob_io_opcode bio_opcode
M0_INTERNAL void m0_be_io_user_data_set(struct m0_be_io *bio, void *data)
M0_INTERNAL m0_bcount_t m0_vec_count(const struct m0_vec *vec)
#define M0_BE_OP_SYNC_RC(op_obj, action)
M0_INTERNAL bool m0_be_io_is_empty(struct m0_be_io *bio)
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
M0_INTERNAL void m0_be_op_active(struct m0_be_op *op)
M0_INTERNAL bool m0_be_io_ptr_user_is_eq(const struct m0_be_io *bio1, const struct m0_be_io *bio2)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
M0_INTERNAL int m0_be_io_allocate(struct m0_be_io *bio, struct m0_be_io_credit *iocred)
M0_INTERNAL void * m0_stob_addr_open(const void *buf, uint32_t shift)
M0_INTERNAL int m0_stob_fd(struct m0_stob *stob)
M0_INTERNAL void m0_stob_iovec_sort(struct m0_stob_io *stob)
M0_INTERNAL void m0_be_io_deallocate(struct m0_be_io *bio)
M0_INTERNAL enum m0_stob_io_opcode m0_be_io_opcode(struct m0_be_io *io)
static m0_bcount_t be_io_size_unpack(m0_bcount_t size, uint32_t bshift)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
M0_INTERNAL bool m0_be_io__invariant(struct m0_be_io *bio)
M0_INTERNAL bool m0_ext_are_overlapping(const struct m0_ext *e0, const struct m0_ext *e1)
static void be_io_vec_fork(struct m0_be_io *bio, unsigned index)
struct m0_indexvec bio_iv_stob
struct m0t1fs_filedata * fd
M0_INTERNAL void m0_stob_io_init(struct m0_stob_io *io)
#define M0_ASSERT_INFO(cond, fmt,...)
static int be_io_part_launch(struct m0_be_io_part *bip)
struct m0_be_io_credit bio_iocred
static unsigned be_io_vec_index_by_ptr(struct m0_be_io *bio, m0_bindex_t *iv_ptr)
M0_INTERNAL void m0_be_io_add(struct m0_be_io *bio, struct m0_stob *stob, void *ptr_user, m0_bindex_t offset_stob, m0_bcount_t size)
M0_INTERNAL void m0_be_io_stob_assign(struct m0_be_io *bio, struct m0_stob *stob, m0_bindex_t offset, m0_bcount_t size)
M0_INTERNAL void m0_be_io_launch(struct m0_be_io *bio, struct m0_be_op *op)
M0_INTERNAL void m0_be_io_reset(struct m0_be_io *bio)
static int64_t m0_atomic64_add_return(struct m0_atomic64 *a, int64_t d)
static void be_io_part_fini(struct m0_be_io_part *bip)
M0_INTERNAL void m0_be_io_sort(struct m0_be_io *bio)
static void m0_atomic64_set(struct m0_atomic64 *a, int64_t num)
static bool be_io_cb(struct m0_clink *link)
enum m0_stob_io_opcode si_opcode