Motr  M0
pd.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_BE_PD_H__
26 #define __MOTR_BE_PD_H__
27 
28 #include "lib/tlist.h" /* m0_tl */
29 #include "lib/types.h" /* uint32_t */
30 
31 #include "be/io_sched.h" /* m0_be_io_sched */
32 #include "be/io.h" /* m0_be_io_credit */
33 #include "be/pool.h" /* m0_be_pool */
34 
35 
42 struct m0_ext;
43 struct m0_be_io;
44 struct m0_be_op;
45 struct m0_be_pd_io;
46 
48  /* io is ready to be taken using m0_be_pd_io_get() */
50  /* io is owned by m0_be_pd::bpd_sched */
52  /* m0_be_pd::bpd_sched had reported about io completion. */
55 };
56 
57 struct m0_be_pd_cfg {
59  uint32_t bpdc_seg_io_nr;
62 };
63 
64 struct m0_be_pd {
69 
78 };
79 
80 M0_INTERNAL int m0_be_pd_init(struct m0_be_pd *pd, struct m0_be_pd_cfg *pd_cfg);
81 M0_INTERNAL void m0_be_pd_fini(struct m0_be_pd *pd);
82 
83 M0_INTERNAL void m0_be_pd_io_add(struct m0_be_pd *pd,
84  struct m0_be_pd_io *pdio,
85  struct m0_ext *ext,
86  struct m0_be_op *op);
87 
88 M0_INTERNAL void m0_be_pd_io_get(struct m0_be_pd *pd,
89  struct m0_be_pd_io **pdio,
90  struct m0_be_op *op);
91 M0_INTERNAL void m0_be_pd_io_put(struct m0_be_pd *pd,
92  struct m0_be_pd_io *pdio);
93 
94 M0_INTERNAL struct m0_be_io *m0_be_pd_io_be_io(struct m0_be_pd_io *pdio);
95 
101 M0_INTERNAL void m0_be_pd_sync(struct m0_be_pd *pd,
102  m0_bindex_t pos,
103  struct m0_stob **stobs,
104  int nr,
105  struct m0_be_op *op);
106 
108 #endif /* __MOTR_BE_PD_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  */
static size_t nr
Definition: dump.c:1505
M0_INTERNAL int m0_be_pd_init(struct m0_be_pd *pd, struct m0_be_pd_cfg *pd_cfg)
Definition: pd.c:86
m0_be_pd_io_state
Definition: pd.h:47
uint64_t m0_time_t
Definition: time.h:37
m0_time_t bpd_sync_prev
Definition: pd.h:73
m0_time_t bpd_sync_delay
Definition: pd.h:71
struct m0_be_io_sched bpd_sched
Definition: pd.h:66
struct m0_be_pool bpd_io_pool
Definition: pd.h:68
M0_INTERNAL void m0_be_pd_io_get(struct m0_be_pd *pd, struct m0_be_pd_io **pdio, struct m0_be_op *op)
Definition: pd.c:169
uint64_t m0_bindex_t
Definition: types.h:80
uint32_t bpdc_seg_io_pending_max
Definition: pd.h:60
M0_INTERNAL struct m0_be_io * m0_be_pd_io_be_io(struct m0_be_pd_io *pdio)
Definition: pd.c:185
Definition: sm.h:504
op
Definition: libdemo.c:64
struct m0_be_pd_io * bpd_io
Definition: pd.h:67
M0_INTERNAL void m0_be_pd_io_add(struct m0_be_pd *pd, struct m0_be_pd_io *pdio, struct m0_ext *ext, struct m0_be_op *op)
Definition: pd.c:149
Definition: stob.h:163
struct m0_be_io_sched_cfg bpdc_sched
Definition: pd.h:58
M0_INTERNAL void m0_be_pd_sync(struct m0_be_pd *pd, m0_bindex_t pos, struct m0_stob **stobs, int nr, struct m0_be_op *op)
Definition: pd.c:216
char bpd_sync_read_to[2]
Definition: pd.h:76
M0_INTERNAL void m0_be_pd_io_put(struct m0_be_pd *pd, struct m0_be_pd_io *pdio)
Definition: pd.c:176
bool bpd_sync_in_progress
Definition: pd.h:75
M0_INTERNAL void m0_be_pd_fini(struct m0_be_pd *pd)
Definition: pd.c:127
Definition: ext.h:37
struct m0_be_io bpd_sync_io
Definition: pd.h:74
struct m0_be_op * bpd_sync_op
Definition: pd.h:70
Definition: pd.h:64
m0_time_t bpd_sync_runtime
Definition: pd.h:72
struct m0_be_io_credit bpdc_io_credit
Definition: pd.h:61
Definition: io.h:87
struct m0_be_pd_cfg bpd_cfg
Definition: pd.h:65
struct m0_sm_ast bpd_sync_ast
Definition: pd.h:77
uint32_t bpdc_seg_io_nr
Definition: pd.h:59
Definition: pd.c:49
Definition: op.h:74