37 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 106 .sd_name =
"initialised",
111 .sd_name =
"launched",
116 .sd_name =
"executed",
164 .sd_name =
"creating",
168 .sd_name =
"deleting",
172 .sd_name =
"opening",
182 .sd_name =
"closing",
248 M0_INTERNAL
struct m0_op *
257 return instance->m0c_config->mc_is_oostore;
338 m0_op_bob_check(
op));
359 "Entity id should larger than M0_ID_APP.",
423 obj->ob_attr.oa_bshift = M0_DEFAULT_BUF_SHIFT;
424 obj_size =
obj->ob_attr.oa_buf_size;
425 obj->ob_attr.oa_layout_id = obj_size == 0 &&
layout_id == 0 ?
431 spti_tlist_init(&
obj->ob_pending_tx);
507 if (
op->op_cbs !=
NULL &&
op->op_cbs->oop_executed !=
NULL)
508 op->op_cbs->oop_executed(
op);
532 if (
op->op_cbs !=
NULL &&
op->op_cbs->oop_stable !=
NULL)
533 op->op_cbs->oop_stable(
op);
559 if (
op->op_cbs !=
NULL &&
op->op_cbs->oop_failed !=
NULL)
560 op->op_cbs->oop_failed(
op);
581 size_t cached_size = (*op)->op_size;
583 if ((*op)->op_size <
size)
587 memset(*
op, 0, cached_size);
588 (*op)->op_size =
size;
591 spti_tlist_init(&(*op)->op_pending_tx);
647 for (
i = 0;
i <
nr;
i++) {
648 entity =
op[
i]->op_entity;
732 for (
i = 0;
i <
nr;
i++)
791 (*op)->op_size = op_size;
824 op->op_entity = entity;
830 grp = &
op->op_sm_group;
868 spti_tlist_fini(&
op->op_pending_tx);
871 grp = &
op->op_sm_group;
894 M0_PRE((
op->op_size >=
sizeof *oc));
918 op->op_linger = linger;
951 #undef M0_TRACE_SUBSYSTEM M0_INTERNAL int m0_uint128_cmp(const struct m0_uint128 *u0, const struct m0_uint128 *u1)
const struct m0_bob_type ar_bobtype
const struct m0_bob_type oo_bobtype
M0_INTERNAL struct m0_client * m0__idx_instance(const struct m0_idx *idx)
void m0_entity_fini(struct m0_entity *entity)
M0_INTERNAL int m0_op_get(struct m0_op **op, size_t size)
struct m0_mutex en_pending_tx_lock
struct m0_sm_trans_descr entity_trans[]
M0_INTERNAL bool entity_invariant_full(struct m0_entity *ent)
M0_INTERNAL bool entity_id_is_valid(const struct m0_uint128 *id)
const struct m0_bob_type op_bobtype
void m0_op_fini(struct m0_op *op)
M0_INTERNAL bool m0__is_oostore(struct m0_client *instance)
static struct m0_sm_group * grp
static uint64_t opcount[MAX_OPCODE]
#define M0_LOG(level,...)
struct m0_sm_trans_descr m0_op_trans[]
int32_t m0_rc(const struct m0_op *op)
static struct m0_clovis * m0c
M0_INTERNAL int m0_op_init(struct m0_op *op, const struct m0_sm_conf *conf, struct m0_entity *entity)
M0_INTERNAL void m0_op_launch_one(struct m0_op *op)
M0_INTERNAL bool m0_op_entity_invariant(const struct m0_op *op)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
const struct m0_uint128 M0_UBER_REALM
M0_INTERNAL bool m0_sm_addb2_counter_init(struct m0_sm *sm)
M0_INTERNAL void m0_sm_group_fini(struct m0_sm_group *grp)
const struct m0_uint128 M0_ID_APP
M0_INTERNAL int m0_sm_timedwait(struct m0_sm *mach, uint64_t states, m0_time_t deadline)
int32_t m0_op_wait(struct m0_op *op, uint64_t bits, m0_time_t to)
struct m0_tl en_pending_tx
M0_INTERNAL void m0__io_ref_put(struct m0_client *m0c)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
struct m0_entity in_entity
M0_INTERNAL void m0_client__layout_put(struct m0_client_layout *layout)
struct m0_sm_state_descr entity_phases[]
static void addb2_add_op_attrs(const struct m0_op *op)
const struct m0_bob_type oc_bobtype
void(* oc_cb_free)(struct m0_op_common *oc)
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL struct m0_client * m0__op_instance(const struct m0_op *op)
M0_INTERNAL int m0_op_stable(struct m0_op *op)
#define M0_AMB(obj, ptr, field)
#define m0_tl_teardown(name, head, obj)
void m0_client_layout_free(struct m0_client_layout *layout)
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
M0_INTERNAL bool m0_entity_type_is_valid(enum m0_entity_type type)
void m0_obj_fini(struct m0_obj *obj)
#define bob_of(ptr, type, field, bt)
struct m0_sm_conf entity_conf
void m0_op_launch(struct m0_op **op, uint32_t nr)
M0_INTERNAL struct m0_entity * m0__op_sync_entity(const struct m0_op *op)
void * m0_alloc(size_t size)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
void(* oc_cb_fini)(struct m0_op_common *oc)
struct m0_op_common oo_oc
void m0_op_cancel(struct m0_op **op, uint32_t nr)
M0_INTERNAL int m0_op_executed(struct m0_op *op)
M0_INTERNAL struct m0_op * m0__ioo_to_op(struct m0_op_io *ioo)
M0_INTERNAL struct m0_locality * m0_locality_here(void)
M0_INTERNAL int m0__io_ref_get(struct m0_client *m0c)
static struct m0_client cinst
M0_INTERNAL bool entity_invariant_locked(const struct m0_entity *ent)
struct m0_realm * en_realm
struct m0_sm_group en_sm_group
M0_INTERNAL bool m0_op_invariant(const struct m0_op *op)
const int m0_lid_to_unit_map_nr
#define M0_FI_ENABLED(tag)
M0_INTERNAL void m0_sm_init(struct m0_sm *mach, const struct m0_sm_conf *conf, uint32_t state, struct m0_sm_group *grp)
M0_INTERNAL int m0_op_failed(struct m0_op *op)
M0_INTERNAL struct m0_locality * m0__locality_pick(struct m0_client *cinst)
void(* oc_cb_cancel)(struct m0_op_common *oc)
#define M0_CLIENT_THREAD_ENTER
M0_INTERNAL void m0_sm_move(struct m0_sm *mach, int32_t rc, int state)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
#define IS_IN_ARRAY(idx, array)
void m0_obj_init(struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
static struct m0 instance
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
M0_INTERNAL struct m0_client * m0__obj_instance(const struct m0_obj *obj)
M0_INTERNAL int m0_op_alloc(struct m0_op **op, size_t op_size)
struct m0_client * re_instance
void m0_op_kick(struct m0_op *op)
M0_INTERNAL void m0_op_cancel_one(struct m0_op *op)
M0_BOB_DEFINE(M0_INTERNAL, &oc_bobtype, m0_op_common)
void m0_op_free(struct m0_op *op)
M0_INTERNAL bool m0_sm_conf_is_initialized(const struct m0_sm_conf *conf)
struct m0_sm_state_descr m0_op_phases[]
void(* oc_cb_launch)(struct m0_op_common *oc)
M0_INTERNAL uint64_t m0_sm_id_get(const struct m0_sm *sm)
M0_INTERNAL void m0_entity_init(struct m0_entity *entity, struct m0_realm *parent, const struct m0_uint128 *id, const enum m0_entity_type type)
#define offsetof(typ, memb)
enum m0_entity_type en_type
M0_INTERNAL bool m0_sm_group_is_locked(const struct m0_sm_group *grp)
struct m0_sm_conf m0_op_conf
M0_INTERNAL struct m0_client * m0__entity_instance(const struct m0_entity *entity)
void m0_op_setup(struct m0_op *op, const struct m0_op_ops *cbs, m0_time_t linger)
M0_INTERNAL void m0_sm_fini(struct m0_sm *mach)
M0_INTERNAL bool m0_sm_invariant(const struct m0_sm *mach)