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 
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;
46  con->co_realm.re_entity.en_realm = &con->co_realm;
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_INTERNAL int m0_uint128_cmp(const struct m0_uint128 *u0, const struct m0_uint128 *u1)
Definition: misc.c:45
uint64_t id
Definition: cob.h:2380
#define M0_PRE(cond)
#define NULL
Definition: misc.h:38
const struct m0_uint128 M0_UBER_REALM
Definition: client.c:85
struct m0_realm co_realm
Definition: client.h:881
struct m0_entity re_entity
Definition: client.h:871
#define M0_ASSERT(cond)
int32_t sm_rc
Definition: sm.h:336
struct m0_uint128 en_id
Definition: client.h:708
struct m0_realm * en_realm
Definition: client.h:710
static struct m0 instance
Definition: main.c:78
#define M0_ASSERT_INFO(cond, fmt,...)
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
struct m0_client * re_instance
Definition: client.h:873
struct m0_sm en_sm
Definition: client.h:732
enum m0_entity_type en_type
Definition: client.h:706