Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: do not use nullptr to calc the size of bluestore_pextent_t #14030

Merged
merged 1 commit into from Mar 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/os/bluestore/bluestore_types.h
Expand Up @@ -165,9 +165,12 @@ struct denc_traits<PExtentVector> {
static constexpr bool featured = false;
static void bound_encode(const PExtentVector& v, size_t& p) {
p += sizeof(uint32_t);
size_t per = 0;
denc(*(bluestore_pextent_t*)nullptr, per);
p += per * v.size();
const auto size = v.size();
if (size) {
size_t per = 0;
denc(v.front(), per);
p += per * size;
}
}
static void encode(const PExtentVector& v,
bufferlist::contiguous_appender& p) {
Expand Down