28 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 93 "Targets to synced for a client SYNC request",
95 srt_tlink, srt_tlink_magic,
111 stx_tlink, stx_link_magic,
277 struct m0_tl *pending_tx_tl;
315 "than that requested.");
327 pending_tx_tl = &
ent->en_pending_tx;
328 pending_tx_lock = &
ent->en_pending_tx_lock;
331 pending_tx_tl = &
op->op_pending_tx;
332 pending_tx_lock = &
op->op_pending_tx_lock;
490 bool wait_after_launch)
496 struct m0_tl *stx_tl;
521 !wait_after_launch, &sfw);
545 if (saved_error == 0)
625 saved_error = saved_error ? :
rc;
628 return M0_RC(saved_error);
632 int type,
void *target)
674 struct m0_tl *pending_tx_tl,
679 int nr_saved_stxs = 0;
686 M0_ALLOC_ARR(saved_stxs, spti_tlist_length(pending_tx_tl));
687 if (saved_stxs ==
NULL) {
738 if (
i == nr_saved_stxs)
750 struct m0_tl *pending_tx,
777 spti_tlink_init_at(
stx, pending_tx);
802 &
ent->en_pending_tx, btr);
807 &
op->op_pending_tx, btr);
819 M0_LEAVE(
"Client sync record updated.");
831 m0_op_sync_bob_check(os) &&
833 m0_ast_rc_bob_check(&os->
os_ar) &&
834 m0_op_common_bob_check(&os->
os_oc));
851 m0_op_common_bob_fini(&os->
os_oc);
852 m0_ast_rc_bob_fini(&os->
os_ar);
853 m0_op_sync_bob_fini(os);
873 os =
M0_AMB(os, oc, os_oc);
943 os =
M0_AMB(os, oc, os_oc);
946 m0_op_common_bob_init(oc);
966 m0_op_sync_bob_init(os);
967 m0_ast_rc_bob_init(&os->
os_ar);
1014 &
ent->en_pending_tx_lock);
1052 &
op->op_pending_tx_lock);
1077 &
sreq, &
ent->en_pending_tx, &
ent->en_pending_tx_lock)?:
1096 int saved_error = 0;
1116 m0_tl_for(pools_common_svc_ctx, &
m0c->m0c_pools_common.pc_svc_ctxs,
1131 (M0_CST_MDS, M0_CST_IOS))) {
1163 saved_error = saved_error ? :
rc;
1167 return (saved_error == 0) ?
M0_RC(saved_error):
M0_ERR(saved_error);
1183 os =
M0_AMB(os, oc, os_oc);
1202 #undef M0_TRACE_SUBSYSTEM
struct m0_sm_group * os_sm_grp
M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item)
m0_time_t ri_resend_interval
#define M0_ALLOC_ARR(arr, nr)
static struct m0_semaphore wait
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
static void sync_fop_ast(struct m0_sm_group *grp, struct m0_sm_ast *ast)
enum m0_rpc_item_priority ri_prio
struct m0_mutex sc_max_pending_tx_lock
static size_t locality(const struct m0_fom *fom)
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
static int sync_request_launch(struct sync_request *sreq, enum m0_fsync_mode mode, bool wait_after_launch)
static struct m0_sm_group * grp
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
#define M0_LOG(level,...)
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
int m0_entity_sync(struct m0_entity *ent)
static void sync_request_done_locked(struct sync_request *sreq)
struct m0_reqh_service_txid * sfw_stx
static void sync_fop_stx_update(struct m0_reqh_service_txid *stx, uint64_t txid)
struct m0_fop_type m0_fop_fsync_ios_fopt
static struct sync_request sreq
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)
void * m0_fop_data(const struct m0_fop *fop)
struct sync_request * os_req
int m0_sync_op_add(struct m0_op *sop, struct m0_op *op)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
struct m0_fop_type m0_fop_fsync_mds_fopt
static struct m0_rpc_item * item
int m0_rpc_item_wait_for_reply(struct m0_rpc_item *item, m0_time_t timeout)
static struct m0_sm_ast ast[NR]
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
static bool sync_op_invariant(struct m0_op_sync *os)
struct m0_entity * srt_ent
#define M0_ERR_INFO(rc, fmt,...)
const struct m0_bob_type oc_bobtype
void(* oc_cb_free)(struct m0_op_common *oc)
return M0_ERR(-EOPNOTSUPP)
static void sync_op_cb_launch(struct m0_op_common *oc)
static int sync_request_stx_add(struct sync_request *sreq, struct m0_tl *pending_tx_tl, struct m0_mutex *pending_tx_lock)
M0_INTERNAL int m0_op_stable(struct m0_op *op)
#define M0_AMB(obj, ptr, field)
#define m0_tl_teardown(name, head, obj)
void(* si_fop_fini)(struct m0_fop *fop)
static struct sync_target stgt
static int sync_reply_process(struct sync_fop_wrapper *sfw)
static int sync_request_launch_and_wait(struct sync_request *sreq, enum m0_fsync_mode mode)
struct m0_be_tx_remid stx_tri
struct m0_be_tx_remid ffr_be_remid
#define bob_of(ptr, type, field, bt)
int(* si_post_rpc)(struct m0_rpc_item *item)
struct m0_reqh_service_ctx * stx_service_ctx
enum m0_conf_service_type sc_type
M0_INTERNAL struct m0_entity * m0__op_sync_entity(const struct m0_op *op)
int m0_sync_entity_add(struct m0_op *sop, struct m0_entity *ent)
struct m0_rpc_item * ri_reply
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
M0_BOB_DEFINE(static, &os_bobtype, m0_op_sync)
static const struct m0_rpc_item_ops sync_ri_ops
static int struct dentry int mode
static struct m0_reqh_service_ctx service
void(* oc_cb_fini)(struct m0_op_common *oc)
static const struct m0_bob_type os_bobtype
static struct m0_reqh_service_txid stx[NUM_STRECORDS]
M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
static void sync_request_init(struct sync_request *sreq)
int m0_sync(struct m0_client *m0c, bool wait)
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
int m0_sync_op_init(struct m0_op **sop)
struct m0_be_tx_remid ff_be_remid
struct sync_request * sfw_req
static int sync_request_fop_send(struct sync_request *sreq, struct m0_reqh_service_txid *stx, enum m0_fsync_mode mode, bool set_ri_ops, struct sync_fop_wrapper **sfw_out)
M0_INTERNAL int m0_op_executed(struct m0_op *op)
static void sync_op_cb_fini(struct m0_op_common *oc)
M0_TL_DESCR_DEFINE(sync_target, "Targets to synced for a client SYNC request", static, struct sync_target, srt_tlink, srt_tlink_magic, M0_SYNC_TGT_TL_MAGIC, M0_SYNC_TGT_TL_MAGIC)
void(* rio_replied)(struct m0_rpc_item *item)
struct m0_op_sync * sr_op_sync
M0_INTERNAL int m0_rpc_session_validate(struct m0_rpc_session *session)
int32_t m0_rpc_item_error(const struct m0_rpc_item *item)
static void sync_request_ast(struct m0_sm_group *grp, struct m0_sm_ast *ast)
struct m0_pdclust_tgt_addr tgt
static void sync_request_done(struct sync_request *sreq)
static void sync_rio_replied(struct m0_rpc_item *item)
struct m0_sm_group op_sm_group
int(* si_wait_for_reply)(struct m0_rpc_item *item, m0_time_t timeout)
#define M0_FI_ENABLED(tag)
static int sync_op_init(struct m0_op *op)
struct m0_be_tx_remid ff_be_remid
struct m0_fop_type m0_fop_fsync_cas_fopt
#define M0_ALLOC_PTR(ptr)
struct m0_entity * op_entity
const struct m0_rpc_item_ops * ri_ops
M0_INTERNAL struct m0_locality * m0__locality_pick(struct m0_client *cinst)
void(* si_fop_put)(struct m0_fop *fop)
m0_time_t m0_time_from_now(uint64_t secs, long ns)
struct m0_rpc_session * ri_session
M0_INTERNAL void m0_sm_move(struct m0_sm *mach, int32_t rc, int state)
void m0_fop_put_lock(struct m0_fop *fop)
static struct m0_fop * fop
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
M0_INTERNAL int m0_op_alloc(struct m0_op **op, size_t op_size)
M0_TL_DEFINE(sync_target, static, struct sync_target)
static int sync_request_target_add(struct sync_request *sreq, int type, void *target)
struct m0_rpc_session rlk_sess
static int sync_reply_wait(struct sync_fop_wrapper *sfw)
static void sync_fop_done(struct sync_fop_wrapper *sfw, int rc)
void(* oc_cb_launch)(struct m0_op_common *oc)
struct m0_rpc_link sc_rlink
#define m0_tl_find(name, var, head,...)
void sync_record_update(struct m0_reqh_service_ctx *service, struct m0_entity *ent, struct m0_op *op, struct m0_be_tx_remid *btr)
#define m0_tl_for(name, head, obj)
struct m0_rpc_item f_item
union sync_target::@361 u
#define offsetof(typ, memb)
M0_INTERNAL bool m0_sm_group_is_locked(const struct m0_sm_group *grp)
static struct sync_interactions si
static void sync_op_cb_free(struct m0_op_common *oc)
struct m0_sm_conf m0_op_conf
struct m0_mutex sr_fops_lock
struct m0_reqh_service_txid sc_max_pending_tx
static void sync_pending_stx_update(struct m0_reqh_service_ctx *service, struct m0_mutex *pending_tx_lock, struct m0_tl *pending_tx, struct m0_be_tx_remid *btr)
static void sync_fop_cleanup(struct m0_ref *ref)
#define M0_IMPOSSIBLE(fmt,...)
struct m0_op_common os_oc