Motr  M0
dtm.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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 #pragma once
24 
25 #ifndef __MOTR_DTM_DTM_H__
26 #define __MOTR_DTM_DTM_H__
27 
28 #include "lib/types.h" /* m0_uint128 */
29 
30 #include "fol/fol.h"
31 #include "dtm/history.h"
32 #include "dtm/nucleus.h"
33 #include "dtm/catalogue.h"
34 #include "dtm/fol.h"
35 #include "be/tx.h" /* m0_be_tx */
36 
504 /* import */
505 struct m0_dtm_history_type;
506 struct m0_dtm0_dtx;
507 
508 /* export */
509 struct m0_dtm;
510 struct m0_dtx;
511 
512 enum {
517 };
518 
529 struct m0_dtm {
533  struct m0_dtm_nu d_nu;
540  struct m0_uint128 d_id;
543  struct m0_tl d_excited;
545 };
546 
552 };
553 
554 struct m0_dtx {
562  /* It is the real dtx here (at least on the originator side). */
564 };
565 
566 M0_INTERNAL void m0_dtx_init(struct m0_dtx *tx,
567  struct m0_be_domain *be_domain,
568  struct m0_sm_group *sm_group);
569 M0_INTERNAL void m0_dtx_prep(struct m0_dtx *tx,
570  const struct m0_be_tx_credit *cred);
571 M0_INTERNAL void m0_dtx_open(struct m0_dtx *tx);
572 M0_INTERNAL void m0_dtx_done(struct m0_dtx *tx);
573 M0_INTERNAL int m0_dtx_open_sync(struct m0_dtx *tx);
574 M0_INTERNAL int m0_dtx_done_sync(struct m0_dtx *tx);
575 M0_INTERNAL void m0_dtx_opened(struct m0_dtx *tx);
576 M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx);
577 M0_INTERNAL int m0_dtx_fol_add(struct m0_dtx *tx);
578 
579 M0_INTERNAL void m0_dtm_init(struct m0_dtm *dtm, struct m0_uint128 *id);
580 M0_INTERNAL void m0_dtm_fini(struct m0_dtm *dtm);
581 
582 M0_INTERNAL int m0_dtm_global_init(void);
583 M0_INTERNAL void m0_dtm_global_fini(void);
584 
586 #endif /* __MOTR_DTM_DTM_H__ */
587 
588 /*
589  * Local variables:
590  * c-indentation-style: "K&R"
591  * c-basic-offset: 8
592  * tab-width: 8
593  * fill-column: 80
594  * scroll-step: 1
595  * End:
596  */
struct m0_dtm0_dtx * tx_dtx
Definition: dtm.h:563
Definition: dtm.h:554
M0_INTERNAL void m0_dtm_fini(struct m0_dtm *dtm)
Definition: dtm.c:54
M0_INTERNAL int m0_dtm_global_init(void)
Definition: dtm.c:142
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_dtm_catalogue d_cat[M0_DTM_HISTORY_TYPE_NR]
Definition: dtm.h:541
M0_INTERNAL int m0_dtx_done_sync(struct m0_dtx *tx)
Definition: dtm.c:122
struct m0_dtm_fol d_fol
Definition: dtm.h:542
M0_INTERNAL int m0_dtx_fol_add(struct m0_dtx *tx)
Definition: dtm.c:169
M0_INTERNAL void m0_dtx_open(struct m0_dtx *tx)
Definition: dtm.c:86
struct m0_uint128 d_id
Definition: dtm.h:540
Definition: tlist.h:251
struct m0_dtm_nu d_nu
Definition: dtm.h:533
struct m0_be_tx_credit tx_betx_cred
Definition: dtm.h:560
Definition: fol.h:44
M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx)
Definition: dtm.c:134
const struct m0_dtm_history_type * d_htype[M0_DTM_HISTORY_TYPE_NR]
Definition: dtm.h:544
struct m0_fol_rec tx_fol_rec
Definition: dtm.h:561
M0_INTERNAL void m0_dtx_done(struct m0_dtx *tx)
Definition: dtm.c:115
struct m0_tl d_excited
Definition: dtm.h:543
M0_INTERNAL void m0_dtm_init(struct m0_dtm *dtm, struct m0_uint128 *id)
Definition: dtm.c:41
M0_INTERNAL void m0_dtm_global_fini(void)
Definition: dtm.c:148
struct m0_be_tx tx_betx
Definition: dtm.h:559
m0_dtx_state
Definition: dtm.h:547
enum m0_dtx_state tx_state
Definition: dtm.h:558
M0_INTERNAL int m0_dtx_open_sync(struct m0_dtx *tx)
Definition: dtm.c:101
Definition: dtm.h:529
M0_INTERNAL void m0_dtx_prep(struct m0_dtx *tx, const struct m0_be_tx_credit *cred)
Definition: dtm.c:80
Definition: tx.h:280