Motr  M0
instance.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 #pragma once
22 #ifndef __MOTR_MODULE_INSTANCE_H__
23 #define __MOTR_MODULE_INSTANCE_H__
24 
25 #include "module/module.h" /* m0_module */
26 #include "lib/bitmap.h" /* m0_bitmap */
27 #include "lib/lockers.h" /* M0_LOCKERS__DECLARE */
28 #include "stob/module.h" /* m0_stob_module */
29 #include "fdmi/module.h" /* m0_fdmi_module */
30 #include "ioservice/storage_dev.h" /* m0_storage_devs */
31 #include "ut/stob.h" /* m0_ut_stob_module */
32 #include "motr/process_attr.h" /* m0_proc_attr */
33 
34 struct m0_be_domain;
35 
52  /* XXX ... more to come ... */
54 };
55 
56 /* XXX TODO: s/inst/instance/ */
57 M0_LOCKERS__DECLARE(M0_INTERNAL, m0_inst, m0, 16);
58 
59 struct m0_ha;
60 struct m0_ha_module;
61 struct m0_ha_note_handler;
62 
80 struct m0 {
86  uint64_t i_dep_gen;
88  struct m0_module i_self;
89  /* *
90  * Module-specific data (e.g. addresses) of standard modules.
91  *
92  * @see m0_module_id
93  */
99  struct m0_inst_lockers i_lockers;
106 
108  struct m0_ha *i_ha;
109  /* * Link to the HA. It's used in Motr code. */
113 
114  /*
115  * XXX TODO: Get rid of the fields below. Use ->i_moddata[] or
116  * ->i_lockers.
117  */
135  unsigned i_ios_cdom_key;
137  unsigned i_mds_cdom_key;
141  unsigned i_dtm0_log_key;
144 };
145 
161 M0_INTERNAL struct m0 *m0_get(void);
162 
168 M0_INTERNAL void m0_set(struct m0 *instance);
169 
171 enum {
183  /*
184  * XXX DELETEME after the removal of m0_init() function and
185  * subsystem[] array in motr/init.c file.
186  */
196 };
197 
198 /*
199  * m0
200  * +------------------------------+
201  * | M0_LEVEL_INST_READY |
202  * +------------------------------+
203  * | M0_LEVEL_INST_SUBSYSTEMS |
204  * +------------------------------+
205  * | M0_LEVEL_INST_ONCE |
206  * +------------------------------+
207  * | M0_LEVEL_INST_QUIESCE_SYSTEM |
208  * +------------------------------+
209  * | M0_LEVEL_INST_PREPARE |
210  * +------------------------------+
211  */
212 M0_INTERNAL void m0_instance_setup(struct m0 *instance);
213 
214 
216 #endif /* __MOTR_MODULE_INSTANCE_H__ */
struct m0_stob_ad_module i_stob_ad_module
Definition: instance.h:120
struct m0_ut_stob_module i_ut_stob_module
Definition: instance.h:121
M0_INTERNAL void m0_set(struct m0 *instance)
Definition: instance.c:48
struct m0_ha * i_ha
Definition: instance.h:108
unsigned i_actrec_dom_key
Definition: instance.h:139
M0_INTERNAL void m0_instance_setup(struct m0 *instance)
Definition: instance.c:110
struct m0_ha_fvec_handler * i_fvec_handler
Definition: instance.h:112
unsigned i_ios_cdom_key
Definition: instance.h:135
M0_INTERNAL struct m0 * m0_get(void)
Definition: instance.c:41
unsigned i_dtm0_log_key
Definition: instance.h:141
struct m0_storage_devs i_storage_devs
Definition: instance.h:123
struct m0_poolmach_state * i_pool_module
Definition: instance.h:122
bool i_storage_is_fake
Definition: instance.h:131
struct m0_ha_module * i_ha_module
Definition: instance.h:107
bool i_disable_addb2_storage
Definition: instance.h:133
struct m0_fdmi_module i_fdmi_module
Definition: instance.h:118
bool i_reqh_uses_ad_stob
Definition: instance.h:132
Definition: tlist.h:251
unsigned i_mds_cdom_key
Definition: instance.h:137
Definition: instance.h:80
struct m0_inst_lockers i_lockers
Definition: instance.h:99
Definition: ha.h:289
struct m0_ha_link * i_ha_link
Definition: instance.h:110
void * i_moddata[M0_MODULE_NR]
Definition: instance.h:94
m0_module_id
Definition: instance.h:43
struct m0_stob_module i_stob_module
Definition: instance.h:119
static struct m0 instance
Definition: main.c:78
M0_LOCKERS__DECLARE(M0_INTERNAL, m0_inst, m0, 16)
struct m0_proc_attr i_proc_attr
Definition: instance.h:143
struct m0_ha_note_handler * i_note_handler
Definition: instance.h:111
uint64_t i_dep_gen
Definition: instance.h:86
struct m0_module i_self
Definition: instance.h:88
struct m0_tl i_param_sources
Definition: instance.h:105