Motr  M0
ioq.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2014-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_STOB_IOQ_H__
26 #define __MOTR_STOB_IOQ_H__
27 
28 #include <libaio.h> /* io_context_t */
29 
30 #include "lib/types.h" /* bool */
31 #include "lib/atomic.h" /* m0_atomic64 */
32 #include "lib/thread.h" /* m0_thread */
33 #include "lib/mutex.h" /* m0_mutex */
34 #include "lib/queue.h" /* m0_queue */
35 #include "lib/timer.h" /* m0_timer */
36 #include "lib/semaphore.h" /* m0_semaphore */
37 
44 struct m0_stob;
45 struct m0_stob_io;
46 
47 enum {
58 };
59 
60 struct m0_stob_ioq {
75  io_context_t ioq_ctx;
82 
92 };
93 
94 M0_INTERNAL int m0_stob_ioq_init(struct m0_stob_ioq *ioq);
95 M0_INTERNAL void m0_stob_ioq_fini(struct m0_stob_ioq *ioq);
96 M0_INTERNAL void m0_stob_ioq_directio_setup(struct m0_stob_ioq *ioq,
97  bool use_directio);
98 
99 M0_INTERNAL bool m0_stob_ioq_directio(struct m0_stob_ioq *ioq);
100 M0_INTERNAL uint32_t m0_stob_ioq_bshift(struct m0_stob_ioq *ioq);
101 M0_INTERNAL m0_bcount_t m0_stob_ioq_bsize(struct m0_stob_ioq *ioq);
102 M0_INTERNAL m0_bcount_t m0_stob_ioq_bmask(struct m0_stob_ioq *ioq);
103 
104 M0_INTERNAL int m0_stob_linux_io_init(struct m0_stob *stob,
105  struct m0_stob_io *io);
106 
108 #endif /* __MOTR_STOB_IOQ_H__ */
109 
110 /*
111  * Local variables:
112  * c-indentation-style: "K&R"
113  * c-basic-offset: 8
114  * tab-width: 8
115  * fill-column: 80
116  * scroll-step: 1
117  * End:
118  */
119 /*
120  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
121  */
M0_INTERNAL void m0_stob_ioq_fini(struct m0_stob_ioq *ioq)
Definition: ioq.c:716
struct m0_queue ioq_queue
Definition: ioq.h:88
struct m0_timer ioq_stop_timer[M0_STOB_IOQ_NR_THREADS]
Definition: ioq.h:90
struct m0_mutex ioq_lock
Definition: ioq.h:85
M0_INTERNAL uint32_t m0_stob_ioq_bshift(struct m0_stob_ioq *ioq)
Definition: ioq.c:732
struct m0_atomic64 ioq_avail
Definition: ioq.h:77
struct m0_semaphore ioq_stop_sem[M0_STOB_IOQ_NR_THREADS]
Definition: ioq.h:89
M0_INTERNAL bool m0_stob_ioq_directio(struct m0_stob_ioq *ioq)
Definition: ioq.c:747
uint64_t m0_bcount_t
Definition: types.h:77
Definition: queue.h:43
Definition: timer.h:39
bool ioq_use_directio
Definition: ioq.h:66
M0_INTERNAL m0_bcount_t m0_stob_ioq_bmask(struct m0_stob_ioq *ioq)
Definition: ioq.c:742
struct m0_timer_locality ioq_stop_timer_loc[M0_STOB_IOQ_NR_THREADS]
Definition: ioq.h:91
M0_INTERNAL void m0_stob_ioq_directio_setup(struct m0_stob_ioq *ioq, bool use_directio)
Definition: ioq.c:752
Definition: stob.h:163
static struct m0_stob * stob
Definition: storage.c:39
Definition: io.h:285
M0_INTERNAL int m0_stob_ioq_init(struct m0_stob_ioq *ioq)
Definition: ioq.c:686
static struct m0_stob_io io
Definition: ad.c:59
int ioq_queued
Definition: ioq.h:79
M0_INTERNAL m0_bcount_t m0_stob_ioq_bsize(struct m0_stob_ioq *ioq)
Definition: ioq.c:737
M0_INTERNAL int m0_stob_linux_io_init(struct m0_stob *stob, struct m0_stob_io *io)
Definition: ioq.c:161
io_context_t ioq_ctx
Definition: ioq.h:75
Definition: mutex.h:47
struct m0_thread ioq_thread[M0_STOB_IOQ_NR_THREADS]
Definition: ioq.h:81