23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_COB 78 uint64_t bytecount,
struct m0_be_tx *tx);
93 .sd_name =
"COB OP EXECUTE",
100 .
scf_name =
"COB create/delete/getattr",
275 return m0_rnd(1 << 30, &hash) >> 1;
378 r_common = &
reply->cgr_common;
437 r_common = &
reply->csr_common;
549 &cob_op_tx_credit)) {
597 r_common = &
reply->cor_common;
601 M0_ENTRY(
"fom %p, fop %p, item %p[%u], phase %s, "FID_F" stob %p",
623 "stob %p, Finished waiting for " 624 "ref to drop to 1",
fom,
851 uint32_t nskey_name_len;
855 nskey_name_len = sprintf(nskey_name,
"%u", cob_idx);
952 uint32_t valid =
attr->ca_valid;
1124 uint64_t byte_count;
1174 uint32_t idx =
cc->fco_range_idx;
1181 cc->fco_want.iv_index[0] =
cc->fco_range.iv_index[idx];
1182 cc->fco_want.iv_vec.v_count[0] =
cc->fco_range.iv_vec.v_count[idx];
1188 cc->fco_range.iv_index[idx] +=
cc->fco_got.iv_vec.v_count[0];
1189 cc->fco_range.iv_vec.v_count[idx] -=
1190 cc->fco_got.iv_vec.v_count[0];
1191 if (
cc->fco_range.iv_vec.v_count[idx] == 0) {
1192 cc->fco_range_idx++;
1193 if (
cc->fco_range_idx ==
cc->fco_range.iv_vec.v_nr)
1194 cc->fco_is_done =
true;
1247 uint64_t bytecount,
struct m0_be_tx *tx)
1277 #undef M0_TRACE_SUBSYSTEM
struct m0_cob_nsrec co_nsrec
struct m0_fop_type m0_fop_cob_op_reply_fopt
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
uint32_t m0_fop_opcode(const struct m0_fop *fop)
M0_INTERNAL int m0_cc_cob_setup(struct m0_fom_cob_op *cc, struct m0_cob_domain *cdom, const struct m0_cob_attr *attr, struct m0_be_tx *ctx)
static int cob_locate(const struct m0_fom *fom, struct m0_cob **cob)
struct m0_fop_type m0_fop_cob_setattr_reply_fopt
M0_INTERNAL struct m0_fop_cob_common * m0_cobfop_common_get(struct m0_fop *fop)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
static int cob_stob_create(struct m0_fom *fom, struct m0_cob_attr *attr)
M0_INTERNAL uint64_t m0_fid_hash(const struct m0_fid *fid)
static const struct m0_fom_ops cd_fom_ops
M0_INTERNAL int m0_storage_dev_stob_find(struct m0_storage_devs *devs, struct m0_stob_id *sid, struct m0_stob **stob)
M0_INTERNAL void m0_storage_dev_stob_put(struct m0_storage_devs *devs, struct m0_stob *stob)
M0_INTERNAL bool m0_chan_has_waiters(struct m0_chan *chan)
static struct m0_cob_domain * cdom_get(const struct m0_fom *fom)
#define M0_LOG(level,...)
static struct m0_be_tx_credit * m0_fom_tx_credit(struct m0_fom *fom)
static void cob_op_credit(struct m0_fom *fom, enum m0_cob_op opcode, struct m0_be_tx_credit *accum)
static int cob_stob_ref_drop_wait(struct m0_fom *fom)
static bool cob_pool_version_mismatch(const struct m0_fom *fom)
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
enum m0_cob_type fco_cob_type
static int cc_cob_create(struct m0_fom *fom, struct m0_fom_cob_op *cc, const struct m0_cob_attr *attr)
M0_INTERNAL bool m0_is_cob_truncate_fop(const struct m0_fop *fop)
struct m0_fop_cob_common cs_common
M0_INTERNAL void m0_cob_put(struct m0_cob *cob)
static void cob_tick_tail(struct m0_fom *fom, struct m0_fop_cob_op_rep_common *r_common)
void * m0_fop_data(const struct m0_fop *fop)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
struct m0_reqh_service rios_gen
static int cob_attr_op(struct m0_fom *fom, struct m0_fom_cob_op *gop, struct m0_cob_attr *attr, enum cob_attr_operation op)
M0_INTERNAL void m0_md_cob_wire2mem(struct m0_cob_attr *attr, const struct m0_fop_cob *body)
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
M0_INTERNAL void m0_chan_lock(struct m0_chan *ch)
#define container_of(ptr, type, member)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
static void addb2_add_cob_fom_attrs(const struct m0_fom_cob_op *cfom)
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
static struct m0_be_tx * m0_fom_tx(struct m0_fom *fom)
struct m0_indexvec fco_range
struct m0_fom_type ft_fom_type
struct m0_stob * fco_stob
const struct m0_fom_type * fo_type
M0_INTERNAL int m0_cob_nskey_make(struct m0_cob_nskey **keyh, const struct m0_fid *pfid, const char *name, size_t namelen)
static const struct m0_fom_ops cob_getattr_fom_ops
M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
static int cc_md_cob_nskey_make(struct m0_cob_nskey **nskey, const struct m0_fid *gfid)
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
struct m0_cob_nskey * co_nskey
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
static int cob_setattr_fom_tick(struct m0_fom *fom)
struct m0_fop_type * f_type
M0_INTERNAL bool m0_is_cob_setattr_fop(const struct m0_fop *fop)
struct m0_fop_type m0_fop_cob_getattr_reply_fopt
const struct m0_fom_type_ops cob_fom_type_ops
#define M0_ERR_INFO(rc, fmt,...)
M0_INTERNAL int m0_cob_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL const char * m0_fop_name(const struct m0_fop *fop)
M0_INTERNAL int m0_cob_bc_update(struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_val, struct m0_be_tx *tx)
static int cob_getattr(struct m0_fom *fom, struct m0_fom_cob_op *gop, struct m0_cob_attr *attr)
static int ce_stob_edit_credit(struct m0_fom *fom, struct m0_fom_cob_op *cc, struct m0_be_tx_credit *accum, uint32_t cot)
M0_INTERNAL uint64_t m0_rnd(uint64_t max, uint64_t *seed)
struct m0_cob_domain * rios_cdom
static int cob_bytecount_decrement(struct m0_cob *cob, struct m0_cob_bckey *key, uint64_t bytecount, struct m0_be_tx *tx)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
int m0_fom_tick_generic(struct m0_fom *fom)
static int cob_getattr_fom_tick(struct m0_fom *fom)
void m0_fom_fini(struct m0_fom *fom)
static struct m0_stob * stob
static void cob_stob_create_credit(struct m0_fom *fom)
static int cob_ops_stob_find(struct m0_fom_cob_op *co)
static struct m0_cob * cob
M0_INTERNAL void m0_stob_destroy_credit(struct m0_stob *stob, struct m0_be_tx_credit *accum)
M0_INTERNAL int m0_storage_dev_stob_destroy(struct m0_storage_devs *devs, struct m0_stob *stob, struct m0_dtx *dtx)
M0_INTERNAL void m0_cob_nsrec_init(struct m0_cob_nsrec *nsrec)
M0_INTERNAL void m0_md_cob_mem2wire(struct m0_fop_cob *body, const struct m0_cob_attr *attr)
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
M0_INTERNAL void m0_cob_oikey_make(struct m0_cob_oikey *oikey, const struct m0_fid *fid, int linkno)
M0_INTERNAL void m0_be_tx_credit_add(struct m0_be_tx_credit *c0, const struct m0_be_tx_credit *c1)
M0_INTERNAL void m0_fid_convert_cob2stob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
M0_INTERNAL int m0_indexvec_wire2mem(struct m0_io_indexvec *wire_ivec, int max_frags_nr, uint32_t bshift, struct m0_indexvec *mem_ivec)
M0_INTERNAL int m0_cob_create(struct m0_cob *cob, struct m0_cob_nskey *nskey, struct m0_cob_nsrec *nsrec, struct m0_cob_fabrec *fabrec, struct m0_cob_omgrec *omgrec, struct m0_be_tx *tx)
static const struct m0_fom_ops cob_setattr_fom_ops
M0_INTERNAL void m0_fom_mod_rep_fill(struct m0_fop_mod_rep *rep, struct m0_fom *fom)
const struct m0_sm_conf cob_ops_conf
static int ce_stob_edit(struct m0_fom *fom, struct m0_fom_cob_op *cd, uint32_t cot)
static void cd_fom_fini(struct m0_fom *fom)
static void cc_fom_fini(struct m0_fom *fom)
struct m0_chan so_ref_chan
static int cob_ops_fom_tick(struct m0_fom *fom)
M0_INTERNAL int m0_fom_tx_done_wait(struct m0_fom *fom)
M0_INTERNAL int m0_cc_stob_create(struct m0_fom *fom, struct m0_stob_id *sid)
static void ce_stob_destroy_credit(struct m0_fom_cob_op *cob_op, struct m0_be_tx_credit *accum)
static void cob_getattr_fom_fini(struct m0_fom *fom)
struct m0_io_indexvec ct_io_ivec
static void cob_fom_stob2fid_map(const struct m0_fom_cob_op *cfom, struct m0_fid *out)
M0_INTERNAL struct m0_storage_devs * m0_cs_storage_devs_get(void)
struct m0_sm_state_descr cob_ops_phases[]
M0_INTERNAL void m0_chan_unlock(struct m0_chan *ch)
M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find_by_stob_id(const struct m0_stob_id *stob_id)
M0_INTERNAL bool m0_is_cob_create_fop(const struct m0_fop *fop)
static int cd_cob_delete(struct m0_fom *fom, struct m0_fom_cob_op *cd, const struct m0_cob_attr *attr)
struct m0_indexvec fco_want
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL int m0_stob_punch_credit(struct m0_stob *stob, struct m0_indexvec *want, struct m0_indexvec *got, struct m0_be_tx_credit *accum)
M0_INTERNAL enum m0_stob_state m0_stob_state_get(struct m0_stob *stob)
static void cob_setattr_fom_fini(struct m0_fom *fom)
#define M0_BYTECOUNT_USER_ID
static size_t cob_fom_locality_get(const struct m0_fom *fom)
M0_INTERNAL int m0_cob_bc_lookup(struct m0_cob *cob, struct m0_cob_bckey *bc_key, struct m0_cob_bcrec *bc_rec)
M0_INTERNAL size_t m0_cob_io_fom_locality(const struct m0_fid *fid)
struct m0_stob_id fco_stob_id
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL int m0_storage_dev_stob_create(struct m0_storage_devs *devs, struct m0_stob_id *sid, struct m0_dtx *dtx)
struct m0_indexvec fco_got
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
struct m0_rpc_item * m0_fop_to_rpc_item(const struct m0_fop *fop)
M0_INTERNAL bool m0_be_should_break(struct m0_be_engine *eng, const struct m0_be_tx_credit *accum, const struct m0_be_tx_credit *delta)
M0_INTERNAL int m0_cc_stob_cr_credit(struct m0_stob_id *sid, struct m0_be_tx_credit *accum)
struct m0_fop_mod_rep cor_mod_rep
static struct m0_fop * fop
static const struct m0_fom_ops ct_fom_ops
static bool cob_is_md(const struct m0_fom_cob_op *cfom)
struct m0_cob_omgrec co_omgrec
M0_INTERNAL int m0_cob_delete(struct m0_cob *cob, struct m0_be_tx *tx)
M0_INTERNAL int m0_cob_locate(struct m0_cob_domain *dom, struct m0_cob_oikey *oikey, uint64_t flags, struct m0_cob **out)
M0_INTERNAL int m0_cob_setattr(struct m0_cob *cob, struct m0_cob_attr *attr, struct m0_be_tx *tx)
static int cob_fom_populate(struct m0_fom *fom)
void(* fo_fini)(struct m0_fom *fom)
static int cob_stob_delete_credit(struct m0_fom *fom)
enum m0_cob_op fco_fop_type
M0_INTERNAL bool m0_is_cob_getattr_fop(const struct m0_fop *fop)
static int cob_attr_get(struct m0_cob *cob, struct m0_cob_attr *attr)
M0_INTERNAL void m0_stob_delete_mark(struct m0_stob *stob)
M0_INTERNAL int m0_cob_alloc(struct m0_cob_domain *dom, struct m0_cob **out)
M0_INTERNAL int m0_stob_punch(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
M0_INTERNAL void m0_stob_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
M0_INTERNAL bool m0_is_cob_delete_fop(const struct m0_fop *fop)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
static const struct m0_fom_ops cc_fom_ops
static int cob_op_fom_create(struct m0_fom **out)
M0_INTERNAL bool m0_fid_is_valid(const struct m0_fid *fid)
M0_INTERNAL void m0_dump_cob_attr(const struct m0_cob_attr *attr)
static struct m0_dtm_oper_descr reply
M0_INTERNAL uint64_t m0_sm_id_get(const struct m0_sm *sm)
static struct m0_fom_cob_op * cob_fom_get(const struct m0_fom *fom)
M0_INTERNAL void m0_fid_convert_stob2cob(const struct m0_stob_id *stob_id, struct m0_fid *cob_fid)
static int tail(struct m0_sm *mach)
M0_INTERNAL int m0_cc_cob_nskey_make(struct m0_cob_nskey **nskey, const struct m0_fid *gfid, uint32_t cob_idx)
static struct m0_stob_domain * sdom
M0_INTERNAL const char * m0_fom_phase_name(const struct m0_fom *fom, int phase)
#define M0_IMPOSSIBLE(fmt,...)
static int cob_setattr(struct m0_fom *fom, struct m0_fom_cob_op *gop, struct m0_cob_attr *attr)