Motr  M0
sys.h
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 #pragma once
24 
25 #ifndef __MOTR_ADDB2_SYS_H__
26 #define __MOTR_ADDB2_SYS_H__
27 
77 /* import */
78 #include "lib/mutex.h"
79 #include "lib/types.h"
80 #include "lib/tlist.h"
81 #include "lib/semaphore.h"
82 #include "sm/sm.h"
83 struct m0_addb2_trace_obj;
84 struct m0_addb2_storage;
85 struct m0_addb2_net;
86 struct m0_thread;
87 struct m0_stob;
88 
89 /* export */
90 struct m0_addb2_config;
91 struct m0_addb2_sys;
92 
103  unsigned co_buffer_size;
108  unsigned co_buffer_min;
113  unsigned co_buffer_max;
118  unsigned co_queue_max;
122  unsigned co_pool_min;
126  unsigned co_pool_max;
127 };
128 
135 int m0_addb2_sys_init(struct m0_addb2_sys **sys,
136  const struct m0_addb2_config *conf);
137 void m0_addb2_sys_fini(struct m0_addb2_sys *sys);
144 struct m0_addb2_mach *m0_addb2_sys_get(struct m0_addb2_sys *sys);
153 void m0_addb2_sys_put(struct m0_addb2_sys *sys, struct m0_addb2_mach *mach);
154 
158 void m0_addb2_sys_sm_start(struct m0_addb2_sys *sys);
166 void m0_addb2_sys_sm_stop(struct m0_addb2_sys *sys);
167 
171 int m0_addb2_sys_net_start(struct m0_addb2_sys *sys);
175 void m0_addb2_sys_net_stop(struct m0_addb2_sys *sys);
183 int m0_addb2_sys_net_start_with(struct m0_addb2_sys *sys, struct m0_tl *head);
191 int m0_addb2_sys_stor_start(struct m0_addb2_sys *sys, const char *location,
192  uint64_t key, bool mkfs, bool force,
193  m0_bcount_t size);
197 void m0_addb2_sys_stor_stop(struct m0_addb2_sys *sys);
198 
202 int m0_addb2_sys_submit(struct m0_addb2_sys *sys,
203  struct m0_addb2_trace_obj *obj);
207 void m0_addb2_sys_attach(struct m0_addb2_sys *sys, struct m0_addb2_sys *src);
211 void m0_addb2_sys_detach(struct m0_addb2_sys *sys);
219 void m0_addb2_sys_counter_add(struct m0_addb2_sys *sys,
220  struct m0_addb2_counter *counter, uint64_t id);
221 
222 
224 #endif /* __MOTR_ADDB2_SYS_H__ */
225 
226 /*
227  * Local variables:
228  * c-indentation-style: "K&R"
229  * c-basic-offset: 8
230  * tab-width: 8
231  * fill-column: 80
232  * scroll-step: 1
233  * End:
234  */
235 /*
236  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
237  */
void m0_addb2_sys_net_stop(struct m0_addb2_sys *sys)
Definition: sys.c:322
void m0_addb2_sys_sm_stop(struct m0_addb2_sys *sys)
Definition: sys.c:384
void m0_addb2_sys_sm_start(struct m0_addb2_sys *sys)
Definition: sys.c:377
void m0_addb2_sys_attach(struct m0_addb2_sys *sys, struct m0_addb2_sys *src)
Definition: sys.c:408
Definition: conf.py:1
static struct m0_addb2_mach * mach
Definition: storage.c:42
unsigned co_buffer_max
Definition: sys.h:113
uint64_t m0_bcount_t
Definition: types.h:77
unsigned co_pool_max
Definition: sys.h:126
unsigned co_pool_min
Definition: sys.h:122
static struct foo * obj
Definition: tlist.c:302
const char * location
Definition: storage.c:50
static int head(struct m0_sm *mach)
Definition: sm.c:468
void m0_addb2_sys_fini(struct m0_addb2_sys *sys)
Definition: sys.c:214
void m0_addb2_sys_detach(struct m0_addb2_sys *sys)
Definition: sys.c:416
Definition: stob.h:163
int m0_addb2_sys_init(struct m0_addb2_sys **out, const struct m0_addb2_config *conf)
Definition: sys.c:176
static int counter
Definition: mutex.c:32
Definition: tlist.h:251
unsigned co_buffer_min
Definition: sys.h:108
unsigned co_queue_max
Definition: sys.h:118
int m0_addb2_sys_submit(struct m0_addb2_sys *sys, struct m0_addb2_trace_obj *obj)
Definition: sys.c:392
int m0_addb2_sys_net_start_with(struct m0_addb2_sys *sys, struct m0_tl *head)
Definition: sys.c:329
struct m0_addb2_mach * m0_addb2_sys_get(struct m0_addb2_sys *sys)
Definition: sys.c:272
void m0_addb2_sys_counter_add(struct m0_addb2_sys *sys, struct m0_addb2_counter *counter, uint64_t id)
Definition: sys.c:425
int m0_addb2_sys_stor_start(struct m0_addb2_sys *sys, const char *location, uint64_t key, bool mkfs, bool force, m0_bcount_t size)
Definition: sys.c:357
m0_bcount_t size
Definition: di.c:39
int m0_addb2_sys_net_start(struct m0_addb2_sys *sys)
Definition: sys.c:312
void m0_addb2_sys_put(struct m0_addb2_sys *sys, struct m0_addb2_mach *m)
Definition: sys.c:295
void m0_addb2_sys_stor_stop(struct m0_addb2_sys *sys)
Definition: sys.c:370
unsigned co_buffer_size
Definition: sys.h:103
struct m0_pdclust_src_addr src
Definition: fd.c:108
Definition: idx_mock.c:47