Motr  M0
kuuid.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2015-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 
30 #include <linux/moduleparam.h> /* module_param */
31 
32 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_LIB
33 #include "lib/trace.h"
34 #include "lib/uuid.h"
35 
36 static char *node_uuid = "00000000-0000-0000-0000-000000000000"; /* nil UUID */
37 module_param(node_uuid, charp, S_IRUGO);
38 MODULE_PARM_DESC(node_uuid, "UUID of Motr node");
39 
43 static const char *m0_param_node_uuid_get(void)
44 {
45  return node_uuid;
46 }
47 
52 {
53  const char *s;
54 
56  if (s == NULL)
57  return M0_ERR(-EINVAL);
58  strncpy(buf, s, M0_UUID_STRLEN);
59  buf[M0_UUID_STRLEN] = '\0';
60  return 0;
61 }
62 
63 #undef M0_TRACE_SUBSYSTEM
64 
67 /*
68  * Local variables:
69  * c-indentation-style: "K&R"
70  * c-basic-offset: 8
71  * tab-width: 8
72  * fill-column: 80
73  * scroll-step: 1
74  * End:
75  */
76 /*
77  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
78  */
static const char * m0_param_node_uuid_get(void)
Definition: kuuid.c:43
#define NULL
Definition: misc.h:38
module_param(node_uuid, charp, S_IRUGO)
Definition: sock.c:887
return M0_ERR(-EOPNOTSUPP)
static char * node_uuid
Definition: kuuid.c:36
int m0_node_uuid_string_get(char buf[M0_UUID_STRLEN+1])
Definition: kuuid.c:51
MODULE_PARM_DESC(node_uuid, "UUID of Motr node")
static struct m0_addb2_source * s
Definition: consumer.c:39