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: change algorithm of compression header from string to int #10137
Conversation
@@ -5770,7 +5770,9 @@ void BlueStore::_do_write_small( | |||
bdev->aio_write(offset, t, | |||
&txc->ioc, wctx->buffered); | |||
}); | |||
b->blob.calc_csum(b_off, padded); | |||
if (b->blob.csum_type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO no much sense in this fix as calc_csum performs verification by itself - see corresponding switch inside...
c5e61a2
to
cb39a0b
Compare
|
||
return alg; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these all belong in bluestoer_types.h and cc, probably along side CSUM_*
cb39a0b
to
a1af00f
Compare
All fixed. |
@ifed01 look ok to you? |
@@ -621,11 +645,11 @@ struct bluestore_wal_transaction_t { | |||
WRITE_CLASS_ENCODER(bluestore_wal_transaction_t) | |||
|
|||
struct bluestore_compression_header_t { | |||
std::string type; | |||
uint8_t type = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO better use 'type = COM_ALG_NONE' here
a1af00f
to
24a15cb
Compare
@ifed01 See again? |
24a15cb
to
ebff755
Compare
return COMP_ALG_SNAPPY; | ||
if (s == "zlib") | ||
return COMP_ALG_ZLIB; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's about reverse mapping for None ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ifed01 Done, thanks!
The literal description of compression algorithm can vary from various compression types and thus increases the complexity of en/decoding, which as a result can cause chaos. Also it can be more efficient by translating it into a fixed-length type. Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
ebff755
to
1209cb3
Compare
The literal description of compression algorithm can vary from
various compression types and thus increases the complexity of
en/decoding, which as a result can cause chaos. Also it can be
more efficient by translating it into a fixed-length type.
Signed-off-by: xie xingguo xie.xingguo@zte.com.cn