while (length > 0) {
int64_t blob;
bluestore_blob_t *b = o->onode.add_blob(&blob);
- b->length = MIN(max_blob_len, length);
+ auto l = b->length = MIN(max_blob_len, length);
bufferlist t;
- blp.copy(b->length, t);
+ blp.copy(l, t);
wctx->write(b, 0, t);
- o->onode.punch_hole(offset, length, &wctx->lex_old);
- o->onode.extent_map[offset] = bluestore_lextent_t(blob, 0, length, 0);
- b->ref_map.get(0, length);
+ o->onode.punch_hole(offset, l, &wctx->lex_old);
+ o->onode.extent_map[offset] = bluestore_lextent_t(blob, 0, l, 0);
+ b->ref_map.get(0, l);
dout(20) << __func__ << " lex 0x" << std::hex << offset << std::dec << ": "
<< o->onode.extent_map[offset] << dendl;
dout(20) << __func__ << " blob " << *b << dendl;
- offset += b->length;
- length -= b->length;
+ offset += l;
+ length -= l;
}
}
ASSERT_TRUE(newdata.contents_equal(expected));
}
}
+ {
+ ObjectStore::Transaction t;
+ t.remove(cid, hoid);
+ cerr << "Cleaning object" << std::endl;
+ r = apply_transaction(store, &osr, std::move(t));
+ ASSERT_EQ(r, 0);
+ }
+ {
+ g_conf->set_val("bluestore_compression_min_blob_size", "262144");
+ g_ceph_context->_conf->apply_changes(NULL);
+ data.resize(0x10000*6);
+
+ for(size_t i = 0;i < data.size(); i++)
+ data[i] = i / 256;
+ ObjectStore::Transaction t;
+ bufferlist bl, newdata;
+ bl.append(data);
+ t.write(cid, hoid, 0, bl.length(), bl);
+ cerr << "CompressibleData large blob" << std::endl;
+ r = apply_transaction(store, &osr, std::move(t));
+ ASSERT_EQ(r, 0);
+ EXPECT_EQ(store->umount(), 0);
+ EXPECT_EQ(store->mount(), 0);
+ }
+
{
ObjectStore::Transaction t;
t.remove(cid, hoid);