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
43
enum
m0_module_id
{
44
M0_MODULE_NET
,
45
M0_MODULE_UT
,
46
M0_MODULE_ADDB2
,
47
M0_MODULE_LOCALITY
,
48
M0_MODULE_HA
,
49
M0_MODULE_PROCESSOR
,
50
M0_MODULE_POOL
,
51
M0_MODULE_ISC
,
52
/* XXX ... more to come ... */
53
M0_MODULE_NR
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
*/
94
void
*
i_moddata
[
M0_MODULE_NR
];
99
struct
m0_inst_lockers
i_lockers
;
105
struct
m0_tl
i_param_sources
;
106
107
struct
m0_ha_module
*
i_ha_module
;
108
struct
m0_ha
*
i_ha
;
109
/* * Link to the HA. It's used in Motr code. */
110
struct
m0_ha_link
*
i_ha_link
;
111
struct
m0_ha_note_handler
*
i_note_handler
;
112
struct
m0_ha_fvec_handler
*
i_fvec_handler
;
113
114
/*
115
* XXX TODO: Get rid of the fields below. Use ->i_moddata[] or
116
* ->i_lockers.
117
*/
118
struct
m0_fdmi_module
i_fdmi_module
;
119
struct
m0_stob_module
i_stob_module
;
120
struct
m0_stob_ad_module
i_stob_ad_module
;
121
struct
m0_ut_stob_module
i_ut_stob_module
;
122
struct
m0_poolmach_state
*
i_pool_module
;
123
struct
m0_storage_devs
i_storage_devs
;
131
bool
i_storage_is_fake
;
132
bool
i_reqh_uses_ad_stob
;
133
bool
i_disable_addb2_storage
;
135
unsigned
i_ios_cdom_key
;
137
unsigned
i_mds_cdom_key
;
139
unsigned
i_actrec_dom_key
;
141
unsigned
i_dtm0_log_key
;
143
struct
m0_proc_attr
i_proc_attr
;
144
};
145
161
M0_INTERNAL
struct
m0
*
m0_get
(
void
);
162
168
M0_INTERNAL
void
m0_set
(
struct
m0
*
instance
);
169
171
enum
{
177
M0_LEVEL_INST_PREPARE
,
181
M0_LEVEL_INST_QUIESCE_SYSTEM
,
182
M0_LEVEL_INST_ONCE
,
183
/*
184
* XXX DELETEME after the removal of m0_init() function and
185
* subsystem[] array in motr/init.c file.
186
*/
187
M0_LEVEL_INST_SUBSYSTEMS
,
195
M0_LEVEL_INST_READY
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__ */
M0_MODULE_HA
Definition:
instance.h:48
m0_ut_stob_module
Definition:
stob.h:48
M0_MODULE_NET
Definition:
instance.h:44
m0::i_stob_ad_module
struct m0_stob_ad_module i_stob_ad_module
Definition:
instance.h:120
M0_MODULE_PROCESSOR
Definition:
instance.h:49
m0::i_ut_stob_module
struct m0_ut_stob_module i_ut_stob_module
Definition:
instance.h:121
m0_stob_module
Definition:
module.h:42
m0_set
M0_INTERNAL void m0_set(struct m0 *instance)
Definition:
instance.c:48
storage_dev.h
process_attr.h
m0::i_ha
struct m0_ha * i_ha
Definition:
instance.h:108
M0_LEVEL_INST_PREPARE
Definition:
instance.h:177
m0::i_actrec_dom_key
unsigned i_actrec_dom_key
Definition:
instance.h:139
M0_MODULE_UT
Definition:
instance.h:45
M0_LEVEL_INST_SUBSYSTEMS
Definition:
instance.h:187
m0_instance_setup
M0_INTERNAL void m0_instance_setup(struct m0 *instance)
Definition:
instance.c:110
m0::i_fvec_handler
struct m0_ha_fvec_handler * i_fvec_handler
Definition:
instance.h:112
m0::i_ios_cdom_key
unsigned i_ios_cdom_key
Definition:
instance.h:135
m0_get
M0_INTERNAL struct m0 * m0_get(void)
Definition:
instance.c:41
m0::i_dtm0_log_key
unsigned i_dtm0_log_key
Definition:
instance.h:141
M0_MODULE_NR
Definition:
instance.h:53
m0_poolmach_state
Definition:
pool_machine.h:100
module.h
M0_LEVEL_INST_READY
Definition:
instance.h:195
m0::i_storage_devs
struct m0_storage_devs i_storage_devs
Definition:
instance.h:123
m0::i_pool_module
struct m0_poolmach_state * i_pool_module
Definition:
instance.h:122
m0::i_storage_is_fake
bool i_storage_is_fake
Definition:
instance.h:131
M0_MODULE_ADDB2
Definition:
instance.h:46
m0::i_ha_module
struct m0_ha_module * i_ha_module
Definition:
instance.h:107
m0::i_disable_addb2_storage
bool i_disable_addb2_storage
Definition:
instance.h:133
m0::i_fdmi_module
struct m0_fdmi_module i_fdmi_module
Definition:
instance.h:118
m0_fdmi_module
Definition:
module.h:62
m0::i_reqh_uses_ad_stob
bool i_reqh_uses_ad_stob
Definition:
instance.h:132
m0_module
Definition:
module.h:151
M0_LEVEL_INST_QUIESCE_SYSTEM
Definition:
instance.h:181
m0_tl
Definition:
tlist.h:251
module.h
module.h
m0::i_mds_cdom_key
unsigned i_mds_cdom_key
Definition:
instance.h:137
m0
Definition:
instance.h:80
m0_ha_module
Definition:
ha.c:70
m0::i_lockers
struct m0_inst_lockers i_lockers
Definition:
instance.h:99
m0_stob_ad_module
Definition:
module.h:49
M0_LEVEL_INST_ONCE
Definition:
instance.h:182
m0_ha_note_handler
Definition:
note.h:391
m0_ha
Definition:
ha.h:289
m0::i_ha_link
struct m0_ha_link * i_ha_link
Definition:
instance.h:110
m0_ha_fvec_handler
Definition:
failvec.h:59
m0_ha_link
Definition:
link.h:186
M0_MODULE_POOL
Definition:
instance.h:50
bitmap.h
m0_proc_attr
Definition:
process_attr.h:52
stob.h
M0_MODULE_ISC
Definition:
instance.h:51
m0::i_moddata
void * i_moddata[M0_MODULE_NR]
Definition:
instance.h:94
M0_MODULE_LOCALITY
Definition:
instance.h:47
m0_storage_devs
Definition:
storage_dev.h:126
m0_module_id
m0_module_id
Definition:
instance.h:43
m0::i_stob_module
struct m0_stob_module i_stob_module
Definition:
instance.h:119
instance
static struct m0 instance
Definition:
main.c:78
M0_LOCKERS__DECLARE
M0_LOCKERS__DECLARE(M0_INTERNAL, m0_inst, m0, 16)
m0::i_proc_attr
struct m0_proc_attr i_proc_attr
Definition:
instance.h:143
m0::i_note_handler
struct m0_ha_note_handler * i_note_handler
Definition:
instance.h:111
m0::i_dep_gen
uint64_t i_dep_gen
Definition:
instance.h:86
m0::i_self
struct m0_module i_self
Definition:
instance.h:88
m0::i_param_sources
struct m0_tl i_param_sources
Definition:
instance.h:105
lockers.h
m0_be_domain
Definition:
domain.h:133
module
instance.h
Generated on Thu Apr 14 2022 14:02:57 for Motr by
1.8.14