o->extent_map.punch_hole(c, offset, length, &wctx->old_extents);
// Zero detection -- small block
- if (!bl.is_zero()) {
+ if (!cct->_conf->bluestore_zero_block_detection || !bl.is_zero()) {
BlobRef b = c->new_blob();
_pad_zeros(&bl, &b_off0, min_alloc_size);
wctx->write(offset, b, alloc_len, b_off0, bl, b_off, length, false, true);
o->extent_map.punch_hole(c, offset, length, &wctx->old_extents);
// Zero detection -- small block
- if (!bl.is_zero()) {
+ if (!cct->_conf->bluestore_zero_block_detection || !bl.is_zero()) {
_pad_zeros(&bl, &b_off0, chunk_size);
dout(20) << __func__ << " reuse blob " << *b << std::hex
o->extent_map.punch_hole(c, offset, length, &wctx->old_extents);
// Zero detection -- small block
- if (!bl.is_zero()) {
+ if (!cct->_conf->bluestore_zero_block_detection || !bl.is_zero()) {
uint64_t chunk_size = b->get_blob().get_chunk_size(block_size);
_pad_zeros(&bl, &b_off0, chunk_size);
o->extent_map.punch_hole(c, offset, length, &wctx->old_extents);
// Zero detection -- small block
- if (!bl.is_zero()) {
+ if (!cct->_conf->bluestore_zero_block_detection || !bl.is_zero()) {
// new blob.
BlobRef b = c->new_blob();
_pad_zeros(&bl, &b_off0, block_size);
blp.copy(l, t);
// Zero detection -- big block
- if (!t.is_zero()) {
+ if (!cct->_conf->bluestore_zero_block_detection || !t.is_zero()) {
wctx->write(offset, b, l, b_off, t, b_off, l, false, new_blob);
dout(20) << __func__ << " schedule write big: 0x"
}
TEST_P(StoreTestSpecificAUSize, ZeroBlockDetectionSmallAppend) {
- if (string(GetParam()) != "bluestore") {
- return;
+ CephContext *cct = (new CephContext(CEPH_ENTITY_TYPE_CLIENT))->get();
+ if (string(GetParam()) != "bluestore" || !cct->_conf->bluestore_zero_block_detection) {
+ GTEST_SKIP() << "not bluestore or bluestore_zero_block_detection=false, skipping";
}
size_t block_size = 65536;
}
TEST_P(StoreTestSpecificAUSize, ZeroBlockDetectionSmallOverwrite) {
- if (string(GetParam()) != "bluestore") {
- return;
+ CephContext *cct = (new CephContext(CEPH_ENTITY_TYPE_CLIENT))->get();
+ if (string(GetParam()) != "bluestore" || !cct->_conf->bluestore_zero_block_detection) {
+ GTEST_SKIP() << "not bluestore or bluestore_zero_block_detection=false, skipping";
}
if (smr) {
cout << "SKIP" << std::endl;
}
TEST_P(StoreTestSpecificAUSize, ZeroBlockDetectionBigAppend) {
- if (string(GetParam()) != "bluestore") {
- return;
+ CephContext *cct = (new CephContext(CEPH_ENTITY_TYPE_CLIENT))->get();
+ if (string(GetParam()) != "bluestore" || !cct->_conf->bluestore_zero_block_detection) {
+ GTEST_SKIP() << "not bluestore or bluestore_zero_block_detection=false, skipping";
}
size_t block_size = 4096;
}
TEST_P(StoreTestSpecificAUSize, ZeroBlockDetectionBigOverwrite) {
- if (string(GetParam()) != "bluestore") {
- return;
+ CephContext *cct = (new CephContext(CEPH_ENTITY_TYPE_CLIENT))->get();
+ if (string(GetParam()) != "bluestore" || !cct->_conf->bluestore_zero_block_detection) {
+ GTEST_SKIP() << "not bluestore or bluestore_zero_block_detection=false, skipping";
}
if (smr) {
cout << "SKIP" << std::endl;