Motr  M0
ag_store.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" /* ENOENT EPERM */
29 
30 #include "reqh/reqh.h"
31 #include "sm/sm.h"
32 #include "rpc/rpc_opcodes.h" /* M0_CM_SW_UPDATE_OPCODE */
33 
34 #include "cm/sw.h"
35 #include "cm/cm.h"
36 #include "cm/proxy.h"
37 
38 #include "be/op.h" /* M0_BE_OP_SYNC */
39 
65 };
66 
68 };
69 
71  [AG_STORE_INIT] = {
73  .sd_name = "copy machine ag store init",
76  },
77  [AG_STORE_INIT_WAIT] = {
78  .sd_flags = 0,
79  .sd_name = "ag store init wait",
82  },
83  [AG_STORE_START] = {
84  .sd_flags = 0,
85  .sd_name = "ag store start",
86  .sd_allowed = M0_BITS(AG_STORE_UPDATE, AG_STORE_FINI)
87  },
88  [AG_STORE_UPDATE] = {
89  .sd_flags = 0,
90  .sd_name = "Update",
92  },
94  .sd_flags = 0,
95  .sd_name = "Update wait",
98  },
99  [AG_STORE_COMPLETE] = {
100  .sd_flags = 0,
101  .sd_name = "Update complete",
103  },
104  [AG_STORE_FINI] = {
105  .sd_flags = M0_SDF_TERMINAL,
106  .sd_name = "Fini",
107  .sd_allowed = 0
108  },
109 };
110 
112  .scf_name = "sm: store update conf",
113  .scf_nr_states = ARRAY_SIZE(ag_store_update_sd),
114  .scf_state = ag_store_update_sd,
115 };
116 
117 static struct m0_cm *store2cm(struct m0_cm_ag_store *store)
118 {
119  return container_of(store, struct m0_cm, cm_ag_store);
120 }
121 
122 static struct m0_cm_ag_store *fom2store(struct m0_fom *fom)
123 {
124  return container_of(fom, struct m0_cm_ag_store, s_fom);
125 }
126 
127 static int ag_store_alloc(struct m0_cm_ag_store *store)
128 {
129  struct m0_cm *cm = store2cm(store);
131  struct m0_cm_ag_store_data *data;
132  struct m0_be_tx *tx = &store->s_fom.fo_tx.tx_betx;
133  char ag_store[80];
134  int rc;
135 
136  sprintf(ag_store, "ag_store_%llu", (unsigned long long)cm->cm_id);
137 
139  if (data == NULL) {
140  rc = -ENOMEM;
141  } else {
142  rc = m0_be_seg_dict_insert(seg, tx, ag_store, data);
143  if (rc == 0) {
144  M0_SET0(data);
146  M0_LOG(M0_DEBUG, "allocated data iter store = %p", data);
147  } else
149  }
150  m0_be_tx_close(tx);
151 
152  return M0_RC(rc);
153 }
154 
155 static int ag_store_init_load(struct m0_cm_ag_store *store, struct m0_cm_ag_store_data **data)
156 {
157  struct m0_be_tx_credit cred = {};
158  struct m0_cm *cm = store2cm(store);
159  struct m0_fom *fom = &store->s_fom;
161  struct m0_be_tx *tx = &fom->fo_tx.tx_betx;
162  char ag_store[80];
163  int rc;
164 
165  sprintf(ag_store, "ag_store_%llu", (unsigned long long)cm->cm_id);
166  rc = m0_be_seg_dict_lookup(seg, ag_store, (void**)data);
167  if (rc == 0) {
168  M0_LOG(M0_DEBUG, "in=["M0_AG_F"] out=["M0_AG_F"]",
169  M0_AG_P(&(*data)->d_in), M0_AG_P(&(*data)->d_out));
170  return M0_RC(rc);
171  } else if (rc == -ENOENT) {
172  M0_SET0(tx);
173  m0_be_tx_init(tx, 0, seg->bs_domain, &fom->fo_loc->fl_group, NULL,
174  NULL, NULL, NULL);
175  M0_BE_ALLOC_CREDIT_PTR(*data, seg, &cred);
176  m0_be_seg_dict_insert_credit(seg, ag_store, &cred);
177  m0_be_tx_prep(tx, &cred);
178  m0_be_tx_open(tx);
179  M0_POST(tx->t_sm.sm_rc == 0);
180  }
181 
182  return M0_RC(rc);
183 }
184 
188 static void in_out_set(struct m0_cm *cm,
189  struct m0_cm_ag_store *store,
190  struct m0_cm_ag_store_data* s_data)
191 {
192  m0_cm_lock(cm);
193  store->s_data.d_in = s_data->d_in;
194  store->s_data.d_out = s_data->d_out;
195 
196  cm->cm_sw_last_updated_hi = s_data->d_in;
197  cm->cm_last_processed_out = s_data->d_out;
198 
199  if (s_data->d_cm_epoch != 0) {
200  /* Only do this if the epoch is valid. */
201  store->s_data.d_cm_epoch = s_data->d_cm_epoch;
202  cm->cm_epoch = s_data->d_cm_epoch;
203  }
205  m0_cm_unlock(cm);
206 }
207 
208 static int ag_store_init(struct m0_cm_ag_store *store)
209 {
210  struct m0_cm *cm = store2cm(store);
211  struct m0_cm_ag_store_data *s_data;
212  struct m0_fom *fom = &store->s_fom;
213  int phase;
214  int rc;
215 
216  /*
217  * copying epoch from cm. It will be overwritten if a valid epoch
218  * is found from persistent storage.
219  */
220  store->s_data.d_cm_epoch = cm->cm_epoch;
221 
222  rc = ag_store_init_load(store, &s_data);
223  if (rc == 0 || rc == -ENOENT) {
224  if (rc == 0) {
225  in_out_set(cm, store, s_data);
226  phase = AG_STORE_START;
227  if (cm->cm_reset) {
230  }
231 
232  if (cm->cm_proxy_nr > 0) {
233  /*
234  * Wait until we receive sliding window updates
235  * from all other replicas.
236  */
237  m0_cm_lock(cm);
239  rc = M0_FSO_WAIT;
240  m0_cm_unlock(cm);
241  } else
242  rc = M0_FSO_AGAIN;
243  /* Notify copy machine after reading persistent store. */
244  m0_cm_notify(cm);
245  } else {
246  phase = AG_STORE_INIT_WAIT;
247  rc = M0_FSO_AGAIN;
248  }
249  m0_fom_phase_set(fom, phase);
250  }
251 
252  M0_LOG(M0_DEBUG," rc=%d ag_store_in=["M0_AG_F"] ag_store_out=["M0_AG_F"]",
255  return M0_RC(rc);
256 }
257 
258 static int ag_store_start(struct m0_cm_ag_store *store)
259 {
260  struct m0_cm *cm = store2cm(store);
261 
263  M0_LOG(M0_DEBUG, "cm_sw_last_updated_hi=["M0_AG_F"]",
268 
269  return M0_FSO_AGAIN;
270 }
271 
272 static int ag_store_init_wait(struct m0_cm_ag_store *store)
273 {
274  struct m0_cm *cm = store2cm(store);
275  struct m0_fom *fom = &store->s_fom;
276  struct m0_be_tx *tx = &fom->fo_tx.tx_betx;
277  struct m0_cm_ag_store_data *s_data;
278  int rc;
279 
280  switch (m0_be_tx_state(tx)) {
281  case M0_BTS_FAILED :
282  return tx->t_sm.sm_rc;
283  case M0_BTS_GROUPING :
284  case M0_BTS_OPENING :
285  break;
286  case M0_BTS_ACTIVE :
287  rc = ag_store_alloc(store);
288  if (rc != 0)
289  return M0_RC(rc);
290  break;
291  case M0_BTS_DONE :
292  rc = tx->t_sm.sm_rc;
293  m0_be_tx_fini(tx);
294  if (rc != 0)
295  return M0_RC(rc);
296  rc = ag_store_init_load(store, &s_data);
297  if (rc != 0)
298  return M0_ERR_INFO(rc, "Cannot load ag store, status=%d phase=%d",
299  store->s_status, m0_fom_phase(fom));
300  in_out_set(cm, store, s_data);
302  if (cm->cm_proxy_nr > 0) {
303  m0_cm_lock(cm);
305  m0_cm_unlock(cm);
306  rc = M0_FSO_WAIT;
307  } else
308  rc = M0_FSO_AGAIN;
309 
310  m0_cm_notify(cm);
311  return rc;
312  default :
313  break;
314  }
316  &fom->fo_cb);
317 
318  return M0_FSO_WAIT;
319 }
320 
321 static int ag_store__update(struct m0_cm_ag_store *store)
322 {
323  struct m0_cm *cm = store2cm(store);
325  struct m0_cm_ag_store_data *s_data;
326  struct m0_fom *fom = &store->s_fom;
327  struct m0_be_tx *tx = &fom->fo_tx.tx_betx;
328  int rc;
329 
330  rc = ag_store_init_load(store, &s_data);
331  if (rc != 0)
332  return M0_ERR_INFO(rc, "Cannot load ag store, status=%d phase=%d",
333  store->s_status, m0_fom_phase(fom));
334  if (rc == 0) {
335  s_data->d_in = store->s_data.d_in;
336  s_data->d_out = store->s_data.d_out;
337  s_data->d_cm_epoch = store->s_data.d_cm_epoch;
338  M0_BE_TX_CAPTURE_PTR(seg, tx, s_data);
339  }
340 
341  return M0_RC(rc);
342 }
343 
344 static int ag_store_update(struct m0_cm_ag_store *store)
345 {
346  struct m0_cm *cm = store2cm(store);
347  struct m0_fom *fom = &store->s_fom;
348  struct m0_dtx *tx = &fom->fo_tx;
350  int rc;
351 
352  if (tx->tx_state < M0_DTX_INIT) {
353  M0_SET0(tx);
355  &fom->fo_loc->fl_group);
357  }
358 
359  if (m0_be_tx_state(&tx->tx_betx) == M0_BTS_PREPARE) {
360  m0_dtx_open(tx);
361  return M0_FSO_AGAIN;
362  }
363  else if (M0_IN(m0_be_tx_state(&tx->tx_betx), (M0_BTS_OPENING,
364  M0_BTS_GROUPING))) {
365  m0_fom_wait_on(fom, &tx->tx_betx.t_sm.sm_chan, &fom->fo_cb);
366  return M0_FSO_WAIT;
367  }
368 
369  m0_dtx_opened(tx);
370  m0_cm_lock(cm);
371  rc = ag_store__update(store);
372  m0_cm_unlock(cm);
373  if (rc != 0) {
374  M0_LOG(M0_ERROR, "AG Store update failed: %d", rc);
375  store->s_status = S_FINI;
376  if (rc != -ENOENT)
377  return M0_ERR(rc);
378  }
379  m0_fom_wait_on(fom, &tx->tx_betx.t_sm.sm_chan, &fom->fo_cb);
380  m0_dtx_done(tx);
382 
383  return M0_FSO_WAIT;
384 }
385 
386 static int ag_store_update_wait(struct m0_cm_ag_store *store)
387 {
388  struct m0_fom *fom = &store->s_fom;
389  struct m0_dtx *tx = &fom->fo_tx;
390  int rc = M0_FSO_WAIT;
391 
392  if (tx->tx_state == M0_DTX_DONE) {
393  if (m0_be_tx_state(&tx->tx_betx) != M0_BTS_DONE) {
395  &fom->fo_cb);
396  } else {
397  m0_dtx_fini(tx);
398  M0_SET0(tx);
399  switch (store->s_status) {
400  case S_ACTIVE :
402  rc = M0_FSO_AGAIN;
403  break;
404  case S_COMPLETE :
406  rc = M0_FSO_AGAIN;
407  break;
408  case S_FINI:
410  rc = M0_FSO_WAIT;
411  break;
412  default:
413  M0_IMPOSSIBLE("Invalid status !!");
414  };
415  }
416  }
417 
418  return rc;
419 }
420 
421 static int ag_store_complete(struct m0_cm_ag_store *store)
422 {
423  struct m0_cm *cm = store2cm(store);
424  struct m0_fom *fom = &store->s_fom;
425  struct m0_dtx *tx = &fom->fo_tx;
427  struct m0_cm_ag_store_data *s_data;
428  char ag_store[80];
429  int rc;
430 
431  rc = ag_store_init_load(store, &s_data);
432  if (rc != 0)
433  return M0_ERR_INFO(rc, "Cannot load ag store, status=%d phase=%d",
434  store->s_status, m0_fom_phase(fom));
435 
436  sprintf(ag_store, "ag_store_%llu", (unsigned long long)cm->cm_id);
437  if (tx->tx_state < M0_DTX_INIT) {
438  M0_SET0(tx);
440  &fom->fo_loc->fl_group);
441  M0_BE_FREE_CREDIT_PTR(s_data, seg, &tx->tx_betx_cred);
443  &tx->tx_betx_cred);
444  }
445 
447  m0_dtx_open(tx);
448  if (m0_be_tx_state(&tx->tx_betx) == M0_BTS_FAILED)
449  return M0_RC(tx->tx_betx.t_sm.sm_rc);
450  if (M0_IN(m0_be_tx_state(&tx->tx_betx), (M0_BTS_OPENING,
451  M0_BTS_GROUPING))) {
452  m0_fom_wait_on(fom, &tx->tx_betx.t_sm.sm_chan, &fom->fo_cb);
453  return M0_FSO_WAIT;
454  } else
455  m0_dtx_opened(tx);
456 
457  M0_BE_FREE_PTR_SYNC(s_data, seg, &tx->tx_betx);
458  m0_be_seg_dict_delete(seg, &tx->tx_betx, ag_store);
459  m0_fom_wait_on(fom, &tx->tx_betx.t_sm.sm_chan, &fom->fo_cb);
460  m0_dtx_done(tx);
462  store->s_status = S_FINI;
463 
464  return M0_FSO_WAIT;
465 }
466 
467 static int (*ag_store_action[]) (struct m0_cm_ag_store *store) = {
474 };
475 
476 static uint64_t ag_store_fom_locality(const struct m0_fom *fom)
477 {
478  return fom->fo_type->ft_id;
479 }
480 static int ag_store_fom_tick(struct m0_fom *fom)
481 {
482  struct m0_cm_ag_store *store;
483  int phase = m0_fom_phase(fom);
484  int rc;
485  M0_ENTRY();
486 
487  store = fom2store(fom);
488  rc = ag_store_action[phase](store);
489  if (rc < 0) {
491  rc = M0_FSO_WAIT;
492  }
493 
494  return M0_RC(rc);
495 }
496 
497 static void ag_store_fom_fini(struct m0_fom *fom)
498 {
499  struct m0_cm_ag_store *store = fom2store(fom);
500  struct m0_cm *cm = store2cm(store);
501 
502  m0_fom_fini(fom);
504 }
505 
506 static const struct m0_fom_ops ag_store_update_fom_ops = {
508  .fo_tick = ag_store_fom_tick,
509  .fo_home_locality = ag_store_fom_locality
510 };
511 
512 M0_INTERNAL void m0_cm_ag_store_init(struct m0_cm_type *cmtype)
513 {
514  m0_fom_type_init(&cmtype->ct_ag_store_fomt, cmtype->ct_fom_id + 3,
516  &cmtype->ct_stype, &ag_store_update_conf);
517 }
518 
519 M0_INTERNAL void m0_cm_ag_store_complete(struct m0_cm_ag_store *store)
520 {
521  store->s_status = S_COMPLETE;
522 }
523 
524 M0_INTERNAL void m0_cm_ag_store_fini(struct m0_cm_ag_store *store)
525 {
526  store->s_status = S_FINI;
527 }
528 
529 M0_INTERNAL bool m0_cm_ag_store_is_complete(struct m0_cm_ag_store *store)
530 {
531  return m0_fom_phase(&store->s_fom) == AG_STORE_FINI;
532 }
533 
534 M0_INTERNAL void m0_cm_ag_store_fom_start(struct m0_cm *cm)
535 {
536  struct m0_cm_ag_store *store = &cm->cm_ag_store;
537  struct m0_fom *fom = &store->s_fom;
538 
539  store->s_status = S_ACTIVE;
542  m0_fom_queue(fom);
543 
544  M0_LEAVE();
545 }
546 
547 #undef M0_TRACE_SUBSYSTEM
548 
551 /*
552  * Local variables:
553  * c-indentation-style: "K&R"
554  * c-basic-offset: 8
555  * tab-width: 8
556  * fill-column: 80
557  * scroll-step: 1
558  * End:
559  */
#define M0_BE_ALLOC_CREDIT_PTR(ptr, seg, accum)
Definition: alloc.h:355
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_BE_ALLOC_PTR_SYNC(ptr, seg, tx)
Definition: alloc.h:339
const struct m0_cm_type * cm_type
Definition: cm.h:194
Definition: dtm.h:554
M0_INTERNAL int m0_be_seg_dict_insert(struct m0_be_seg *seg, struct m0_be_tx *tx, const char *name, void *value)
Definition: seg_dict.c:255
uint64_t ft_id
Definition: fom.h:613
#define NULL
Definition: misc.h:38
#define M0_AG_P(ag)
Definition: ag.h:55
static struct m0_sm_state_descr ag_store_update_sd[AG_STORE_NR]
Definition: ag_store.c:70
m0_be_tx_state
Definition: tx.h:214
Definition: sm.h:350
#define M0_LOG(level,...)
Definition: trace.h:167
M0_LEAVE()
struct m0_fom_type ct_ag_store_fomt
Definition: cm.h:156
uint64_t cm_id
Definition: cm.h:174
M0_INTERNAL void m0_be_tx_fini(struct m0_be_tx *tx)
Definition: stubs.c:163
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
M0_INTERNAL void m0_dtx_opened(struct m0_dtx *tx)
Definition: dtm.c:94
struct m0_cm_ag_id d_out
Definition: ag_store.h:46
struct m0_bufvec data
Definition: di.c:40
static struct m0_cm_ag_store * fom2store(struct m0_fom *fom)
Definition: ag_store.c:122
enum m0_cm_ag_store_status s_status
Definition: ag_store.h:53
M0_INTERNAL void m0_be_tx_prep(struct m0_be_tx *tx, const struct m0_be_tx_credit *credit)
Definition: stubs.c:175
#define M0_BE_TX_CAPTURE_PTR(seg, tx, ptr)
Definition: tx.h:505
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
#define container_of(ptr, type, member)
Definition: misc.h:33
#define M0_SET0(obj)
Definition: misc.h:64
#define M0_BE_TX_CREDIT_TYPE(type)
Definition: tx_credit.h:97
m0_fom_phase
Definition: fom.h:372
M0_INTERNAL void m0_cm_sw_update_start(struct m0_cm *cm)
static int ag_store_init(struct m0_cm_ag_store *store)
Definition: ag_store.c:208
const struct m0_fom_type * fo_type
Definition: dump.c:107
M0_INTERNAL void m0_cm_ag_store_fini(struct m0_cm_ag_store *store)
Definition: ag_store.c:524
return M0_RC(rc)
static struct m0_cm * cm
Definition: cm.c:63
M0_INTERNAL void m0_cm_unlock(struct m0_cm *cm)
Definition: cm.c:550
#define M0_ENTRY(...)
Definition: trace.h:170
static const struct m0_fom_type_ops ag_store_update_fom_type_ops
Definition: ag_store.c:67
#define M0_AG_F
Definition: ag.h:54
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
bool cm_reset
Definition: cm.h:271
#define M0_ERR_INFO(rc, fmt,...)
Definition: trace.h:215
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL int m0_be_seg_dict_delete(struct m0_be_seg *seg, struct m0_be_tx *tx, const char *name)
Definition: seg_dict.c:316
static int ag_store__update(struct m0_cm_ag_store *store)
Definition: ag_store.c:321
M0_INTERNAL void m0_dtx_open(struct m0_dtx *tx)
Definition: dtm.c:86
static int ag_store_init_wait(struct m0_cm_ag_store *store)
Definition: ag_store.c:272
void m0_fom_fini(struct m0_fom *fom)
Definition: fom.c:1324
const char * scf_name
Definition: sm.h:352
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
static int ag_store_start(struct m0_cm_ag_store *store)
Definition: ag_store.c:258
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
static int ag_store_update(struct m0_cm_ag_store *store)
Definition: ag_store.c:344
struct m0_be_tx_credit tx_betx_cred
Definition: dtm.h:560
static int ag_store_init_load(struct m0_cm_ag_store *store, struct m0_cm_ag_store_data **data)
Definition: ag_store.c:155
M0_INTERNAL void m0_be_tx_close(struct m0_be_tx *tx)
Definition: stubs.c:194
static int ag_store_fom_tick(struct m0_fom *fom)
Definition: ag_store.c:480
#define M0_POST(cond)
static struct m0_cm * store2cm(struct m0_cm_ag_store *store)
Definition: ag_store.c:117
M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx)
Definition: dtm.c:134
struct m0_cm_ag_id cm_last_out_hi
Definition: cm.h:222
int32_t sm_rc
Definition: sm.h:336
Definition: dump.c:103
M0_INTERNAL void m0_dtx_done(struct m0_dtx *tx)
Definition: dtm.c:115
#define M0_BE_FREE_PTR_SYNC(ptr, seg, tx)
Definition: alloc.h:345
struct m0_sm t_sm
Definition: tx.h:281
Definition: seg.h:66
struct m0_chan cm_complete
Definition: cm.h:238
struct m0_chan cm_proxy_init_wait
Definition: cm.h:240
M0_INTERNAL void m0_chan_signal_lock(struct m0_chan *chan)
Definition: chan.c:165
struct m0_cm_ag_id cm_last_processed_out
Definition: cm.h:224
M0_INTERNAL void m0_be_tx_init(struct m0_be_tx *tx, uint64_t tid, struct m0_be_domain *dom, struct m0_sm_group *sm_group, m0_be_tx_cb_t persistent, m0_be_tx_cb_t discarded, void(*filler)(struct m0_be_tx *tx, void *payload), void *datum)
Definition: stubs.c:150
uint32_t sd_flags
Definition: sm.h:378
Definition: fom.h:481
Definition: cm.h:143
static int ag_store_complete(struct m0_cm_ag_store *store)
Definition: ag_store.c:421
uint64_t cm_proxy_nr
Definition: cm.h:250
M0_INTERNAL void m0_be_seg_dict_delete_credit(struct m0_be_seg *seg, const char *name, struct m0_be_tx_credit *accum)
Definition: seg_dict.c:131
M0_INTERNAL void m0_cm_ag_store_init(struct m0_cm_type *cmtype)
Definition: ag_store.c:512
static void ag_store_fom_fini(struct m0_fom *fom)
Definition: ag_store.c:497
M0_INTERNAL void m0_cm_notify(struct m0_cm *cm)
Definition: cm.c:1081
struct m0_be_tx tx_betx
Definition: dtm.h:559
struct m0_cm_ag_store_data s_data
Definition: ag_store.h:52
static int(* ag_store_action[])(struct m0_cm_ag_store *store)
Definition: ag_store.c:467
static void in_out_set(struct m0_cm *cm, struct m0_cm_ag_store *store, struct m0_cm_ag_store_data *s_data)
Definition: ag_store.c:188
struct m0_chan sm_chan
Definition: sm.h:331
struct m0_reqh_service cm_service
Definition: cm.h:191
M0_INTERNAL void m0_be_tx_open(struct m0_be_tx *tx)
Definition: stubs.c:184
M0_INTERNAL void m0_cm_proxies_init_wait(struct m0_cm *cm, struct m0_fom *fom)
Definition: cm.c:1142
Definition: cm.h:166
M0_INTERNAL bool m0_cm_ag_store_is_complete(struct m0_cm_ag_store *store)
Definition: ag_store.c:529
enum m0_dtx_state tx_state
Definition: dtm.h:558
struct m0_be_seg * rh_beseg
Definition: reqh.h:112
struct m0_reqh_service_type ct_stype
Definition: cm.h:145
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
Definition: fom.c:624
static struct m0_be_seg * seg
Definition: btree.c:40
void(* fo_fini)(struct m0_fom *fom)
Definition: fom.h:657
static int ag_store_update_wait(struct m0_cm_ag_store *store)
Definition: ag_store.c:386
ag_store_update_fom_phase
Definition: ag_store.c:56
void m0_fom_phase_set(struct m0_fom *fom, int phase)
Definition: fom.c:1688
M0_INTERNAL void m0_cm_ag_store_complete(struct m0_cm_ag_store *store)
Definition: ag_store.c:519
struct m0_fom s_fom
Definition: ag_store.h:51
M0_INTERNAL void m0_be_seg_dict_insert_credit(struct m0_be_seg *seg, const char *name, struct m0_be_tx_credit *accum)
Definition: seg_dict.c:114
struct m0_reqh * rs_reqh
Definition: reqh_service.h:259
static uint64_t ag_store_fom_locality(const struct m0_fom *fom)
Definition: ag_store.c:476
M0_INTERNAL void m0_cm_ag_store_fom_start(struct m0_cm *cm)
Definition: ag_store.c:534
M0_INTERNAL int m0_be_seg_dict_lookup(struct m0_be_seg *seg, const char *name, void **out)
Definition: seg_dict.c:180
static int ag_store_alloc(struct m0_cm_ag_store *store)
Definition: ag_store.c:127
int32_t rc
Definition: trigger_fop.h:47
static const struct m0_fom_ops ag_store_update_fom_ops
Definition: ag_store.c:506
#define ARRAY_SIZE(a)
Definition: misc.h:45
struct m0_cm_ag_id d_in
Definition: ag_store.h:45
m0_time_t d_cm_epoch
Definition: ag_store.h:47
struct m0_sm_conf ag_store_update_conf
Definition: ag_store.c:111
m0_time_t cm_epoch
Definition: cm.h:177
#define M0_BE_FREE_CREDIT_PTR(ptr, seg, accum)
Definition: alloc.h:359
struct m0_cm_ag_store cm_ag_store
Definition: cm.h:261
struct m0_cm_ag_id cm_sw_last_updated_hi
Definition: cm.h:220
Definition: tx.h:280
#define M0_IMPOSSIBLE(fmt,...)