Motr  M0
conf.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_M0D
24 #include "lib/trace.h"
25 
26 #include "lib/errno.h"
27 #include "lib/memory.h"
28 #include "lib/finject.h"
29 #include "lib/string.h" /* m0_strdup */
30 #include "motr/setup.h" /* cs_args */
31 #include "motr/setup_internal.h" /* cs_ad_stob_create */
32 #include "rpc/rpclib.h" /* m0_rpc_client_ctx */
33 #include "conf/obj.h"
34 #include "conf/obj_ops.h" /* M0_CONF_DIRNEXT */
35 #include "conf/confc.h" /* m0_confc */
36 #include "conf/schema.h" /* m0_conf_service_type */
37 #include "conf/dir.h" /* m0_conf_dir_len */
38 #include "conf/diter.h" /* m0_conf_diter_init */
39 #include "conf/helpers.h" /* m0_confc_root_open */
40 #include "reqh/reqh_service.h" /* m0_reqh_service_ctx */
41 #include "stob/linux.h" /* m0_stob_linux_reopen */
42 #include "ioservice/storage_dev.h" /* m0_storage_dev_attach */
43 #include "ioservice/fid_convert.h" /* m0_fid_conf_sdev_device_id */
44 
45 /* ----------------------------------------------------------------
46  * Motr options
47  * ---------------------------------------------------------------- */
48 
49 /* Note: `s' is believed to be heap-allocated. */
50 static void option_add(struct cs_args *args, char *s)
51 {
52  char **argv;
53 
54  M0_PRE(0 <= args->ca_argc && args->ca_argc <= args->ca_argc_max);
55  if (args->ca_argc == args->ca_argc_max) {
56  args->ca_argc_max = args->ca_argc_max == 0 ? 64 :
57  args->ca_argc_max * 2;
58  argv = m0_alloc(sizeof(args->ca_argv[0]) * args->ca_argc_max);
59  if (args->ca_argv != NULL) {
60  memcpy(argv, args->ca_argv,
61  sizeof(args->ca_argv[0]) * args->ca_argc);
62  m0_free(args->ca_argv);
63  }
64  args->ca_argv = argv;
65  }
66  args->ca_argv[args->ca_argc++] = s;
67  M0_LOG(M0_DEBUG, "%02d %s", args->ca_argc, s);
68 }
69 
70 static char *
71 strxdup(const char *addr)
72 {
73  char *s;
74 
75  s = m0_alloc(strlen(addr) + strlen(M0_NET_XPRT_PREFIX_DEFAULT) +
76  strlen(":") + 1);
77  if (s != NULL)
78  sprintf(s, "%s:%s", M0_NET_XPRT_PREFIX_DEFAULT, addr);
79 
80  return s;
81 }
82 
83 static void
85 {
86  static const char *opts[] = {
87  [M0_CST_MDS] = "-G",
88  [M0_CST_IOS] = "-i",
89  [M0_CST_CONFD] = "",
90  [M0_CST_RMS] = "",
91  [M0_CST_STATS] = "-R",
92  [M0_CST_HA] = "",
93  [M0_CST_SSS] = "",
94  [M0_CST_SNS_REP] = "",
95  [M0_CST_SNS_REB] = "",
96  [M0_CST_ADDB2] = "",
97  [M0_CST_CAS] = "",
98  [M0_CST_DIX_REP] = "",
99  [M0_CST_DIX_REB] = "",
100  [M0_CST_DS1] = "",
101  [M0_CST_DS2] = "",
102  [M0_CST_FIS] = "",
103  [M0_CST_FDMI] = "",
104  [M0_CST_BE] = "",
105  [M0_CST_M0T1FS] = "",
106  [M0_CST_CLIENT] = "",
107  [M0_CST_ISCS] = "",
108  [M0_CST_DTM0] = "",
109  };
110  int i;
111  const char *opt;
112 
113  if (svc->cs_endpoints == NULL)
114  return;
115 
116  for (i = 0; svc->cs_endpoints[i] != NULL; ++i) {
117  if (!IS_IN_ARRAY(svc->cs_type, opts)) {
118  M0_LOG(M0_ERROR, "invalid service type %d, ignoring",
119  svc->cs_type);
120  break;
121  }
122  opt = opts[svc->cs_type];
123  if (opt == NULL)
124  continue;
125  option_add(args, m0_strdup(opt));
126  option_add(args, strxdup(svc->cs_endpoints[i]));
127  }
128 }
129 
130 M0_UNUSED static void
132 {
139 /*
140  char buf[64] = {0};
141 
142  option_add(args, m0_strdup("-m"));
143  (void)snprintf(buf, ARRAY_SIZE(buf) - 1, "%u", node->cn_memsize);
144  option_add(args, m0_strdup(buf));
145 
146  option_add(args, m0_strdup("-q"));
147  (void)snprintf(buf, ARRAY_SIZE(buf) - 1, "%lu", node->cn_flags);
148  option_add(args, m0_strdup(buf));
149 */
150 }
151 
152 static bool service_and_node(const struct m0_conf_obj *obj)
153 {
156 }
157 
158 M0_INTERNAL int
160 {
161  struct m0_confc *confc;
162  struct m0_conf_diter it;
163  int rc;
164 
165  M0_ENTRY();
166 
168  M0_ASSERT(confc != NULL);
169 
171  M0_CONF_ROOT_NODES_FID,
172  M0_CONF_NODE_PROCESSES_FID,
173  M0_CONF_PROCESS_SERVICES_FID);
174  if (rc != 0)
175  return M0_ERR(rc);
176 
177  option_add(dest, m0_strdup("m0d")); /* XXX Does the value matter? */
179  M0_CONF_DIRNEXT) {
182  struct m0_conf_service *svc =
185  } else if(m0_conf_obj_type(obj) == &M0_CONF_NODE_TYPE) {
186  struct m0_conf_node *node =
189  }
190  }
192  return M0_RC(rc);
193 }
194 
195 static bool is_local_service(const struct m0_conf_obj *obj)
196 {
197  const struct m0_conf_service *svc;
198  const struct m0_conf_process *proc;
200  const struct m0_fid *proc_fid = &cctx->cc_reqh_ctx.rc_fid;
201  const char *local_ep;
202 
204  return false;
206  proc = M0_CONF_CAST(m0_conf_obj_grandparent(&svc->cs_obj),
209  M0_LOG(M0_DEBUG, "local_ep=%s pc_endpoint=%s type=%d process="FID_F
210  " service=" FID_F, local_ep, proc->pc_endpoint, svc->cs_type,
211  FID_P(&proc->pc_obj.co_id), FID_P(&svc->cs_obj.co_id));
212  /*
213  * It is expected for subordinate m0d service to have endpoint equal to
214  * respective process' endpoint.
215  */
216  M0_ASSERT_INFO(cctx->cc_mkfs || /* ignore mkfs run */
217  !m0_fid_eq(&proc->pc_obj.co_id, proc_fid) ||
218  m0_streq(local_ep, svc->cs_endpoints[0]),
219  "process=" FID_F " process_fid=" FID_F
220  " local_ep=%s pc_endpoint=%s cs_endpoints[0]=%s",
222  proc->pc_endpoint, svc->cs_endpoints[0]);
223  return m0_fid_eq(&proc->pc_obj.co_id, proc_fid) &&
224  /*
225  * Comparing fids is not enough, since two different processes
226  * (e.g., m0mkfs and m0d) may have the same fid but different
227  * endpoints.
228  *
229  * Start CAS in mkfs mode to create meta indices for DIX. See
230  * MOTR-2793.
231  */
232  (m0_streq(proc->pc_endpoint, local_ep) ||
233  (cctx->cc_mkfs && svc->cs_type == M0_CST_CAS));
234 }
235 
236 static bool is_ios(const struct m0_conf_obj *obj)
237 {
239  M0_CONF_CAST(obj, m0_conf_service)->cs_type == M0_CST_IOS;
240 }
241 
242 static bool is_local_ios(const struct m0_conf_obj *obj)
243 {
244  return is_ios(obj) && is_local_service(obj);
245 }
246 
247 static bool is_device(const struct m0_conf_obj *obj)
248 {
250 }
251 
252 static int cs_conf_storage_attach_by_srv(struct cs_stobs *cs_stob,
253  struct m0_storage_devs *devs,
254  struct m0_fid *svc_fid,
255  struct m0_confc *confc,
256  bool force)
257 {
258  struct m0_storage_dev *dev;
259  struct m0_conf_obj *svc_obj;
260  struct m0_conf_sdev *sdev;
261  struct m0_stob *stob;
262  int rc;
263 
264  M0_ENTRY();
265 
266  if (svc_fid == NULL)
267  return 0;
268 
269  rc = m0_confc_open_by_fid_sync(confc, svc_fid, &svc_obj);
270  if (rc == 0) {
271  struct m0_conf_diter it;
272  struct m0_conf_service *svc = M0_CONF_CAST(svc_obj,
274  uint32_t dev_nr;
275  struct m0_ha_note *note;
276  uint32_t fail_devs = 0;
277 
278  /*
279  * Total number of devices under service is used to allocate
280  * note vector and notifications are sent only for devices
281  * which are failed with -ENOENT during attach.
282  */
283  dev_nr = m0_conf_dir_len(svc->cs_sdevs);
284  M0_ASSERT(dev_nr != 0);
285  M0_ALLOC_ARR(note, dev_nr);
286  if (note == NULL) {
287  m0_confc_close(svc_obj);
288  return M0_ERR(-ENOMEM);
289  }
290  rc = m0_conf_diter_init(&it, confc, svc_obj,
291  M0_CONF_SERVICE_SDEVS_FID);
292  if (rc != 0) {
293  m0_free(note);
294  m0_confc_close(svc_obj);
295  return M0_ERR(rc);
296  }
297 
298  while ((rc = m0_conf_diter_next_sync(&it, is_device)) ==
299  M0_CONF_DIRNEXT) {
301  m0_conf_sdev);
303  "sdev " FID_F " device index: %d "
304  "sdev.sd_filename: %s, "
305  "sdev.sd_size: %" PRIu64,
306  FID_P(&sdev->sd_obj.co_id), sdev->sd_dev_idx,
307  sdev->sd_filename, sdev->sd_size);
308 
310  if (sdev->sd_obj.co_ha_state == M0_NC_FAILED)
311  continue;
312  rc = m0_storage_dev_new_by_conf(devs, sdev, force, &dev);
313  if (rc == -ENOENT) {
314  M0_LOG(M0_DEBUG, "co_id="FID_F" path=%s rc=%d",
315  FID_P(&sdev->sd_obj.co_id),
316  sdev->sd_filename, rc);
317  note[fail_devs].no_id = sdev->sd_obj.co_id;
318  note[fail_devs].no_state = M0_NC_FAILED;
319  M0_CNT_INC(fail_devs);
320  continue;
321  }
322  if (rc != 0) {
323  M0_LOG(M0_ERROR, "co_id="FID_F" path=%s rc=%d",
324  FID_P(&sdev->sd_obj.co_id),
325  sdev->sd_filename, rc);
326  break;
327  }
328  m0_storage_dev_attach(dev, devs);
330  sdev->sd_dev_idx)->isd_stob;
331  if (stob != NULL)
333  &sdev->sd_obj.co_id);
334 
335  }
337  if (fail_devs > 0) {
338  struct m0_ha_nvec nvec;
339 
340  nvec.nv_nr = fail_devs;
341  nvec.nv_note = note;
342  m0_ha_local_state_set(&nvec);
343  }
344  m0_free(note);
345  }
346  m0_confc_close(svc_obj);
347 
348  return M0_RC(rc);
349 }
350 
351 /* XXX copy-paste from motr/setup.c:pver_is_actual() */
353 {
358  return m0_conf_obj_type(obj) == &M0_CONF_PVER_TYPE &&
360 }
361 
363 {
364  struct m0_conf_root *root = NULL;
365  struct m0_conf_diter it;
366  struct m0_conf_pver *pver_obj;
367  int rc;
368  bool result = false;
369 
370  M0_ENTRY();
372  M0_LOG(M0_DEBUG, "m0_confc_root_open: rc=%d", rc);
373  if (rc == 0) {
376  M0_CONF_ROOT_POOLS_FID,
377  M0_CONF_POOL_PVERS_FID);
378  M0_LOG(M0_DEBUG, "m0_conf_diter_init rc %d", rc);
379  }
380  while (rc == 0 &&
382  M0_CONF_DIRNEXT) {
383  pver_obj = M0_CONF_CAST(m0_conf_diter_result(&it),
384  m0_conf_pver);
385  if (pver_obj->pv_u.subtree.pvs_attr.pa_N == 1 &&
386  pver_obj->pv_u.subtree.pvs_attr.pa_K == 0) {
387  result = true;
388  break;
389  }
390  }
391  if (rc == 0)
393  if (root != NULL)
395  return M0_RC(!!result);
396 }
397 
398 M0_INTERNAL int cs_conf_storage_init(struct cs_stobs *stob,
399  struct m0_storage_devs *devs,
400  bool force)
401 {
402  int rc;
403  struct m0_motr *cctx;
404  struct m0_reqh_context *rctx;
405  struct m0_confc *confc;
406  struct m0_fid tmp_fid;
407  struct m0_fid *svc_fid = NULL;
408  struct m0_conf_obj *proc;
409 
410  M0_ENTRY();
411 
412  rctx = container_of(stob, struct m0_reqh_context, rc_stob);
413  cctx = container_of(rctx, struct m0_motr, cc_reqh_ctx);
415 
418  if (rctx->rc_services[M0_CST_DS1] != NULL) { /* setup for tests */
419  svc_fid = &rctx->rc_service_fids[M0_CST_DS1];
420  } else {
421  struct m0_conf_diter it;
422  struct m0_fid *proc_fid = &rctx->rc_fid;
423 
425 
428  if (rc != 0)
429  return M0_ERR(rc);
430 
431  rc = m0_conf_diter_init(&it, confc, proc,
432  M0_CONF_PROCESS_SERVICES_FID);
433  if (rc != 0)
434  return M0_ERR(rc);
435 
436  while ((rc = m0_conf_diter_next_sync(&it, is_ios)) ==
437  M0_CONF_DIRNEXT) {
439  /*
440  * Copy of fid is needed because the conf cache can
441  * be invalidated after m0_confc_close() invocation
442  * rendering any pointer as invalid too.
443  */
444  tmp_fid = obj->co_id;
445  svc_fid = &tmp_fid;
446  M0_LOG(M0_DEBUG, "obj->co_id: "FID_F, FID_P(svc_fid));
447  }
449  m0_confc_close(proc);
450  }
451  if (svc_fid != NULL)
452  M0_LOG(M0_DEBUG, "svc_fid: "FID_F, FID_P(svc_fid));
453 
454  /*
455  * XXX A kludge.
456  * See m0_storage_dev_attach() comment in cs_storage_devs_init().
457  */
458  m0_storage_devs_lock(devs);
459  rc = cs_conf_storage_attach_by_srv(stob, devs, svc_fid, confc, force);
461  return M0_RC(rc);
462 }
463 
464 M0_INTERNAL int cs_conf_services_init(struct m0_motr *cctx)
465 {
466  int rc;
467  struct m0_conf_diter it;
468  struct m0_conf_root *root;
469  struct m0_reqh_context *rctx;
470  struct m0_confc *confc;
471 
472  M0_ENTRY();
473 
474  rctx = &cctx->cc_reqh_ctx;
475  rctx->rc_nr_services = 0;
478  if (rc != 0)
479  return M0_ERR_INFO(rc, "conf root open fail");
480  rc = M0_FI_ENABLED("diter_fail") ? -ENOMEM :
482  M0_CONF_ROOT_NODES_FID,
483  M0_CONF_NODE_PROCESSES_FID,
484  M0_CONF_PROCESS_SERVICES_FID);
485  if (rc != 0)
486  goto fs_close;
488  M0_CONF_DIRNEXT) {
490  struct m0_conf_service *svc =
492  char *svc_type_name =
494 
495  M0_LOG(M0_DEBUG, "service:%s fid:" FID_F, svc_type_name,
496  FID_P(&svc->cs_obj.co_id));
498  if (svc_type_name == NULL) {
499  int i;
500  rc = M0_ERR(-ENOMEM);
501  for (i = 0; i < rctx->rc_nr_services; ++i)
503  break;
504  }
505  M0_ASSERT_INFO(rctx->rc_services[svc->cs_type] == NULL,
506  "registering " FID_F " service type=%d when "
507  FID_F " for the type is already registered",
508  FID_P(&svc->cs_obj.co_id), svc->cs_type,
509  FID_P(&rctx->rc_service_fids[svc->cs_type]));
510  rctx->rc_services[svc->cs_type] = svc_type_name;
511  rctx->rc_service_fids[svc->cs_type] = svc->cs_obj.co_id;
513  }
515 fs_close:
517  return M0_RC(rc);
518 }
519 
520 M0_INTERNAL int cs_conf_device_reopen(struct m0_poolmach *pm,
521  struct cs_stobs *stob,
522  uint32_t dev_id)
523 {
524  struct m0_motr *cctx;
525  struct m0_reqh_context *rctx;
526  struct m0_confc *confc;
527  int rc;
528  struct m0_fid fid;
529  struct m0_conf_sdev *sdev;
530  struct m0_stob_id stob_id;
531  struct m0_conf_service *svc;
532 
533  M0_ENTRY();
534 
535  rctx = container_of(stob, struct m0_reqh_context, rc_stob);
536  cctx = container_of(rctx, struct m0_motr, cc_reqh_ctx);
538  fid = pm->pm_state->pst_devices_array[dev_id].pd_id;
539 
540  rc = m0_conf_sdev_get(confc, &fid, &sdev);
541  if (rc != 0)
542  return M0_ERR(rc);
543 
546  if (is_local_ios(&svc->cs_obj)) {
547  M0_LOG(M0_DEBUG, "sdev size: %" PRId64 " path: %s FID:"FID_F,
548  sdev->sd_size, sdev->sd_filename,
549  FID_P(&sdev->sd_obj.co_id));
550  m0_stob_id_make(0, dev_id, &stob->s_sdom->sd_id, &stob_id);
551  rc = m0_stob_linux_reopen(&stob_id, sdev->sd_filename);
552  }
553  m0_confc_close(&sdev->sd_obj);
554  return M0_RC(rc);
555 }
556 
557 #undef M0_TRACE_SUBSYSTEM
558 
559 /*
560  * Local variables:
561  * c-indentation-style: "K&R"
562  * c-basic-offset: 8
563  * tab-width: 8
564  * fill-column: 80
565  * scroll-step: 1
566  * End:
567  */
const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
Definition: obj.c:363
const char * sd_filename
Definition: obj.h:649
struct m0_fid co_id
Definition: obj.h:208
struct m0_poolmach_state * pm_state
Definition: pool_machine.h:169
M0_INTERNAL struct m0_storage_dev * m0_storage_devs_find_by_cid(struct m0_storage_devs *devs, uint64_t cid)
Definition: storage_dev.c:152
const char * pc_endpoint
Definition: obj.h:590
M0_INTERNAL int cs_conf_storage_init(struct cs_stobs *stob, struct m0_storage_devs *devs, bool force)
Definition: conf.c:398
#define M0_PRE(cond)
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
static bool is_local_ios(const struct m0_conf_obj *obj)
Definition: conf.c:242
#define m0_strdup(s)
Definition: string.h:43
struct m0_pdclust_attr pvs_attr
Definition: obj.h:481
#define NULL
Definition: misc.h:38
struct m0_stob * isd_stob
Definition: storage_dev.h:77
M0_INTERNAL void m0_storage_dev_attach(struct m0_storage_dev *dev, struct m0_storage_devs *devs)
Definition: storage_dev.c:633
uint32_t pa_N
Definition: pdclust.h:104
struct m0_conf_obj rt_obj
Definition: obj.h:372
#define M0_LOG(level,...)
Definition: trace.h:167
const struct m0_conf_obj_type M0_CONF_PVER_TYPE
Definition: pver.c:260
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
Definition: service.c:156
static struct net_test_cmd_node * node
Definition: commands.c:72
uint32_t pa_K
Definition: pdclust.h:107
const struct m0_conf_obj_type M0_CONF_SDEV_TYPE
Definition: sdev.c:122
M0_INTERNAL int m0_conf_diter_next_sync(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
Definition: diter.c:555
static struct m0_rpc_client_ctx cctx
Definition: rconfc.c:69
static struct m0_be_emap_cursor it
Definition: extmap.c:46
M0_INTERNAL int m0_stob_linux_reopen(struct m0_stob_id *stob_id, const char *f_path)
Definition: linux.c:554
static uint32_t dev_nr
Definition: pool_trigger.c:55
#define container_of(ptr, type, member)
Definition: misc.h:33
Definition: ub.c:49
M0_INTERNAL const char * m0_rpc_machine_ep(const struct m0_rpc_machine *rmach)
Definition: rpc_machine.c:603
M0_INTERNAL struct m0_rpc_machine * m0_motr_to_rmach(struct m0_motr *motr)
Definition: setup.c:196
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
Definition: fid.c:106
static int cs_conf_storage_attach_by_srv(struct cs_stobs *cs_stob, struct m0_storage_devs *devs, struct m0_fid *svc_fid, struct m0_confc *confc, bool force)
Definition: conf.c:252
static struct foo * obj
Definition: tlist.c:302
struct m0_pooldev * pst_devices_array
Definition: pool_machine.h:111
struct m0_fid fid
Definition: di.c:46
M0_INTERNAL int m0_confc_root_open(struct m0_confc *confc, struct m0_conf_root **root)
Definition: helpers.c:219
return M0_RC(rc)
static bool is_ios(const struct m0_conf_obj *obj)
Definition: conf.c:236
M0_INTERNAL int m0_storage_dev_new_by_conf(struct m0_storage_devs *devs, struct m0_conf_sdev *sdev, bool force, struct m0_storage_dev **dev)
Definition: storage_dev.c:590
#define M0_ENTRY(...)
Definition: trace.h:170
struct m0_reqh_context rctx
uint32_t sd_dev_idx
Definition: obj.h:635
int i
Definition: dir.c:1033
uint32_t rc_nr_services
Definition: setup.h:252
static bool is_local_service(const struct m0_conf_obj *obj)
Definition: conf.c:195
#define PRIu64
Definition: types.h:58
#define M0_ERR_INFO(rc, fmt,...)
Definition: trace.h:215
struct m0_conf_root * root
Definition: note.c:50
int32_t nv_nr
Definition: note.h:196
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_storage_devs_lock(struct m0_storage_devs *devs)
Definition: storage_dev.c:71
Definition: stob.h:163
#define M0_NET_XPRT_PREFIX_DEFAULT
Definition: net.h:98
static struct m0_stob * stob
Definition: storage.c:39
#define M0_ASSERT(cond)
M0_INTERNAL const char * m0_conf_service_type2str(enum m0_conf_service_type type)
Definition: service.c:169
static struct m0_confc * confc
Definition: file.c:94
static char * strxdup(const char *addr)
Definition: conf.c:71
static bool cs_conf_storage_pver_is_actual(const struct m0_conf_obj *obj)
Definition: conf.c:352
static int cs_conf_storage_is_n1_k0_s0(struct m0_confc *confc)
Definition: conf.c:362
union m0_conf_pver::@122 pv_u
struct m0_conf_obj * m0_conf_obj_grandparent(const struct m0_conf_obj *obj)
Definition: obj.c:384
enum m0_ha_obj_state co_ha_state
Definition: obj.h:241
static void service_options_add(struct cs_args *args, const struct m0_conf_service *svc)
Definition: conf.c:84
#define m0_streq(a, b)
Definition: string.h:34
static uint32_t m0_conf_dir_len(const struct m0_conf_dir *dir)
Definition: dir.h:59
M0_INTERNAL void m0_stob_id_make(uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
Definition: stob.c:343
M0_INTERNAL struct m0_reqh * m0_conf_obj2reqh(const struct m0_conf_obj *obj)
Definition: helpers.c:351
M0_INTERNAL int cs_conf_device_reopen(struct m0_poolmach *pm, struct cs_stobs *stob, uint32_t dev_id)
Definition: conf.c:520
static M0_UNUSED void node_options_add(struct cs_args *args, const struct m0_conf_node *node)
Definition: conf.c:131
void * m0_alloc(size_t size)
Definition: memory.c:126
static char * proc_fid
Definition: m0hsm.c:45
Definition: xcode.h:73
M0_INTERNAL struct m0_confc * m0_motr2confc(struct m0_motr *motr)
Definition: setup.c:191
Definition: setup.h:156
M0_INTERNAL int cs_conf_to_args(struct cs_args *dest, struct m0_conf_root *root)
Definition: conf.c:159
struct m0_fid pd_id
Definition: pool.h:428
uint64_t sd_size
Definition: obj.h:643
#define M0_CONF_CAST(ptr, type)
Definition: obj.h:780
#define FID_P(f)
Definition: fid.h:77
struct m0_fid no_id
Definition: note.h:180
#define PRId64
Definition: types.h:57
struct m0_conf_pver_subtree subtree
Definition: obj.h:537
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
Definition: fid.c:164
M0_INTERNAL struct m0_conf_obj * m0_conf_diter_result(const struct m0_conf_diter *it)
Definition: diter.c:576
struct m0_conf_obj pc_obj
Definition: obj.h:581
#define m0_conf_diter_init(iter, confc, origin,...)
Definition: diter.h:235
struct m0_fid rc_fid
Definition: setup.h:338
Definition: setup.h:354
M0_INTERNAL void m0_storage_devs_locks_disable(struct m0_storage_devs *devs)
Definition: storage_dev.c:145
#define M0_CNT_INC(cnt)
Definition: arith.h:226
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
Definition: fid.h:38
const struct m0_conf_obj_type M0_CONF_NODE_TYPE
Definition: node.c:128
static bool service_and_node(const struct m0_conf_obj *obj)
Definition: conf.c:152
static const char * local_ep(const struct m0_cm *cm)
Definition: cm_utils.c:397
M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it)
Definition: diter.c:313
static struct m0_net_test_service svc
Definition: service.c:34
struct m0_conf_obj sd_obj
Definition: obj.h:616
struct m0_fid * rc_service_fids
Definition: setup.h:249
#define IS_IN_ARRAY(idx, array)
Definition: misc.h:311
M0_INTERNAL void m0_storage_devs_unlock(struct m0_storage_devs *devs)
Definition: storage_dev.c:77
M0_INTERNAL struct m0_confc * m0_confc_from_obj(const struct m0_conf_obj *obj)
Definition: confc.c:592
static void option_add(struct cs_args *args, char *s)
Definition: conf.c:50
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
Definition: confc.c:921
#define M0_ASSERT_INFO(cond, fmt,...)
struct m0_ha_note * nv_note
Definition: note.h:197
M0_INTERNAL void m0_stob_linux_conf_sdev_associate(struct m0_stob *stob, const struct m0_fid *conf_sdev)
Definition: linux.c:594
void m0_free(void *data)
Definition: memory.c:146
static struct m0_addb2_source * s
Definition: consumer.c:39
M0_INTERNAL int m0_confc_open_by_fid_sync(struct m0_confc *confc, const struct m0_fid *fid, struct m0_conf_obj **result)
Definition: confc.c:943
M0_INTERNAL struct m0_motr * m0_cs_ctx_get(struct m0_reqh *reqh)
Definition: setup.c:1778
M0_INTERNAL int cs_conf_services_init(struct m0_motr *cctx)
Definition: conf.c:464
char ** rc_services
Definition: setup.h:246
int32_t rc
Definition: trigger_fop.h:47
static bool is_device(const struct m0_conf_obj *obj)
Definition: conf.c:247
#define FID_F
Definition: fid.h:75
M0_INTERNAL void m0_ha_local_state_set(const struct m0_ha_nvec *nvec)
Definition: note.c:105
uint32_t no_state
Definition: note.h:182
#define M0_UNUSED
Definition: misc.h:380