Skip to content

Commit 1a85d4d

Browse files
committed
mds/QuiesceDbEncoding: add inline to work around linker error
Fixes duplicate symbols because every source that includes this header contains a copy: mold: error: duplicate symbol: lib/libceph-common.a(Message.cc.o): lib/libmds.a(MDSRankQuiesce.cc.o): encode(QuiesceDbVersion const&, ceph::buffer::v15_2_0::list&, unsigned long) mold: error: duplicate symbol: lib/libceph-common.a(Message.cc.o): lib/libmds.a(MDSRankQuiesce.cc.o): encode(QuiesceState const&, ceph::buffer::v15_2_0::list&, unsigned long) (and many more) Signed-off-by: Max Kellermann <[email protected]>
1 parent 531ffdb commit 1a85d4d

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/mds/QuiesceDbEncoding.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,81 +15,81 @@
1515
#include "include/encoding.h"
1616
#include <stdint.h>
1717

18-
void encode(QuiesceDbVersion const& v, bufferlist& bl, uint64_t features = 0)
18+
inline void encode(QuiesceDbVersion const& v, bufferlist& bl, uint64_t features = 0)
1919
{
2020
ENCODE_START(1, 1, bl);
2121
encode(v.epoch, bl, features);
2222
encode(v.set_version, bl, features);
2323
ENCODE_FINISH(bl);
2424
}
2525

26-
void decode(QuiesceDbVersion& v, bufferlist::const_iterator& p)
26+
inline void decode(QuiesceDbVersion& v, bufferlist::const_iterator& p)
2727
{
2828
DECODE_START(1, p);
2929
decode(v.epoch, p);
3030
decode(v.set_version, p);
3131
DECODE_FINISH(p);
3232
}
3333

34-
void encode(QuiesceState const & state, bufferlist& bl, uint64_t features=0)
34+
inline void encode(QuiesceState const & state, bufferlist& bl, uint64_t features=0)
3535
{
3636
static_assert(QuiesceState::QS__MAX <= UINT8_MAX);
3737
uint8_t v = (uint8_t)state;
3838
encode(v, bl, features);
3939
}
4040

41-
void decode(QuiesceState & state, bufferlist::const_iterator& p)
41+
inline void decode(QuiesceState & state, bufferlist::const_iterator& p)
4242
{
4343
uint8_t v = 0;
4444
decode(v, p);
4545
state = (QuiesceState)v;
4646
}
4747

48-
void encode(QuiesceTimeInterval const & interval, bufferlist& bl, uint64_t features=0)
48+
inline void encode(QuiesceTimeInterval const & interval, bufferlist& bl, uint64_t features=0)
4949
{
5050
encode(interval.count(), bl, features);
5151
}
5252

53-
void decode(QuiesceTimeInterval & interval, bufferlist::const_iterator& p)
53+
inline void decode(QuiesceTimeInterval & interval, bufferlist::const_iterator& p)
5454
{
5555
QuiesceClock::rep count;
5656
decode(count, p);
5757
interval = QuiesceTimeInterval { count };
5858
}
5959

60-
void encode(RecordedQuiesceState const& rstate, bufferlist& bl, uint64_t features = 0)
60+
inline void encode(RecordedQuiesceState const& rstate, bufferlist& bl, uint64_t features = 0)
6161
{
6262
ENCODE_START(1, 1, bl);
6363
encode(rstate.state, bl, features);
6464
encode(rstate.at_age.count(), bl, features);
6565
ENCODE_FINISH(bl);
6666
}
6767

68-
void decode(RecordedQuiesceState& rstate, bufferlist::const_iterator& p)
68+
inline void decode(RecordedQuiesceState& rstate, bufferlist::const_iterator& p)
6969
{
7070
DECODE_START(1, p);
7171
decode(rstate.state, p);
7272
decode(rstate.at_age, p);
7373
DECODE_FINISH(p);
7474
}
7575

76-
void encode(QuiesceSet::MemberInfo const& member, bufferlist& bl, uint64_t features = 0)
76+
inline void encode(QuiesceSet::MemberInfo const& member, bufferlist& bl, uint64_t features = 0)
7777
{
7878
ENCODE_START(1, 1, bl);
7979
encode(member.rstate, bl, features);
8080
encode(member.excluded, bl, features);
8181
ENCODE_FINISH(bl);
8282
}
8383

84-
void decode(QuiesceSet::MemberInfo& member, bufferlist::const_iterator& p)
84+
inline void decode(QuiesceSet::MemberInfo& member, bufferlist::const_iterator& p)
8585
{
8686
DECODE_START(1, p);
8787
decode(member.rstate, p);
8888
decode(member.excluded, p);
8989
DECODE_FINISH(p);
9090
}
9191

92-
void encode(QuiesceSet const& set, bufferlist& bl, uint64_t features = 0)
92+
inline void encode(QuiesceSet const& set, bufferlist& bl, uint64_t features = 0)
9393
{
9494
ENCODE_START(1, 1, bl);
9595
encode(set.version, bl, features);
@@ -100,7 +100,7 @@ void encode(QuiesceSet const& set, bufferlist& bl, uint64_t features = 0)
100100
ENCODE_FINISH(bl);
101101
}
102102

