Motr  M0
fom_generic.h
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 #pragma once
24 
25 #ifndef __MOTR_FOP_FOM_GENERIC_H__
26 #define __MOTR_FOP_FOM_GENERIC_H__
27 
28 #include "fop/fom.h"
29 #include "lib/types.h"
30 #include "xcode/xcode_attr.h"
31 #include "lib/string.h"
32 #include "lib/string_xc.h"
33 #include "be/tx.h"
34 #include "be/tx_xc.h"
35 
36 struct m0_rpc_item;
37 
42 #define FOM_PHASE_STATS_DATA_SZ(nr) (M0_FOM_STATS_CNTR_DATA * (nr))
43 
56  M0_FOPH_INIT = M0_FOM_PHASE_INIT, /*< fom has been initialised. */
57  M0_FOPH_FINISH = M0_FOM_PHASE_FINISH, /*< terminal phase. */
58  M0_FOPH_AUTHENTICATE, /*< authentication loop is in progress. */
59  M0_FOPH_AUTHENTICATE_WAIT, /*< waiting for key cache miss. */
60  M0_FOPH_RESOURCE_LOCAL, /*< local resource reservation loop is in
61  progress. */
62  M0_FOPH_RESOURCE_LOCAL_WAIT, /*< waiting for a local resource. */
63  M0_FOPH_RESOURCE_DISTRIBUTED,/*< distributed resource reservation loop
64  is in progress. */
65  M0_FOPH_RESOURCE_DISTRIBUTED_WAIT, /*< waiting for a distributed
66  resource. */
67  M0_FOPH_OBJECT_CHECK, /*< object checking loop is in progress. */
68  M0_FOPH_OBJECT_CHECK_WAIT, /*< waiting for object cache miss. */
69  M0_FOPH_AUTHORISATION, /*< authorisation loop is in progress. */
70  M0_FOPH_AUTHORISATION_WAIT, /*< waiting for userdb cache miss. */
71  M0_FOPH_TXN_INIT, /*< init local transactional context. */
72  M0_FOPH_TXN_OPEN, /*< open local transactional context. */
73  M0_FOPH_TXN_WAIT, /*< waiting for log space. */
74  M0_FOPH_SUCCESS, /*< fom execution completed successfully. */
75  M0_FOPH_FOL_REC_ADD, /*< add a FOL transaction record. */
76  M0_FOPH_TXN_COMMIT, /*< commit local transaction context. */
77  M0_FOPH_QUEUE_REPLY, /*< queuing fop reply. */
78  M0_FOPH_QUEUE_REPLY_WAIT, /*< waiting for fop cache space. */
79  M0_FOPH_TXN_LOGGED_WAIT, /*< waiting for local transaction to become
80  logged. */
81  M0_FOPH_TXN_DONE_WAIT, /*< waiting for local transaction to become
82  done. */
83  M0_FOPH_TIMEOUT, /*< fom timed out. */
84  M0_FOPH_FAILURE, /*< fom execution failed. */
85  M0_FOPH_NR, /*< number of standard phases. fom type
86  specific phases have numbers larger than
87  this. */
88  M0_FOPH_TYPE_SPECIFIC /*< used when only single specific phase
89  present in FOM. */
90 };
91 
209 int m0_fom_tick_generic(struct m0_fom *fom);
210 
211 M0_INTERNAL void m0_fom_generic_fini(void);
212 M0_INTERNAL int m0_fom_generic_init(void);
214 enum {
216 };
217 
218 extern struct m0_sm_trans_descr
220 extern const struct m0_sm_conf m0_generic_conf;
221 
230  int32_t gr_rc;
232 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
233 
235 
237 
244 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
245 
246 M0_INTERNAL void m0_fom_mod_rep_fill(struct m0_fop_mod_rep *rep,
247  struct m0_fom *fom);
248 
254 int32_t m0_rpc_item_generic_reply_rc(const struct m0_rpc_item *item);
255 
256 M0_INTERNAL int m0_fom_tx_done_wait(struct m0_fom *fom);
257 
260 /* __MOTR_FOP_FOM_GENERIC_H__ */
261 #endif
262 
263 /*
264  * Local variables:
265  * c-indentation-style: "K&R"
266  * c-basic-offset: 8
267  * tab-width: 8
268  * fill-column: 80
269  * scroll-step: 1
270  * End:
271  */
bool m0_rpc_item_is_generic_reply_fop(const struct m0_rpc_item *item)
Definition: fom_generic.c:75
Definition: sm.h:350
M0_INTERNAL void m0_fom_generic_fini(void)
Definition: fom_generic.c:53
m0_fom_standard_phase
Definition: fom_generic.h:55
struct m0_fop_generic_reply M0_XCA_DOMAIN(rpc)
const struct m0_sm_conf m0_generic_conf
Definition: fom_generic.c:838
static struct m0_rpc_item * item
Definition: item.c:56
struct m0_fop_getxattr_rep * rep
Definition: dir.c:455
int32_t m0_rpc_item_generic_reply_rc(const struct m0_rpc_item *item)
Definition: fom_generic.c:81
int m0_fom_tick_generic(struct m0_fom *fom)
Definition: fom_generic.c:848
M0_INTERNAL void m0_fom_mod_rep_fill(struct m0_fop_mod_rep *rep, struct m0_fom *fom)
Definition: fom_generic.c:68
M0_INTERNAL int m0_fom_tx_done_wait(struct m0_fom *fom)
Definition: fom_generic.c:490
M0_INTERNAL int m0_fom_generic_init(void)
Definition: fom_generic.c:58
Definition: dump.c:103
struct m0_fop_str gr_msg
Definition: fom_generic.h:231
struct m0_fop_type m0_fop_generic_reply_fopt
Definition: fom_generic.c:50
Definition: fom.h:481
struct m0_sm_trans_descr m0_generic_phases_trans[M0_FOM_GENERIC_TRANS_NR]
Definition: fom_generic.c:765
struct m0_be_tx_remid fmr_remid
Definition: fom_generic.h:243