Motr  M0
pump.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CM
24 #include "lib/trace.h"
25 
26 #include "lib/bob.h"
27 #include "lib/misc.h" /* M0_BITS */
28 #include "lib/errno.h" /* ENOBUFS, ENODATA */
29 #include "lib/finject.h"
30 
31 #include "sm/sm.h"
32 #include "rpc/rpc_opcodes.h" /* M0_CM_PUMP_OPCODE */
33 
34 #include "cm/pump.h"
35 #include "cm/cm.h"
36 #include "cm/cp.h"
37 #include "cm/ag.h" /* m0_cm_aggr_groups_prune */
38 #include "cm/proxy.h" /* m0_cm_proxy_min_sw_hi_get */
39 #include "reqh/reqh.h"
40 
41 #include "pool/pool.h"
42 
43 #include "motr/setup.h" /* m0_cs_ctx_get */
63  CPP_DATA_NEXT, /* 2 */
69  CPP_COMPLETE, /* 3 */
70  CPP_STOP, /* 4 */
77  CPP_FAIL, /* 5 */
79 };
80 
81 enum {
82  CM_PUMP_MAGIX = 0x330FF1CE0FF1CE77,
83 };
84 
85 static const struct m0_bob_type pump_bob = {
86  .bt_name = "copy packet pump",
87  .bt_magix_offset = M0_MAGIX_OFFSET(struct m0_cm_cp_pump, p_magix),
88  .bt_magix = CM_PUMP_MAGIX,
89  .bt_check = NULL
90 };
91 
93 
95  .fto_create = NULL
96 };
97 
98 static struct m0_cm *pump2cm(const struct m0_cm_cp_pump *cp_pump)
99 {
100  return container_of(cp_pump, struct m0_cm, cm_cp_pump);
101 }
102 
103 static bool cm_cp_pump_invariant(const struct m0_cm_cp_pump *cp_pump)
104 {
105  int phase = m0_fom_phase(&cp_pump->p_fom);
106 
107  return m0_cm_cp_pump_bob_check(cp_pump) &&
108  ergo(M0_IN(phase, (CPP_DATA_NEXT)), cp_pump->p_cp != NULL);
109 }
110 
111 static void pump_move(struct m0_cm_cp_pump *cp_fom, int rc, int phase)
112 {
113  m0_fom_phase_move(&cp_fom->p_fom, rc, phase);
114 }
115 
116 static int cpp_alloc(struct m0_cm_cp_pump *cp_pump)
117 {
118  struct m0_cm_cp *cp;
119  struct m0_cm *cm;
120  M0_ENTRY();
121 
122  cm = pump2cm(cp_pump);
123  cp = cm->cm_ops->cmo_cp_alloc(cm);
124  if (cp == NULL) {
125  pump_move(cp_pump, -ENOMEM, CPP_FAIL);
126  } else {
127  m0_cm_cp_fom_init(cm, cp, NULL, NULL);
128  cp_pump->p_cp = cp;
129  pump_move(cp_pump, 0, CPP_DATA_NEXT);
130  }
131 
132  return M0_RC(M0_FSO_AGAIN);
133 }
134 
135 static int cpp_data_next(struct m0_cm_cp_pump *cp_pump)
136 {
137  struct m0_cm_cp *cp;
138  struct m0_cm *cm;
139  int rc;
140  M0_ENTRY("pump = %p", cp_pump);
141 
142  cp = cp_pump->p_cp;
143  cm = pump2cm(cp_pump);
144  M0_ASSERT(cp != NULL);
145  m0_cm_lock(cm);
146  /* This operation might block. */
147  if (M0_FI_ENABLED("enodata")) {
148  rc = M0_ERR(-ENODATA);
149  goto enodata;
150  }
151  rc = m0_cm_data_next(cm, cp);
152  if (rc != 0)
154 enodata:
155  m0_cm_unlock(cm);
156  if (rc == M0_FSO_WAIT)
157  return M0_RC(rc);
158  if (rc < 0) {
159  m0_cm_lock(cm);
161  m0_cm_unlock(cm);
162  if (rc == -ENOBUFS)
163  return M0_FSO_WAIT;
164  else if (rc == -ENODATA) {
165  /*
166  * No more data available. Free the already
167  * allocated cp_pump->p_cp.
168  */
169  cp->c_ops->co_free(cp);
170  cp_pump->p_cp = NULL;
171  /*
172  * No local data found corresponding to the
173  * failure. So mark the operation as complete.
174  */
175  pump_move(cp_pump, 0, CPP_COMPLETE);
176  M0_LOG(M0_DEBUG, "pump moves to COMPLETE");
177  } else {
178  cp->c_ops->co_free(cp);
179  pump_move(cp_pump, rc, CPP_FAIL);
180  }
181  return M0_RC(M0_FSO_AGAIN);
182  }
183  if (rc == M0_FSO_AGAIN) {
184  int rc1 = m0_cm_cp_enqueue(cm, cp);
185  pump_move(cp_pump, rc1, rc1 == 0 ? CPP_ALLOC : CPP_FAIL);
186  }
187  return M0_RC(rc);
188 }
189 
190 static int cpp_complete(struct m0_cm_cp_pump *cp_pump)
191 {
192  struct m0_cm *cm = pump2cm(cp_pump);
193  int rc;
194  M0_ENTRY();
195 
196  m0_cm_lock(cm);
197  M0_LOG(M0_DEBUG, "aggr in = %"PRIx64 " aggr out= %"PRIx64
198  " swu complete= %d proxy_nr= %"PRIu64,
202  cm->cm_proxy_nr);
203 
206  if (cm->cm_proxy_nr == 0)
209  m0_cm_unlock(cm);
210  return M0_RC(M0_FSO_WAIT);
211  }
212 
213  rc = m0_cm_complete(cm);
214  m0_cm_unlock(cm);
215  if (rc == -EAGAIN)
216  return M0_RC(M0_FSO_WAIT);
217 
218  m0_clink_del_lock(&cp_pump->p_complete);
219  M0_LOG(M0_DEBUG, "pump completed. Stopping the CM");
220  pump_move(cp_pump, 0, CPP_STOP);
221 
222  return M0_RC(M0_FSO_AGAIN);
223 }
224 
225 static int cpp_stop(struct m0_cm_cp_pump *cp_pump)
226 {
227  struct m0_cm *cm = pump2cm(cp_pump);
228  struct m0_reqh *reqh;
229  struct m0_sm_group *grp;
230  struct m0_fom *p_fom;
231  struct m0_dtx *dtx;
232  int rc;
233  M0_ENTRY();
234 
235  p_fom = &cp_pump->p_fom;
236 
237  reqh = m0_fom_reqh(p_fom);
238  grp = &p_fom->fo_loc->fl_group;
239  dtx = &p_fom->fo_tx;
240 
241  if (dtx->tx_state < M0_DTX_INIT) {
243  m0_dtx_open(dtx);
244  }
245  if (m0_be_tx_state(&dtx->tx_betx) == M0_BTS_FAILED) {
246  rc = dtx->tx_betx.t_sm.sm_rc;
247  pump_move(cp_pump, rc, CPP_FAIL);
248  return M0_ERR(rc);
249  }
250  if (M0_IN(m0_be_tx_state(&dtx->tx_betx),
252  m0_fom_wait_on(p_fom, &dtx->tx_betx.t_sm.sm_chan,
253  &p_fom->fo_cb);
254  return M0_RC(M0_FSO_WAIT);
255  } else if (dtx->tx_state == M0_DTX_INIT) {
256  m0_dtx_opened(dtx);
257  /*
258  * CM stop is potentially blocking operation. For example, DIX
259  * repair/re-balance CM stops iterator (which executes in a
260  * separate FOM) and waits until it reaches desired state.
261  */
262  m0_fom_block_enter(p_fom);
263  m0_cm_stop(cm);
264  m0_fom_block_leave(p_fom);
265  }
266 
267  if (dtx->tx_state != M0_DTX_DONE) {
268  m0_fom_wait_on(p_fom, &dtx->tx_betx.t_sm.sm_chan, &p_fom->fo_cb);
269  m0_dtx_done(dtx);
270  return M0_RC(M0_FSO_WAIT);
271  } else {
272  if (m0_be_tx_state(&dtx->tx_betx) != M0_BTS_DONE) {
273  m0_fom_wait_on(p_fom, &dtx->tx_betx.t_sm.sm_chan,
274  &p_fom->fo_cb);
275  return M0_RC(M0_FSO_WAIT);
276  }
277  m0_dtx_fini(dtx);
278  }
279  M0_SET0(dtx);
280 
281  m0_clink_fini(&cp_pump->p_complete);
282  pump_move(cp_pump, 0, CPP_FINI);
283 
284  return M0_RC(M0_FSO_WAIT);
285 }
286 
287 static int cpp_fail(struct m0_cm_cp_pump *cp_pump)
288 {
289  struct m0_cm *cm;
290  M0_ENTRY();
291 
292  M0_PRE(cp_pump != NULL);
293 
294  cm = pump2cm(cp_pump);
295  m0_cm_lock(cm);
296  m0_cm_abort(cm, m0_fom_rc(&cp_pump->p_fom));
297  m0_cm_unlock(cm);
298  pump_move(cp_pump, 0, CPP_COMPLETE);
299  return M0_RC(M0_FSO_AGAIN);
300 }
301 
303  [CPP_ALLOC] = {
305  .sd_name = "copy packet allocate",
306  .sd_allowed = M0_BITS(CPP_DATA_NEXT, CPP_FAIL)
307  },
308  [CPP_DATA_NEXT] = {
309  .sd_flags = 0,
310  .sd_name = "copy packet data next",
311  .sd_allowed = M0_BITS(CPP_ALLOC, CPP_COMPLETE,
312  CPP_FAIL)
313  },
314  [CPP_COMPLETE] = {
315  .sd_flags = 0,
316  .sd_name = "copy packet pump complete",
317  .sd_allowed = M0_BITS(CPP_STOP, CPP_FINI)
318  },
319  [CPP_STOP] = {
320  .sd_flags = 0,
321  .sd_name = "pump cp stop",
322  .sd_allowed = M0_BITS(CPP_ALLOC, CPP_FINI)
323  },
324  [CPP_FAIL] = {
325  .sd_flags = M0_SDF_FAILURE,
326  .sd_name = "copy packet pump fail",
327  .sd_allowed = M0_BITS(CPP_COMPLETE)
328  },
329  [CPP_FINI] = {
330  .sd_flags = M0_SDF_TERMINAL,
331  .sd_name = "copy packet pump finish",
332  .sd_allowed = 0
333  },
334 };
335 
336 
338  {"Copy packet allocated",
339  CPP_ALLOC,
340  CPP_DATA_NEXT},
341  {"Copy packet allocation failed",
342  CPP_ALLOC,
343  CPP_FAIL},
344  {"Copy packet created, create next copy packet",
346  CPP_ALLOC},
347  {"No more data to pump",
349  CPP_COMPLETE},
350  {"Copy packet creation failed",
352  CPP_FAIL},
353  {"No more data to create copy packets",
354  CPP_COMPLETE,
355  CPP_FINI},
356  {"Pump Completed",
357  CPP_COMPLETE,
358  CPP_STOP},
359  {"Pump STOP, allocate copy packet",
360  CPP_STOP,
361  CPP_ALLOC},
362  {"Pump STOP",
363  CPP_STOP,
364  CPP_FINI},
365  {"Pump failed",
366  CPP_FAIL,
367  CPP_COMPLETE},
368 };
369 
371  .scf_name = "sm: cp pump conf",
372  .scf_nr_states = ARRAY_SIZE(cm_cp_pump_sd),
373  .scf_state = cm_cp_pump_sd,
374  .scf_trans_nr = ARRAY_SIZE(cm_cp_pump_td),
375  .scf_trans = cm_cp_pump_td
376 };
377 
378 static int (*pump_action[]) (struct m0_cm_cp_pump *cp_pump) = {
379  [CPP_ALLOC] = cpp_alloc,
382  [CPP_STOP] = cpp_stop,
383  [CPP_FAIL] = cpp_fail,
384 };
385 
386 static uint64_t cm_cp_pump_fom_locality(const struct m0_fom *fom)
387 {
388  return fom->fo_type->ft_id;
389 }
390 
391 static int cm_cp_pump_fom_tick(struct m0_fom *fom)
392 {
393  struct m0_cm_cp_pump *cp_pump;
394  int phase = m0_fom_phase(fom);
395  int rc;
396  M0_ENTRY("fom=%p phase=%d(%s)",
397  fom, phase, m0_fom_phase_name(fom, phase));
398 
399  cp_pump = bob_of(fom, struct m0_cm_cp_pump, p_fom, &pump_bob);
401  rc = pump_action[phase](cp_pump);
402  return M0_RC(rc);
403 }
404 
405 static void cm_cp_pump_fom_fini(struct m0_fom *fom)
406 {
407  struct m0_cm_cp_pump *cp_pump;
408 
409  cp_pump = bob_of(fom, struct m0_cm_cp_pump, p_fom, &pump_bob);
410  m0_cm_cp_pump_bob_fini(cp_pump);
411  m0_fom_fini(fom);
412 }
413 
414 static const struct m0_fom_ops cm_cp_pump_fom_ops = {
416  .fo_tick = cm_cp_pump_fom_tick,
417  .fo_home_locality = cm_cp_pump_fom_locality
418 };
419 
420 bool m0_cm_cp_pump_is_complete(const struct m0_cm_cp_pump *cp_pump)
421 {
422  return M0_IN(m0_fom_phase(&cp_pump->p_fom), (CPP_COMPLETE,
423  CPP_STOP));
424 }
425 
426 M0_INTERNAL void m0_cm_cp_pump_init(struct m0_cm_type *cmtype)
427 {
428  m0_fom_type_init(&cmtype->ct_pump_fomt, cmtype->ct_fom_id + 2,
430  &cmtype->ct_stype, &cm_cp_pump_conf);
431 }
432 
433 M0_INTERNAL void m0_cm_cp_pump_prepare(struct m0_cm *cm)
434 {
435  struct m0_cm_cp_pump *cp_pump;
436  M0_ENTRY("cm = %p", cm);
437 
439 
440  cp_pump = &cm->cm_cp_pump;
441  m0_cm_cp_pump_bob_init(cp_pump);
442  m0_fom_init(&cp_pump->p_fom, &cm->cm_type->ct_pump_fomt,
444 }
445 
446 M0_INTERNAL void m0_cm_cp_pump_destroy(struct m0_cm *cm)
447 {
449 }
450 
451 static void complete_wakeup(struct m0_sm_group *grp, struct m0_sm_ast *ast)
452 {
453  struct m0_cm_cp_pump *pump = M0_AMB(pump, ast, p_wakeup);
454 
455  M0_ENTRY();
456 
457  if (m0_fom_phase(&pump->p_fom) == CPP_COMPLETE &&
458  m0_fom_is_waiting(&pump->p_fom))
459  m0_fom_ready(&pump->p_fom);
460 
461  M0_LEAVE();
462 }
463 
464 static bool pump_cb(struct m0_clink *link)
465 {
466  struct m0_cm_cp_pump *pump = container_of(link, struct m0_cm_cp_pump,
467  p_complete);
468  struct m0_sm_group *grp;
469  M0_ENTRY();
470 
471  grp = &pump->p_fom.fo_loc->fl_group;
473  if (pump->p_wakeup.sa_next == NULL)
474  m0_sm_ast_post(grp, &pump->p_wakeup);
475 
476  return M0_RC(true);
477 }
478 
479 M0_INTERNAL void m0_cm_cp_pump_start(struct m0_cm *cm)
480 {
481  struct m0_cm_cp_pump *cp_pump;
482  M0_ENTRY("cm = %p", cm);
483 
485 
486  cp_pump = &cm->cm_cp_pump;
487  m0_clink_init(&cp_pump->p_complete, pump_cb);
488  m0_clink_add(&cm->cm_complete, &cp_pump->p_complete);
489  m0_fom_queue(&cp_pump->p_fom);
490  M0_LEAVE();
491 }
492 
493 #undef M0_TRACE_SUBSYSTEM
494 
497 /*
498  * Local variables:
499  * c-indentation-style: "K&R"
500  * c-basic-offset: 8
501  * tab-width: 8
502  * fill-column: 80
503  * scroll-step: 1
504  * End:
505  */
uint64_t cm_aggr_grps_in_nr
Definition: cm.h:205
M0_INTERNAL void m0_cm_frozen_ag_cleanup(struct m0_cm *cm, struct m0_cm_proxy *proxy)
Definition: cm.c:1148
static int(* pump_action[])(struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:378
struct m0_be_domain * bs_domain
Definition: seg.h:82
M0_INTERNAL void m0_cm_lock(struct m0_cm *cm)
Definition: cm.c:545
#define M0_PRE(cond)
const struct m0_cm_type * cm_type
Definition: cm.h:194
Definition: dtm.h:554
static int cpp_fail(struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:287
Definition: pump.c:70
M0_INTERNAL void m0_fom_block_enter(struct m0_fom *fom)
Definition: fom.c:538
uint64_t ft_id
Definition: fom.h:613
#define NULL
Definition: misc.h:38
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
Definition: chan.c:201
Definition: pump.c:77
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
Definition: chan.c:293
#define ergo(a, b)
Definition: misc.h:293
Definition: pump.c:57
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
Definition: sm.h:506
m0_be_tx_state
Definition: tx.h:214
const struct m0_cm_ops * cm_ops
Definition: cm.h:188
Definition: sm.h:350
static struct m0_sm_group * grp
Definition: bytecount.c:38
#define M0_LOG(level,...)
Definition: trace.h:167
Definition: cp.h:160
M0_LEAVE()
struct m0_sm_group fl_group
Definition: fom.h:274
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: sm.c:135
M0_INTERNAL int m0_cm_stop(struct m0_cm *cm)
Definition: cm.c:866
M0_INTERNAL void m0_dtx_init(struct m0_dtx *tx, struct m0_be_domain *be_domain, struct m0_sm_group *sm_group)
Definition: dtm.c:67
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
M0_INTERNAL void m0_dtx_opened(struct m0_dtx *tx)
Definition: dtm.c:94
struct m0_fom_type ct_pump_fomt
Definition: cm.h:154
struct m0_sm_ast p_wakeup
Definition: pump.h:63
struct m0_fom p_fom
Definition: pump.h:51
M0_INTERNAL void m0_cm_cp_fom_init(struct m0_cm *cm, struct m0_cm_cp *cp, struct m0_fop *fop, struct m0_fop *r_fop)
Definition: cp.c:610
struct m0_dtx fo_tx
Definition: fom.h:498
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
Definition: fom.c:1490
#define M0_BITS(...)
Definition: misc.h:236
Definition: sm.h:504
static int cpp_complete(struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:190
uint64_t cm_aggr_grps_out_nr
Definition: cm.h:233
#define container_of(ptr, type, member)
Definition: misc.h:33
#define M0_SET0(obj)
Definition: misc.h:64
#define PRIx64
Definition: types.h:61
m0_fom_phase
Definition: fom.h:372
const char * bt_name
Definition: bob.h:73
static uint64_t cm_cp_pump_fom_locality(const struct m0_fom *fom)
Definition: pump.c:386
static int cpp_stop(struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:225
M0_INTERNAL void m0_cm_cp_pump_init(struct m0_cm_type *cmtype)
Definition: pump.c:426
const struct m0_fom_type * fo_type
Definition: dump.c:107
return M0_RC(rc)
static struct m0_cm * cm
Definition: cm.c:63
M0_INTERNAL int m0_cm_data_next(struct m0_cm *cm, struct m0_cm_cp *cp)
Definition: cm.c:1034
M0_INTERNAL void m0_cm_unlock(struct m0_cm *cm)
Definition: cm.c:550
#define M0_ENTRY(...)
Definition: trace.h:170
static struct m0_sm_ast ast[NR]
Definition: locality.c:44
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)
Definition: fom.c:1372
M0_INTERNAL bool m0_fom_is_waiting(const struct m0_fom *fom)
Definition: fom.c:1732
#define PRIu64
Definition: types.h:58
struct m0_sm_conf cm_cp_pump_conf
Definition: pump.c:370
M0_INTERNAL void m0_cm_cp_pump_prepare(struct m0_cm *cm)
Definition: pump.c:433
return M0_ERR(-EOPNOTSUPP)
Definition: pump.c:58
cm_cp_pump_fom_phase
Definition: pump.c:49
M0_INTERNAL void m0_fom_ready(struct m0_fom *fom)
Definition: fom.c:429
#define M0_AMB(obj, ptr, field)
Definition: misc.h:320
M0_INTERNAL void m0_dtx_open(struct m0_dtx *tx)
Definition: dtm.c:86
static void cm_cp_pump_fom_fini(struct m0_fom *fom)
Definition: pump.c:405
void m0_fom_fini(struct m0_fom *fom)
Definition: fom.c:1324
#define M0_ASSERT(cond)
const char * scf_name
Definition: sm.h:352
static bool cm_cp_pump_invariant(const struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:103
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
Definition: fom.c:1699
uint64_t ct_fom_id
Definition: cm.h:148
#define bob_of(ptr, type, field, bt)
Definition: bob.h:140
M0_INTERNAL void m0_fom_type_init(struct m0_fom_type *type, uint64_t id, const struct m0_fom_type_ops *ops, const struct m0_reqh_service_type *svc_type, const struct m0_sm_conf *sm)
Definition: fom.c:1596
const struct m0_cm_cp_ops * c_ops
Definition: cp.h:169
M0_INTERNAL void m0_fom_block_leave(struct m0_fom *fom)
Definition: fom.c:582
static void complete_wakeup(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: pump.c:451
struct m0_sm_trans_descr cm_cp_pump_td[]
Definition: pump.c:337
M0_INTERNAL void m0_cm_cp_pump_start(struct m0_cm *cm)
Definition: pump.c:479
M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx)
Definition: dtm.c:134
M0_BOB_DEFINE(static, &pump_bob, m0_cm_cp_pump)
Definition: reqh.h:94
int32_t sm_rc
Definition: sm.h:336
Definition: pump.c:78
Definition: dump.c:103
struct m0_sm_ast * sa_next
Definition: sm.h:509
M0_INTERNAL void m0_cm_cp_pump_destroy(struct m0_cm *cm)
Definition: pump.c:446
static int cpp_data_next(struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:135
M0_INTERNAL void m0_dtx_done(struct m0_dtx *tx)
Definition: dtm.c:115
struct m0_sm t_sm
Definition: tx.h:281
bool swu_is_complete
Definition: sw.h:85
struct m0_chan cm_complete
Definition: cm.h:238
static int cpp_alloc(struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:116
uint32_t sd_flags
Definition: sm.h:378
struct m0_cm_cp *(* cmo_cp_alloc)(struct m0_cm *cm)
Definition: cm.h:310
Definition: fom.h:481
Definition: cm.h:143
uint64_t cm_proxy_nr
Definition: cm.h:250
M0_INTERNAL int m0_cm_cp_enqueue(struct m0_cm *cm, struct m0_cm_cp *cp)
Definition: cp.c:688
bool m0_cm_cp_pump_is_complete(const struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:420
struct m0_reqh reqh
Definition: rm_foms.c:48
#define M0_MAGIX_OFFSET(type, field)
Definition: misc.h:356
struct m0_cm_cp * p_cp
Definition: pump.h:60
struct m0_cm_sw_update cm_sw_update
Definition: cm.h:259
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
struct m0_fom_locality * fo_loc
Definition: fom.h:483
struct m0_be_tx tx_betx
Definition: dtm.h:559
static bool pump_cb(struct m0_clink *link)
Definition: pump.c:464
static int cm_cp_pump_fom_tick(struct m0_fom *fom)
Definition: pump.c:391
static void pump_move(struct m0_cm_cp_pump *cp_fom, int rc, int phase)
Definition: pump.c:111
struct m0_chan sm_chan
Definition: sm.h:331
M0_INTERNAL void m0_clink_add(struct m0_chan *chan, struct m0_clink *link)
Definition: chan.c:228
static const struct m0_fom_ops cm_cp_pump_fom_ops
Definition: pump.c:414
M0_INTERNAL int m0_cm_sw_remote_update(struct m0_cm *cm)
Definition: sw.c:130
struct m0_reqh_service cm_service
Definition: cm.h:191
Definition: cm.h:166
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
Definition: fom.c:1727
M0_INTERNAL bool m0_cm_aggr_group_tlists_are_empty(struct m0_cm *cm)
Definition: ag.c:355
enum m0_dtx_state tx_state
Definition: dtm.h:558
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
Definition: chan.c:208
struct m0_be_seg * rh_beseg
Definition: reqh.h:112
struct m0_reqh_service_type ct_stype
Definition: cm.h:145
void(* co_free)(struct m0_cm_cp *cp)
Definition: cp.h:250
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
Definition: fom.c:624
void(* fo_fini)(struct m0_fom *fom)
Definition: fom.h:657
struct m0_cm_cp_pump cm_cp_pump
Definition: cm.h:257
static struct m0_cm * pump2cm(const struct m0_cm_cp_pump *cp_pump)
Definition: pump.c:98
M0_INTERNAL void m0_cm_abort(struct m0_cm *cm, int rc)
Definition: cm.c:1181
M0_INTERNAL bool m0_cm_is_locked(const struct m0_cm *cm)
Definition: cm.c:560
struct m0_reqh * rs_reqh
Definition: reqh_service.h:259
M0_INTERNAL int m0_cm_complete(struct m0_cm *cm)
Definition: cm.c:1100
static const struct m0_fom_type_ops cm_cp_pump_fom_type_ops
Definition: pump.c:94
static const struct m0_bob_type pump_bob
Definition: pump.c:85
int32_t rc
Definition: trigger_fop.h:47
#define ARRAY_SIZE(a)
Definition: misc.h:45
struct m0_fom_callback fo_cb
Definition: fom.h:488
M0_INTERNAL struct m0_reqh * m0_fom_reqh(const struct m0_fom *fom)
Definition: fom.c:283
static struct m0_sm_state_descr cm_cp_pump_sd[CPP_NR]
Definition: pump.c:302
M0_INTERNAL const char * m0_fom_phase_name(const struct m0_fom *fom, int phase)
Definition: fom.c:1722
struct m0_clink p_complete
Definition: pump.h:62