103-
void decode(QuiesceSet& set, bufferlist::const_iterator& p)
103+
inline void decode(QuiesceSet& set, bufferlist::const_iterator& p)
104104
{
105105
DECODE_START(1, p);
106106
decode(set.version, p);
@@ -111,7 +111,7 @@ void decode(QuiesceSet& set, bufferlist::const_iterator& p)
111111
DECODE_FINISH(p);
112112
}
113113

114-
void encode(QuiesceDbRequest const& req, bufferlist& bl, uint64_t features = 0)
114+
inline void encode(QuiesceDbRequest const& req, bufferlist& bl, uint64_t features = 0)
115115
{
116116
ENCODE_START(1, 1, bl);
117117
encode(req.control.raw, bl, features);
@@ -124,7 +124,7 @@ void encode(QuiesceDbRequest const& req, bufferlist& bl, uint64_t features = 0)
124124
ENCODE_FINISH(bl);
125125
}
126126

127-
void decode(QuiesceDbRequest& req, bufferlist::const_iterator& p)
127+
inline void decode(QuiesceDbRequest& req, bufferlist::const_iterator& p)
128128
{
129129
DECODE_START(1, p);
130130
decode(req.control.raw, p);
@@ -137,7 +137,7 @@ void decode(QuiesceDbRequest& req, bufferlist::const_iterator& p)
137137
DECODE_FINISH(p);
138138
}
139139

140-
void encode(QuiesceDbListing const& listing, bufferlist& bl, uint64_t features = 0)
140+
inline void encode(QuiesceDbListing const& listing, bufferlist& bl, uint64_t features = 0)
141141
{
142142
ENCODE_START(1, 1, bl);
143143
encode(listing.db_version, bl, features);
@@ -146,7 +146,7 @@ void encode(QuiesceDbListing const& listing, bufferlist& bl, uint64_t features =
146146
ENCODE_FINISH(bl);
147147
}
148148

149-
void decode(QuiesceDbListing& listing, bufferlist::const_iterator& p)
149+
inline void decode(QuiesceDbListing& listing, bufferlist::const_iterator& p)
150150
{
151151
DECODE_START(1, p);
152152
decode(listing.db_version, p);
@@ -155,63 +155,63 @@ void decode(QuiesceDbListing& listing, bufferlist::const_iterator& p)
155155
DECODE_FINISH(p);
156156
}
157157

158-
void encode(QuiesceDbPeerListing const& listing, bufferlist& bl, uint64_t features = 0)
158+
inline void encode(QuiesceDbPeerListing const& listing, bufferlist& bl, uint64_t features = 0)
159159
{
160160
ENCODE_START(1, 1, bl);
161161
encode(listing.origin, bl, features);
162162
encode(listing.db, bl, features);
163163
ENCODE_FINISH(bl);
164164
}
165165

166-
void decode(QuiesceDbPeerListing& listing, bufferlist::const_iterator& p)
166+
inline void decode(QuiesceDbPeerListing& listing, bufferlist::const_iterator& p)
167167
{
168168
DECODE_START(1, p);
169169
decode(listing.origin, p);
170170
decode(listing.db, p);
171171
DECODE_FINISH(p);
172172
}
173173

174-
void encode(QuiesceMap::RootInfo const& root, bufferlist& bl, uint64_t features = 0)
174+
inline void encode(QuiesceMap::RootInfo const& root, bufferlist& bl, uint64_t features = 0)
175175
{
176176
ENCODE_START(1, 1, bl);
177177
encode(root.state, bl, features);
178178
::encode(root.ttl, bl, features);
179179
ENCODE_FINISH(bl);
180180
}
181181

182-
void decode(QuiesceMap::RootInfo& root, bufferlist::const_iterator& p)
182+
inline void decode(QuiesceMap::RootInfo& root, bufferlist::const_iterator& p)
183183
{
184184
DECODE_START(1, p);
185185
decode(root.state, p);
186186
::decode(root.ttl, p);
187187
DECODE_FINISH(p);
188188
}
189189

190-
void encode(QuiesceMap const& map, bufferlist& bl, uint64_t features = 0)
190+
inline void encode(QuiesceMap const& map, bufferlist& bl, uint64_t features = 0)
191191
{
192192
ENCODE_START(1, 1, bl);
193193
encode(map.db_version, bl, features);
194194
encode(map.roots, bl, features);
195195
ENCODE_FINISH(bl);
196196
}
197197

198-
void decode(QuiesceMap& map, bufferlist::const_iterator& p)
198+
inline void decode(QuiesceMap& map, bufferlist::const_iterator& p)
199199
{
200200
DECODE_START(1, p);
201201
decode(map.db_version, p);
202202
decode(map.roots, p);
203203
DECODE_FINISH(p);
204204
}
205205

206-
void encode(QuiesceDbPeerAck const& ack, bufferlist& bl, uint64_t features = 0)
206+
inline void encode(QuiesceDbPeerAck const& ack, bufferlist& bl, uint64_t features = 0)
207207
{
208208
ENCODE_START(1, 1, bl);
209209
encode(ack.origin, bl, features);
210210
encode(ack.diff_map, bl, features);
211211
ENCODE_FINISH(bl);
212212
}
213213

214-
void decode(QuiesceDbPeerAck& ack, bufferlist::const_iterator& p)
214+
inline void decode(QuiesceDbPeerAck& ack, bufferlist::const_iterator& p)
215215
{
216216
DECODE_START(1, p);
217217
decode(ack.origin, p);

0 commit comments

Comments
 (0)