summaryrefslogtreecommitdiff
path: root/sys-cluster/ceph/files/ceph-20.2.1-boost-1.90-intrusive_ptr_fixes.patch
blob: 2350bd9940f54a3b7a12b85ff339b3689f2d5eed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
diff --git a/src/common/Formatter.h b/src/common/Formatter.h
index 05814ec66c3..fa95fe6a6ca 100644
--- a/src/common/Formatter.h
+++ b/src/common/Formatter.h
@@ -5,13 +5,14 @@
 
 #include "include/buffer_fwd.h"
 
+#include <cstdarg>
+#include <cstdint>
 #include <deque>
 #include <fstream>
 #include <functional>
 #include <list>
 #include <memory>
 #include <vector>
-#include <stdarg.h>
 #include <sstream>
 #include <map>
 #include <vector>
diff --git a/src/journal/ObjectRecorder.h b/src/journal/ObjectRecorder.h
index a4d75b3a7e3..4684095bf3f 100644
--- a/src/journal/ObjectRecorder.h
+++ b/src/journal/ObjectRecorder.h
@@ -21,6 +21,8 @@
 namespace journal {
 
 class ObjectRecorder;
+void intrusive_ptr_add_ref(ObjectRecorder*);
+void intrusive_ptr_release(ObjectRecorder*);
 
 typedef std::pair<ceph::ref_t<FutureImpl>, bufferlist> AppendBuffer;
 typedef std::list<AppendBuffer> AppendBuffers;
@@ -155,6 +157,16 @@ private:
                              bool notify_overflowed);
 };
 
+inline void intrusive_ptr_add_ref(ObjectRecorder* o)
+{
+  o->get();
+}
+
+inline void intrusive_ptr_release(ObjectRecorder* o)
+{
+  o->put();
+}
+
 } // namespace journal
 
 #endif // CEPH_JOURNAL_OBJECT_RECORDER_H
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index e2d9936ab16..35f2781cc78 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -4489,7 +4489,7 @@ void Locker::handle_client_lease(const cref_t<MClientLease> &m)
       dout(7) << "handle_client_lease client." << client << " renew on " << *dn
 	      << (!dn->lock.can_lease(client)?", revoking lease":"") << dendl;
       if (dn->lock.can_lease(client)) {
-        auto reply = make_message<MClientLease>(*m);
+        auto reply = ceph::make_message<MClientLease>(*m);
 	int pool = 1;   // fixme.. do something smart!
 	reply->h.duration_ms = (int)(1000 * mdcache->client_lease_durations[pool]);
 	reply->h.seq = ++l->seq;
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 4ea1fa927b7..f54360a4e7f 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -10535,7 +10535,7 @@ void MDCache::handle_discover(const cref_t<MDiscover> &dis)
 
 
   CInode *cur = 0;
-  auto reply = make_message<MDiscoverReply>(*dis);
+  auto reply = ceph::make_message<MDiscoverReply>(*dis);
 
   snapid_t snapid = dis->get_snapid();
 
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index d543d9cfa11..0ca1596128e 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -150,7 +150,7 @@ public:
       }
     }
     batch_reqs.clear();
