boost::thread_unsafe_counter>
{
using ObjectRef = boost::intrusive_ptr<Object>;
- const coll_t cid;
int bits = 0;
// always use bufferlist object for testing
bool use_page_set = false;
void encode(bufferlist& bl) const;
void decode(bufferlist::const_iterator& p);
+private:
+ const coll_t cid;
};
using CollectionRef = boost::intrusive_ptr<Collection>;
uint64_t limit) const
{
logger().debug("{} {} {} {} {}",
- __func__, c->cid, start, end, limit);
+ __func__, c->get_cid(), start, end, limit);
std::vector<ghobject_t> objects;
objects.reserve(limit);
ghobject_t next = ghobject_t::get_max();
uint32_t op_flags)
{
logger().debug("{} {} {} {}~{}",
- __func__, c->cid, oid, offset, len);
+ __func__, c->get_cid(), oid, offset, len);
if (!c->exists) {
- throw std::runtime_error(fmt::format("collection does not exist: {}", c->cid));
+ throw std::runtime_error(fmt::format("collection does not exist: {}",
+ c->get_cid()));
}
ObjectRef o = c->get_object(oid);
if (!o) {
std::string_view name) const
{
logger().debug("{} {} {}",
- __func__, c->cid, oid);
+ __func__, c->get_cid(), oid);
auto o = c->get_object(oid);
if (!o) {
return seastar::make_exception_future<ceph::bufferptr>(
const ghobject_t& oid)
{
logger().debug("{} {} {}",
- __func__, c->cid, oid);
+ __func__, c->get_cid(), oid);
auto o = c->get_object(oid);
if (!o) {
throw std::runtime_error(fmt::format("object does not exist: {}", oid));
const omap_keys_t& keys)
{
logger().debug("{} {} {}",
- __func__, c->cid, oid);
+ __func__, c->get_cid(), oid);
auto o = c->get_object(oid);
if (!o) {
throw std::runtime_error(fmt::format("object does not exist: {}", oid));
) {
logger().debug(
"{} {} {}",
- __func__, c->cid, oid);
+ __func__, c->get_cid(), oid);
auto o = c->get_object(oid);
if (!o) {
throw std::runtime_error(fmt::format("object does not exist: {}", oid));
void OSDMeta::create(ceph::os::Transaction& t)
{
- t.create_collection(coll->cid, 0);
+ t.create_collection(coll->get_cid(), 0);
}
void OSDMeta::store_map(ceph::os::Transaction& t,
epoch_t e, const bufferlist& m)
{
- t.write(coll->cid, osdmap_oid(e), 0, m.length(), m);
+ t.write(coll->get_cid(), osdmap_oid(e), 0, m.length(), m);
}
seastar::future<bufferlist> OSDMeta::load_map(epoch_t e)
{
bufferlist bl;
encode(superblock, bl);
- t.write(coll->cid, superblock_oid(), 0, bl.length(), bl);
+ t.write(coll->get_cid(), superblock_oid(), 0, bl.length(), bl);
}
seastar::future<OSDSuperblock> OSDMeta::load_superblock()
ceph::bufferlist osv;
encode(os->oi, osv, 0);
// TODO: get_osdmap()->get_features(CEPH_ENTITY_TYPE_OSD, nullptr));
- txn.setattr(coll->cid, ghobject_t{os->oi.soid}, OI_ATTR, osv);
+ txn.setattr(coll->get_cid(), ghobject_t{os->oi.soid}, OI_ATTR, osv);
}
} else {
// reset cached ObjectState without enforcing eviction
os.exists = true;
os.oi.new_object();
- txn.touch(coll->cid, ghobject_t{os.oi.soid});
+ txn.touch(coll->get_cid(), ghobject_t{os.oi.soid});
// TODO: delta_stats.num_objects++
return false;
} else if (os.oi.is_whiteout()) {
} else if (op.extent.truncate_seq > seq) {
// write arrives before trimtrunc
if (os.exists && !os.oi.is_whiteout()) {
- txn.truncate(coll->cid, ghobject_t{os.oi.soid}, op.extent.truncate_size);
+ txn.truncate(coll->get_cid(),
+ ghobject_t{os.oi.soid}, op.extent.truncate_size);
}
os.oi.truncate_seq = op.extent.truncate_seq;
os.oi.truncate_size = op.extent.truncate_size;
maybe_create_new_object(os, txn);
if (length == 0) {
if (offset > os.oi.size) {
- txn.truncate(coll->cid, ghobject_t{os.oi.soid}, op.extent.offset);
+ txn.truncate(coll->get_cid(), ghobject_t{os.oi.soid}, op.extent.offset);
} else {
txn.nop();
}
} else {
- txn.write(coll->cid, ghobject_t{os.oi.soid},
+ txn.write(coll->get_cid(), ghobject_t{os.oi.soid},
offset, length, std::move(buf), op.flags);
}
return seastar::now();
const bool existing = maybe_create_new_object(os, txn);
if (existing && op.extent.length < os.oi.size) {
- txn.truncate(coll->cid, ghobject_t{os.oi.soid}, op.extent.length);
+ txn.truncate(coll->get_cid(), ghobject_t{os.oi.soid}, op.extent.length);
}
if (op.extent.length) {
- txn.write(coll->cid, ghobject_t{os.oi.soid}, 0, op.extent.length,
+ txn.write(coll->get_cid(), ghobject_t{os.oi.soid}, 0, op.extent.length,
osd_op.indata, op.flags);
os.oi.size = op.extent.length;
}
ceph::os::Transaction& txn)
{
// todo: snapset
- txn.remove(coll->cid, ghobject_t{os.oi.soid, ghobject_t::NO_GEN, shard});
+ txn.remove(coll->get_cid(),
+ ghobject_t{os.oi.soid, ghobject_t::NO_GEN, shard});
os.oi.size = 0;
os.oi.new_object();
os.exists = false;
bp.copy(osd_op.op.xattr.value_len, val);
}
- txn.setattr(coll->cid, ghobject_t{os.oi.soid}, name, val);
+ txn.setattr(coll->get_cid(), ghobject_t{os.oi.soid}, name, val);
return seastar::now();
//ctx->delta_stats.num_wr++;
}
const DoutPrefixProvider *dpp = nullptr
) {
ldpp_dout(dpp, 20) << "read_log_and_missing coll "
- << ch->cid
+ << ch->get_cid()
<< " " << pgmeta_oid << dendl;
return (new FuturizedStoreLogReader<missing_type>{
store, ch, info, log, missing, pgmeta_oid, dpp})->start();