return seastar::make_ready_future<ceph::bufferlist>(std::move(bl));
}
DEBUGT("name={} ...", t, name);
- return _omap_get_value(
- t,
- layout.xattr_root.get(
- onode.get_metadata_hint(device->get_block_size())),
- name);
+ return _omap_get_value(t, get_omap_root(omap_type_t::XATTR, onode), name);
}
SeaStore::Shard::get_attr_errorator::future<ceph::bufferlist>
LOG_PREFIX(SeaStoreS::_get_attrs);
DEBUGT("...", t);
auto& layout = onode.get_layout();
- auto root = onode.get_layout().xattr_root.get(
- onode.get_metadata_hint(device->get_block_size()));
return do_omap_get_values(
- t, onode, std::nullopt, std::move(root)
+ t, onode, std::nullopt, get_omap_root(omap_type_t::XATTR, onode)
).si_then([&layout, &t, FNAME](auto p) {
auto& attrs = std::get<1>(p);
DEBUGT("got {} attrs, OI length=0x{:x}, SS length=0x{:x}",
{
auto olayout = onode->get_layout();
uint32_t size = olayout.size;
- auto omap_root = olayout.omap_root.get(
- d_onode->get_metadata_hint(device->get_block_size()));
- auto xattr_root = olayout.xattr_root.get(
- d_onode->get_metadata_hint(device->get_block_size()));
- auto log_root = olayout.log_root.get(
- d_onode->get_metadata_hint(device->get_block_size()));
+ auto omap_root = get_omap_root(omap_type_t::OMAP, *onode);
+ auto xattr_root = get_omap_root(omap_type_t::XATTR, *onode);
+ auto log_root = get_omap_root(omap_type_t::LOG, *onode);
auto object_data = olayout.object_data.get();
auto oi_bl = ceph::bufferlist::static_from_mem(
&olayout.oi[0],
{
return omaptree_clear_no_onode(
*ctx.transaction,
- onode->get_layout().omap_root.get(
- onode->get_metadata_hint(device->get_block_size()))
+ get_omap_root(omap_type_t::OMAP, *onode)
).si_then([this, &ctx, &onode] {
return omaptree_clear_no_onode(
*ctx.transaction,
- onode->get_layout().xattr_root.get(
- onode->get_metadata_hint(device->get_block_size())));
+ get_omap_root(omap_type_t::XATTR, *onode));
}).si_then([this, &ctx, &onode] {
return omaptree_clear_no_onode(
*ctx.transaction,
- onode->get_layout().log_root.get(
- onode->get_metadata_hint(device->get_block_size())));
+ get_omap_root(omap_type_t::LOG, *onode));
}).si_then([this, &ctx, &onode] {
return seastar::do_with(
ObjectDataHandler(max_object_size),
{
auto config = OMapManager::omap_list_config_t()
.with_inclusive(false, false);
- auto root = onode->get_layout().get_root(type).get(
- onode->get_metadata_hint(device->get_block_size()));
- return omap_list(
- *onode,
- std::move(root),
- *ctx.transaction,
- start,
- config
+ return omap_list(*onode, get_omap_root(type, *onode), *ctx.transaction, start, config
).si_then([&ctx, &onode, &d_onode, this, type, &start](auto p) {
auto complete = std::get<0>(p);
auto &attrs = std::get<1>(p);
seastar::stop_iteration::yes);
}
std::string nstart = attrs.rbegin()->first;
- auto root = d_onode->get_layout().get_root(type).get(
- d_onode->get_metadata_hint(device->get_block_size()));
return _omap_set_values(
ctx,
d_onode,
std::map<std::string, ceph::bufferlist>(attrs.begin(), attrs.end()),
- std::move(root)
+ get_omap_root(type, *d_onode)
).si_then([complete, nstart=std::move(nstart), &start]() mutable {
if (complete) {
return seastar::make_ready_future<
{
return _xattr_rmattr(
ctx,
+ get_omap_root(omap_type_t::XATTR, *onode),
onode,
std::string(OMAP_HEADER_XATTR_KEY)
).si_then([this, &ctx, &onode] {
- auto root = onode->get_layout().omap_root.get(
- onode->get_metadata_hint(device->get_block_size()));
return omaptree_clear(
*ctx.transaction,
- std::move(root),
+ get_omap_root(omap_type_t::OMAP, *onode),
*onode);
});
}
// need to remove it first
fut = _xattr_rmattr(
ctx,
+ get_omap_root(omap_type_t::XATTR, *onode),
onode,
OI_ATTR);
}
if (!layout.ss_size) {
fut = _xattr_rmattr(
ctx,
+ get_omap_root(omap_type_t::XATTR, *onode),
onode,
SS_ATTR);
}
DEBUGT("set attrs in omap", *ctx.transaction);
return std::move(fut
).si_then([this, onode, &ctx, aset=std::move(aset)]() mutable {
- auto root = onode->get_layout().xattr_root.get(
- onode->get_metadata_hint(device->get_block_size()));
return _omap_set_values(
ctx,
onode,
std::move(aset),
- std::move(root));
+ get_omap_root(omap_type_t::XATTR, *onode));
});
}
} else {
return _xattr_rmattr(
ctx,
+ get_omap_root(omap_type_t::XATTR, *onode),
onode,
std::move(name));
}
SeaStore::Shard::tm_ret
SeaStore::Shard::_xattr_rmattr(
internal_context_t &ctx,
+ omap_root_t&& root,
OnodeRef &onode,
std::string &&name)
{
LOG_PREFIX(SeaStoreS::_xattr_rmattr);
DEBUGT("onode={}", *ctx.transaction, *onode);
- auto root = onode->get_layout().xattr_root.get(
- onode->get_metadata_hint(device->get_block_size()));
if (root.is_null()) {
return base_iertr::now();
}
{
onode->clear_object_info(*ctx.transaction);
onode->clear_snapset(*ctx.transaction);
- auto root = onode->get_layout().xattr_root.get(
- onode->get_metadata_hint(device->get_block_size()));
return omaptree_clear(
*ctx.transaction,
- std::move(root),
+ get_omap_root(omap_type_t::XATTR, *onode),
*onode);
}