Motr
M0
realm.c
Go to the documentation of this file.
1
/* -*- C -*- */
2
/*
3
* Copyright (c) 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
#include "
motr/client.h
"
24
#include "
motr/addb.h
"
25
#include "
motr/client_internal.h
"
26
27
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT
28
#include "
lib/trace.h
"
/* M0_LOG */
29
#include "
fid/fid.h
"
/* m0_fid */
30
31
void
m0_container_init
(
struct
m0_container
*con,
32
struct
m0_realm
*parent,
33
const
struct
m0_uint128
*
id
,
34
struct
m0_client
*
instance
)
35
{
36
M0_PRE
(con !=
NULL
);
37
M0_PRE
(
id
!=
NULL
);
38
M0_PRE
(
instance
!=
NULL
);
39
40
if
(
m0_uint128_cmp
(&
M0_UBER_REALM
,
id
) == 0) {
41
/* This should be an init/open cycle for the uber realm */
42
M0_ASSERT
(parent ==
NULL
);
43
44
con->
co_realm
.
re_entity
.
en_id
= *
id
;
45
con->
co_realm
.
re_entity
.
en_type
=
M0_ET_REALM
;
46
con->
co_realm
.
re_entity
.
en_realm
= &con->
co_realm
;
47
con->
co_realm
.
re_instance
=
instance
;
48
con->
co_realm
.
re_entity
.
en_sm
.
sm_rc
= 0;
49
}
else
50
M0_ASSERT_INFO
(0,
"Feature not implemented"
);
51
}
52
M0_EXPORTED(
m0_container_init
);
53
54
#undef M0_TRACE_SUBSYSTEM
55
56
/*
57
* Local variables:
58
* c-indentation-style: "K&R"
59
60
* c-basic-offset: 8
61
* tab-width: 8
62
* fill-column: 80
63
* scroll-step: 1
64
* End:
65
*/
66
/*
67
* vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
68
*/
m0_uint128_cmp
M0_INTERNAL int m0_uint128_cmp(const struct m0_uint128 *u0, const struct m0_uint128 *u1)
Definition:
misc.c:45
m0_realm
Definition:
client.h:870
id
uint64_t id
Definition:
cob.h:2380
M0_PRE
#define M0_PRE(cond)
fid.h
trace.h
NULL
#define NULL
Definition:
misc.h:38
client_internal.h
M0_UBER_REALM
const struct m0_uint128 M0_UBER_REALM
Definition:
client.c:85
M0_ET_REALM
Definition:
client.h:586
m0_container::co_realm
struct m0_realm co_realm
Definition:
client.h:881
addb.h
m0_realm::re_entity
struct m0_entity re_entity
Definition:
client.h:871
M0_ASSERT
#define M0_ASSERT(cond)
m0_client
Definition:
client_internal.h:525
m0_uint128
Definition:
types.h:35
client.h
m0_sm::sm_rc
int32_t sm_rc
Definition:
sm.h:336
m0_entity::en_id
struct m0_uint128 en_id
Definition:
client.h:708
m0_entity::en_realm
struct m0_realm * en_realm
Definition:
client.h:710
m0_container
Definition:
client.h:880
instance
static struct m0 instance
Definition:
main.c:78
M0_ASSERT_INFO
#define M0_ASSERT_INFO(cond, fmt,...)
m0_container_init
void m0_container_init(struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
Definition:
realm.c:31
m0_realm::re_instance
struct m0_client * re_instance
Definition:
client.h:873
m0_entity::en_sm
struct m0_sm en_sm
Definition:
client.h:732
m0_entity::en_type
enum m0_entity_type en_type
Definition:
client.h:706
motr
realm.c
Generated on Thu Apr 14 2022 14:02:58 for Motr by
1.8.14