bit_vector.hpp and bloom_filter.cc to be specific.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
try {
bufferlist::iterator it = bl.begin();
- ::decode(*lock, it);
+ decode(*lock, it);
} catch (const buffer::error &err) {
CLS_ERR("error decoding %s", key.c_str());
return -EIO;
key.append(name);
bufferlist lock_bl;
- ::encode(lock, lock_bl, cls_get_client_features(hctx));
+ encode(lock, lock_bl, cls_get_client_features(hctx));
int r = cls_cxx_setxattr(hctx, key.c_str(), &lock_bl);
if (r < 0)
}
}
}
-WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::locker_info_t)
-WRITE_CLASS_ENCODER(rados::cls::lock::locker_id_t)
-WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::lock_info_t)
#endif
try {
bufferlist::iterator iter = bl.begin();
- ::decode(object_map, iter);
+ decode(object_map, iter);
} catch (const buffer::error &err) {
CLS_ERR("failed to decode object map: %s", err.what());
return -EINVAL;
}
object_map.set_crc_enabled(false);
- ::encode(object_map, *out);
+ encode(object_map, *out);
return 0;
}
BitVector<2> object_map;
try {
bufferlist::iterator iter = in->begin();
- ::decode(object_map, iter);
+ decode(object_map, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
object_map.set_crc_enabled(true);
bufferlist bl;
- ::encode(object_map, bl);
+ encode(object_map, bl);
CLS_LOG(20, "object_map_save: object size=%" PRIu64 ", byte size=%u",
object_map.size(), bl.length());
return cls_cxx_write_full(hctx, &bl);
}
bufferlist map;
- ::encode(object_map, map);
+ encode(object_map, map);
CLS_LOG(20, "object_map_resize: object size=%" PRIu64 ", byte size=%u",
object_count, map.length());
return cls_cxx_write_full(hctx, &map);
if (updated) {
bufferlist bl;
- ::encode(object_map, bl);
+ encode(object_map, bl);
r = cls_cxx_write_full(hctx, &bl);
}
return r;
BitVector<2> src_object_map;
try {
bufferlist::iterator iter = in->begin();
- ::decode(src_object_map, iter);
+ decode(src_object_map, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
if (updated) {
bufferlist bl;
- ::encode(dst_object_map, bl);
+ encode(dst_object_map, bl);
r = cls_cxx_write_full(hctx, &bl);
}
return r;
int object_map_load_finish(bufferlist::iterator *it,
ceph::BitVector<2> *object_map) {
try {
- ::decode(*object_map, *it);
+ decode(*object_map, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
object_map_copy.set_crc_enabled(false);
bufferlist in;
- ::encode(object_map_copy, in);
+ encode(object_map_copy, in);
rados_op->exec("rbd", "object_map_save", in);
}
object_map_copy.set_crc_enabled(false);
bufferlist in;
- ::encode(object_map_copy, in);
+ encode(object_map_copy, in);
rados_op->exec("rbd", "object_map_snap_remove", in);
}
void BitVector<_b>::encode_header(bufferlist& bl) const {
bufferlist header_bl;
ENCODE_START(1, 1, header_bl);
- ::encode(m_size, header_bl);
+ encode(m_size, header_bl);
ENCODE_FINISH(header_bl);
m_header_crc = header_bl.crc32c(0);
- ::encode(header_bl, bl);
+ encode(header_bl, bl);
}
template <uint8_t _b>
void BitVector<_b>::decode_header(bufferlist::iterator& it) {
+ using ceph::decode;
bufferlist header_bl;
- ::decode(header_bl, it);
+ decode(header_bl, it);
bufferlist::iterator header_it = header_bl.begin();
uint64_t size;
DECODE_START(1, header_it);
- ::decode(size, header_it);
+ decode(size, header_it);
DECODE_FINISH(header_it);
resize(size);
template <uint8_t _b>
void BitVector<_b>::encode_footer(bufferlist& bl) const {
+ using ceph::encode;
bufferlist footer_bl;
if (m_crc_enabled) {
- ::encode(m_header_crc, footer_bl);
- ::encode(m_data_crcs, footer_bl);
+ encode(m_header_crc, footer_bl);
+ encode(m_data_crcs, footer_bl);
}
- ::encode(footer_bl, bl);
+ encode(footer_bl, bl);
}
template <uint8_t _b>
void BitVector<_b>::decode_footer(bufferlist::iterator& it) {
+ using ceph::decode;
bufferlist footer_bl;
- ::decode(footer_bl, it);
+ decode(footer_bl, it);
m_crc_enabled = (footer_bl.length() > 0);
if (m_crc_enabled) {
bufferlist::iterator footer_it = footer_bl.begin();
__u32 header_crc;
- ::decode(header_crc, footer_it);
+ decode(header_crc, footer_it);
if (m_header_crc != header_crc) {
throw buffer::malformed_input("incorrect header CRC");
}
uint64_t block_count = (m_data.length() + BLOCK_SIZE - 1) / BLOCK_SIZE;
- ::decode(m_data_crcs, footer_it);
+ decode(m_data_crcs, footer_it);
if (m_data_crcs.size() != block_count) {
throw buffer::malformed_input("invalid data block CRCs");
}
o.push_back(b);
}
-}
WRITE_CLASS_ENCODER(ceph::BitVector<2>)
<< b.get_data() << ")";
return out;
}
+}
#endif // BIT_VECTOR_HPP
void bloom_filter::encode(bufferlist& bl) const
{
ENCODE_START(2, 2, bl);
- ::encode((uint64_t)salt_count_, bl);
- ::encode((uint64_t)insert_count_, bl);
- ::encode((uint64_t)target_element_count_, bl);
- ::encode((uint64_t)random_seed_, bl);
+ encode((uint64_t)salt_count_, bl);
+ encode((uint64_t)insert_count_, bl);
+ encode((uint64_t)target_element_count_, bl);
+ encode((uint64_t)random_seed_, bl);
bufferptr bp((const char*)bit_table_, table_size_);
- ::encode(bp, bl);
+ encode(bp, bl);
ENCODE_FINISH(bl);
}
{
DECODE_START(2, p);
uint64_t v;
- ::decode(v, p);
+ decode(v, p);
salt_count_ = v;
- ::decode(v, p);
+ decode(v, p);
insert_count_ = v;
- ::decode(v, p);
+ decode(v, p);
target_element_count_ = v;
- ::decode(v, p);
+ decode(v, p);
random_seed_ = v;
bufferlist t;
- ::decode(t, p);
+ decode(t, p);
salt_.clear();
generate_unique_salt();
bloom_filter::encode(bl);
uint32_t s = size_list.size();
- ::encode(s, bl);
+ encode(s, bl);
for (std::vector<size_t>::const_iterator p = size_list.begin();
p != size_list.end(); ++p)
- ::encode((uint64_t)*p, bl);
+ encode((uint64_t)*p, bl);
ENCODE_FINISH(bl);
}
bloom_filter::decode(p);
uint32_t s;
- ::decode(s, p);
+ decode(s, p);
size_list.resize(s);
for (unsigned i = 0; i < s; i++) {
uint64_t v;
- ::decode(v, p);
+ decode(v, p);
size_list[i] = v;
}
}
bufferlist bl;
- ::encode(bit_vector, bl);
+ encode(bit_vector, bl);
bit_vector.clear();
bufferlist header_bl;
ASSERT_EQ(bl, updated_bl);
bufferlist::iterator updated_it = updated_bl.begin();
- ::decode(bit_vector, updated_it);
+ decode(bit_vector, updated_it);
}
}
bufferlist::iterator p = bl.begin();
p.seek(seek);
try {
- ::decode(*m_object, p);
+ using ::decode;
+ using ceph::decode;
+ decode(*m_object, p);
}
catch (buffer::error& e) {
return e.what();
: DencoderBase<T>(stray_ok, nondeterministic) {}
void encode(bufferlist& out, uint64_t features) override {
out.clear();
- ::encode(*this->m_object, out);
+ using ::encode;
+ using ceph::encode;
+ encode(*this->m_object, out);
}
};
: DencoderBase<T>(stray_ok, nondeterministic) {}
void encode(bufferlist& out, uint64_t features) override {
out.clear();
- ::encode(*(this->m_object), out, features);
+ using ::encode;
+ using ceph::encode;
+ encode(*(this->m_object), out, features);
}
};
object_map->set_crc_enabled(false);
bufferlist bl;
- ::encode(*object_map, bl);
+ encode(*object_map, bl);
std::string str(bl.c_str(), bl.length());
expect.WillOnce(DoAll(WithArg<5>(CopyInBufferlist(str)), Return(0)));