]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2016 Red Hat Inc. | |
7 | * | |
8 | * This is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU Lesser General Public | |
10 | * License version 2.1, as published by the Free Software | |
11 | * Foundation. See file COPYING. | |
12 | * | |
13 | */ | |
14 | ||
9f95a23c TL |
15 | #include "osd/scheduler/OpSchedulerItem.h" |
16 | #include "osd/OSD.h" | |
20effc67 TL |
17 | #include "osd/osd_tracer.h" |
18 | ||
9f95a23c TL |
19 | |
20 | namespace ceph::osd::scheduler { | |
11fdf7f2 | 21 | |
20effc67 TL |
22 | std::ostream& operator<<(std::ostream& out, const op_scheduler_class& class_id) { |
23 | out << static_cast<size_t>(class_id); | |
24 | return out; | |
25 | } | |
26 | ||
11fdf7f2 TL |
27 | void PGOpItem::run( |
28 | OSD *osd, | |
29 | OSDShard *sdata, | |
30 | PGRef& pg, | |
31 | ThreadPool::TPHandle &handle) | |
32 | { | |
20effc67 | 33 | [[maybe_unused]] auto span = tracing::osd::tracer.add_span("PGOpItem::run", op->osd_parent_span); |
11fdf7f2 TL |
34 | osd->dequeue_op(pg, op, handle); |
35 | pg->unlock(); | |
36 | } | |
37 | ||
38 | void PGPeeringItem::run( | |
39 | OSD *osd, | |
40 | OSDShard *sdata, | |
41 | PGRef& pg, | |
42 | ThreadPool::TPHandle &handle) | |
43 | { | |
44 | osd->dequeue_peering_evt(sdata, pg.get(), evt, handle); | |
45 | } | |
46 | ||
47 | void PGSnapTrim::run( | |
48 | OSD *osd, | |
49 | OSDShard *sdata, | |
50 | PGRef& pg, | |
51 | ThreadPool::TPHandle &handle) | |
52 | { | |
53 | pg->snap_trimmer(epoch_queued); | |
54 | pg->unlock(); | |
55 | } | |
56 | ||
f67539c2 | 57 | void PGScrub::run(OSD* osd, OSDShard* sdata, PGRef& pg, ThreadPool::TPHandle& handle) |
11fdf7f2 TL |
58 | { |
59 | pg->scrub(epoch_queued, handle); | |
60 | pg->unlock(); | |
61 | } | |
62 | ||
f67539c2 TL |
63 | void PGScrubAfterRepair::run(OSD* osd, |
64 | OSDShard* sdata, | |
65 | PGRef& pg, | |
66 | ThreadPool::TPHandle& handle) | |
67 | { | |
68 | pg->recovery_scrub(epoch_queued, handle); | |
69 | pg->unlock(); | |
70 | } | |
71 | ||
72 | void PGScrubResched::run(OSD* osd, | |
73 | OSDShard* sdata, | |
74 | PGRef& pg, | |
75 | ThreadPool::TPHandle& handle) | |
76 | { | |
77 | pg->scrub_send_scrub_resched(epoch_queued, handle); | |
78 | pg->unlock(); | |
79 | } | |
80 | ||
81 | void PGScrubResourcesOK::run(OSD* osd, | |
82 | OSDShard* sdata, | |
83 | PGRef& pg, | |
84 | ThreadPool::TPHandle& handle) | |
85 | { | |
86 | pg->scrub_send_resources_granted(epoch_queued, handle); | |
87 | pg->unlock(); | |
88 | } | |
89 | ||
90 | void PGScrubDenied::run(OSD* osd, | |
91 | OSDShard* sdata, | |
92 | PGRef& pg, | |
93 | ThreadPool::TPHandle& handle) | |
94 | { | |
95 | pg->scrub_send_resources_denied(epoch_queued, handle); | |
96 | pg->unlock(); | |
97 | } | |
98 | ||
99 | void PGScrubPushesUpdate::run(OSD* osd, | |
100 | OSDShard* sdata, | |
101 | PGRef& pg, | |
102 | ThreadPool::TPHandle& handle) | |
103 | { | |
104 | pg->scrub_send_pushes_update(epoch_queued, handle); | |
105 | pg->unlock(); | |
106 | } | |
107 | ||
108 | void PGScrubAppliedUpdate::run(OSD* osd, | |
109 | OSDShard* sdata, | |
110 | PGRef& pg, | |
111 | ThreadPool::TPHandle& handle) | |
112 | { | |
113 | pg->scrub_send_applied_update(epoch_queued, handle); | |
114 | pg->unlock(); | |
115 | } | |
116 | ||
117 | void PGScrubUnblocked::run(OSD* osd, | |
118 | OSDShard* sdata, | |
119 | PGRef& pg, | |
120 | ThreadPool::TPHandle& handle) | |
121 | { | |
122 | pg->scrub_send_unblocking(epoch_queued, handle); | |
123 | pg->unlock(); | |
124 | } | |
125 | ||
126 | void PGScrubDigestUpdate::run(OSD* osd, | |
127 | OSDShard* sdata, | |
128 | PGRef& pg, | |
129 | ThreadPool::TPHandle& handle) | |
130 | { | |
131 | pg->scrub_send_digest_update(epoch_queued, handle); | |
132 | pg->unlock(); | |
133 | } | |
134 | ||
20effc67 TL |
135 | void PGScrubGotLocalMap::run(OSD* osd, |
136 | OSDShard* sdata, | |
137 | PGRef& pg, | |
138 | ThreadPool::TPHandle& handle) | |
139 | { | |
140 | pg->scrub_send_local_map_ready(epoch_queued, handle); | |
141 | pg->unlock(); | |
142 | } | |
143 | ||
f67539c2 TL |
144 | void PGScrubGotReplMaps::run(OSD* osd, |
145 | OSDShard* sdata, | |
146 | PGRef& pg, | |
147 | ThreadPool::TPHandle& handle) | |
148 | { | |
149 | pg->scrub_send_replmaps_ready(epoch_queued, handle); | |
150 | pg->unlock(); | |
151 | } | |
152 | ||
20effc67 TL |
153 | void PGScrubMapsCompared::run(OSD* osd, |
154 | OSDShard* sdata, | |
155 | PGRef& pg, | |
156 | ThreadPool::TPHandle& handle) | |
157 | { | |
158 | pg->scrub_send_maps_compared(epoch_queued, handle); | |
159 | pg->unlock(); | |
160 | } | |
161 | ||
f67539c2 TL |
162 | void PGRepScrub::run(OSD* osd, OSDShard* sdata, PGRef& pg, ThreadPool::TPHandle& handle) |
163 | { | |
20effc67 | 164 | pg->replica_scrub(epoch_queued, activation_index, handle); |
f67539c2 TL |
165 | pg->unlock(); |
166 | } | |
167 | ||
168 | void PGRepScrubResched::run(OSD* osd, | |
169 | OSDShard* sdata, | |
170 | PGRef& pg, | |
171 | ThreadPool::TPHandle& handle) | |
172 | { | |
20effc67 | 173 | pg->replica_scrub_resched(epoch_queued, activation_index, handle); |
f67539c2 TL |
174 | pg->unlock(); |
175 | } | |
176 | ||
177 | void PGScrubReplicaPushes::run([[maybe_unused]] OSD* osd, | |
178 | OSDShard* sdata, | |
179 | PGRef& pg, | |
180 | ThreadPool::TPHandle& handle) | |
181 | { | |
182 | pg->scrub_send_replica_pushes(epoch_queued, handle); | |
183 | pg->unlock(); | |
184 | } | |
185 | ||
20effc67 TL |
186 | void PGScrubScrubFinished::run([[maybe_unused]] OSD* osd, |
187 | OSDShard* sdata, | |
188 | PGRef& pg, | |
189 | ThreadPool::TPHandle& handle) | |
190 | { | |
191 | pg->scrub_send_scrub_is_finished(epoch_queued, handle); | |
192 | pg->unlock(); | |
193 | } | |
194 | ||
195 | void PGScrubGetNextChunk::run([[maybe_unused]] OSD* osd, | |
196 | OSDShard* sdata, | |
197 | PGRef& pg, | |
198 | ThreadPool::TPHandle& handle) | |
199 | { | |
200 | pg->scrub_send_get_next_chunk(epoch_queued, handle); | |
201 | pg->unlock(); | |
202 | } | |
203 | ||
204 | void PGScrubChunkIsBusy::run([[maybe_unused]] OSD* osd, | |
205 | OSDShard* sdata, | |
206 | PGRef& pg, | |
207 | ThreadPool::TPHandle& handle) | |
208 | { | |
209 | pg->scrub_send_chunk_busy(epoch_queued, handle); | |
210 | pg->unlock(); | |
211 | } | |
212 | ||
213 | void PGScrubChunkIsFree::run([[maybe_unused]] OSD* osd, | |
214 | OSDShard* sdata, | |
215 | PGRef& pg, | |
216 | ThreadPool::TPHandle& handle) | |
217 | { | |
218 | pg->scrub_send_chunk_free(epoch_queued, handle); | |
219 | pg->unlock(); | |
220 | } | |
221 | ||
11fdf7f2 TL |
222 | void PGRecovery::run( |
223 | OSD *osd, | |
224 | OSDShard *sdata, | |
225 | PGRef& pg, | |
226 | ThreadPool::TPHandle &handle) | |
227 | { | |
228 | osd->do_recovery(pg.get(), epoch_queued, reserved_pushes, handle); | |
229 | pg->unlock(); | |
230 | } | |
231 | ||
232 | void PGRecoveryContext::run( | |
233 | OSD *osd, | |
234 | OSDShard *sdata, | |
235 | PGRef& pg, | |
236 | ThreadPool::TPHandle &handle) | |
237 | { | |
238 | c.release()->complete(handle); | |
239 | pg->unlock(); | |
240 | } | |
241 | ||
242 | void PGDelete::run( | |
243 | OSD *osd, | |
244 | OSDShard *sdata, | |
245 | PGRef& pg, | |
246 | ThreadPool::TPHandle &handle) | |
247 | { | |
248 | osd->dequeue_delete(sdata, pg.get(), epoch_queued, handle); | |
249 | } | |
9f95a23c | 250 | |
f67539c2 TL |
251 | void PGRecoveryMsg::run( |
252 | OSD *osd, | |
253 | OSDShard *sdata, | |
254 | PGRef& pg, | |
255 | ThreadPool::TPHandle &handle) | |
256 | { | |
257 | osd->dequeue_op(pg, op, handle); | |
258 | pg->unlock(); | |
259 | } | |
260 | ||
9f95a23c | 261 | } |