mirror of
https://github.com/ceph/ceph
synced 2024-12-19 18:02:46 +00:00
compressor: Use unqualified encode/decode
This is a portion of the namespace project. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
parent
06aa3dd961
commit
62c97dea24
@ -40,7 +40,7 @@ class LZ4Compressor : public Compressor {
|
||||
unsigned num = src.get_num_buffers();
|
||||
uint32_t origin_len;
|
||||
int compressed_len;
|
||||
::encode((uint32_t)num, dst);
|
||||
encode((uint32_t)num, dst);
|
||||
while (left) {
|
||||
origin_len = p.get_ptr_and_advance(left, &data);
|
||||
compressed_len = LZ4_compress_fast_continue(
|
||||
@ -50,8 +50,8 @@ class LZ4Compressor : public Compressor {
|
||||
return -1;
|
||||
pos += compressed_len;
|
||||
left -= origin_len;
|
||||
::encode(origin_len, dst);
|
||||
::encode((uint32_t)compressed_len, dst);
|
||||
encode(origin_len, dst);
|
||||
encode((uint32_t)compressed_len, dst);
|
||||
}
|
||||
assert(p.end());
|
||||
|
||||
@ -69,12 +69,12 @@ class LZ4Compressor : public Compressor {
|
||||
bufferlist &dst) override {
|
||||
uint32_t count;
|
||||
std::vector<std::pair<uint32_t, uint32_t> > compressed_pairs;
|
||||
::decode(count, p);
|
||||
decode(count, p);
|
||||
compressed_pairs.resize(count);
|
||||
uint32_t total_origin = 0;
|
||||
for (unsigned i = 0; i < count; ++i) {
|
||||
::decode(compressed_pairs[i].first, p);
|
||||
::decode(compressed_pairs[i].second, p);
|
||||
decode(compressed_pairs[i].first, p);
|
||||
decode(compressed_pairs[i].second, p);
|
||||
total_origin += compressed_pairs[i].first;
|
||||
}
|
||||
compressed_len -= (sizeof(uint32_t) + sizeof(uint32_t) * count * 2);
|
||||
|
@ -58,7 +58,7 @@ class ZstdCompressor : public Compressor {
|
||||
ZSTD_freeCStream(s);
|
||||
|
||||
// prefix with decompressed length
|
||||
::encode((uint32_t)src.length(), dst);
|
||||
encode((uint32_t)src.length(), dst);
|
||||
dst.append(outptr, 0, outbuf.pos);
|
||||
return 0;
|
||||
}
|
||||
@ -76,7 +76,7 @@ class ZstdCompressor : public Compressor {
|
||||
}
|
||||
compressed_len -= 4;
|
||||
uint32_t dst_len;
|
||||
::decode(dst_len, p);
|
||||
decode(dst_len, p);
|
||||
|
||||
bufferptr dstptr(dst_len);
|
||||
ZSTD_outBuffer_s outbuf;
|
||||
|
Loading…
Reference in New Issue
Block a user