-    server->reply_client_request(mdr, make_message<MClientReply>(*mdr->client_request, r));
+    server->reply_client_request(mdr, ceph::make_message<MClientReply>(*mdr->client_request, r));
   }
   void print(std::ostream& o) const override {
     o << "[batch front=" << *mdr << "]";
@@ -2142,7 +2142,7 @@ void Server::respond_to_request(const MDRequestRef& mdr, int r)
       dout(20) << __func__ << ": batch head " << *mdr << dendl;
       mdr->release_batch_op()->respond(r);
     } else {
-     reply_client_request(mdr, make_message<MClientReply>(*mdr->client_request, r));
+      reply_client_request(mdr, ceph::make_message<MClientReply>(*mdr->client_request, r));
     }
   } else if (mdr->internal_op > -1) {
     dout(10) << __func__ << ": completing with result " << cpp_strerror(r) << " on internal " << *mdr << dendl;
@@ -2290,7 +2290,7 @@ void Server::early_reply(const MDRequestRef& mdr, CInode *tracei, CDentry *trace
   }
 
 
-  auto reply = make_message<MClientReply>(*req, 0);
+  auto reply = ceph::make_message<MClientReply>(*req, 0);
   reply->set_unsafe();
 
   // mark xlocks "done", indicating that we are exposing uncommitted changes.
@@ -2632,7 +2632,7 @@ void Server::handle_client_request(const cref_t<MClientRequest> &req)
 	   req->get_op() != CEPH_MDS_OP_OPEN &&
 	   req->get_op() != CEPH_MDS_OP_CREATE)) {
 	dout(5) << "already completed " << req->get_reqid() << dendl;
-        auto reply = make_message<MClientReply>(*req, 0);
+        auto reply = ceph::make_message<MClientReply>(*req, 0);
 	if (created != inodeno_t()) {
 	  bufferlist extra;
 	  set_reply_extra_bl(req, created, extra);
diff --git a/src/mds/Server.h b/src/mds/Server.h
index 53fac0248db..09129a5a23b 100644
--- a/src/mds/Server.h
+++ b/src/mds/Server.h
@@ -25,6 +25,8 @@
 #include "include/Context.h" // for C_GatherBase
 #include "include/mempool.h"
 
+#include "messages/MClientReclaimReply.h"
+
 #ifdef WITH_CRIMSON
 #include "crimson/common/perf_counters_collection.h"
 #else
@@ -68,7 +70,6 @@ class MClientRequest;
 class MClientSession;
 class MClientSnap;
 class MClientReclaim;
-class MClientReclaimReply;
 class MLock;
 class MMDSPeerRequest;
 class filepath;
diff --git a/src/msg/Message.h b/src/msg/Message.h
index b66c8ccafaa..0545ada386d 100644
--- a/src/msg/Message.h
+++ b/src/msg/Message.h
@@ -551,6 +551,16 @@ public:
   void encode(uint64_t features, int crcflags, bool skip_header_crc = false);
 };
 
+inline void intrusive_ptr_add_ref(Message* m)
+{
+  m->get();
+}
+
+inline void intrusive_ptr_release(Message* m)
+{
+  m->put();
+}
+
 extern Message *decode_message(CephContext *cct,
                                int crcflags,
                                ceph_msg_header& header,
diff --git a/src/msg/MessageRef.h b/src/msg/MessageRef.h
index fd66872e727..300fc600b1f 100644
--- a/src/msg/MessageRef.h
+++ b/src/msg/MessageRef.h
@@ -25,9 +25,14 @@ using MConstRef = boost::intrusive_ptr<T const>;
 template<typename T>
 using MURef = std::unique_ptr<T, TOPNSPC::common::UniquePtrDeleter>;
 
-using MessageRef = MRef<class Message>;
-using MessageConstRef = MConstRef<class Message>;
-using MessageURef = MURef<class Message>;
+class Message;
+
+void intrusive_ptr_add_ref(Message* m);
+void intrusive_ptr_release(Message* m);
+
+using MessageRef = MRef<Message>;
+using MessageConstRef = MConstRef<Message>;
+using MessageURef = MURef<Message>;
 
 /* cd src/messages/ && for f in *; do printf 'class '; basename "$f" .h | tr -d '\n'; printf ';\n'; done >> ../msg/MessageRef.h */
 
diff --git a/src/osd/Session.cc b/src/osd/Session.cc
index 454e1b85768..c1c2cc55fe9 100644
--- a/src/osd/Session.cc
+++ b/src/osd/Session.cc
@@ -12,6 +12,17 @@
 using std::map;
 using std::set;
 
+Backoff::Backoff(spg_t pgid, PGRef pg, ceph::ref_t<Session> s,
+                 uint64_t i,
+                 const hobject_t& b, const hobject_t& e)
+: RefCountedObject(g_ceph_context),
+  pgid(pgid),
+  id(i),
+  pg(pg),
+  session(std::move(s)),
+  begin(b),
+  end(e) {}
+
 void Session::clear_backoffs()
 {
   map<spg_t,map<hobject_t,set<ceph::ref_t<Backoff>>>> ls;
diff --git a/src/osd/Session.h b/src/osd/Session.h
index 05a0119d31e..8f7d5160338 100644
--- a/src/osd/Session.h
+++ b/src/osd/Session.h
@@ -115,14 +115,7 @@ private:
   FRIEND_MAKE_REF(Backoff);
   Backoff(spg_t pgid, PGRef pg, ceph::ref_t<Session> s,
 	  uint64_t i,
-	  const hobject_t& b, const hobject_t& e)
-    : RefCountedObject(g_ceph_context),
-      pgid(pgid),
-      id(i),
-      pg(pg),
-      session(std::move(s)),
-      begin(b),
-      end(e) {}
+	  const hobject_t& b, const hobject_t& e);
 };
 
 
diff --git a/src/rgw/driver/rados/rgw_datalog.cc b/src/rgw/driver/rados/rgw_datalog.cc
index 8fe75e8a59a..f56e095b63d 100644
--- a/src/rgw/driver/rados/rgw_datalog.cc
+++ b/src/rgw/driver/rados/rgw_datalog.cc
@@ -122,6 +122,13 @@ void rgw_data_notify_entry::dump(Formatter *f) const
   encode_json("gen", gen, f);
 }
 
+boost::intrusive_ptr<RGWDataChangesBE> DataLogBackends::head() {
+  std::unique_lock l(m);
+  auto i = end();
+  --i;
+  return i->second;
+}
+
 void rgw_data_notify_entry::decode_json(JSONObj *obj) {
   JSONDecoder::decode_json("key", key, obj);
   JSONDecoder::decode_json("gen", gen, obj);
diff --git a/src/rgw/driver/rados/rgw_datalog.h b/src/rgw/driver/rados/rgw_datalog.h
index ae013e2fdef..e77e05f6f45 100644
--- a/src/rgw/driver/rados/rgw_datalog.h
+++ b/src/rgw/driver/rados/rgw_datalog.h
@@ -218,12 +218,7 @@ class DataLogBackends final
 			  shards), datalog(datalog) {}
 public:
 
-  boost::intrusive_ptr<RGWDataChangesBE> head() {
-    std::unique_lock l(m);
-    auto i = end();
-    --i;
-    return i->second;
-  }
+  boost::intrusive_ptr<RGWDataChangesBE> head();
   asio::awaitable<std::tuple<std::span<rgw_data_change_log_entry>,
 			     std::string>>
   list(const DoutPrefixProvider *dpp, int shard,
diff --git a/src/rgw/rgw_sal_config.h b/src/rgw/rgw_sal_config.h
index 7050940220b..c2e7f02e74b 100644
--- a/src/rgw/rgw_sal_config.h
+++ b/src/rgw/rgw_sal_config.h
@@ -15,6 +15,7 @@
 
 #pragma once
 
+#include <cstdint>
 #include <memory>
 #include <optional>
 #include <span>