using crimson::os::seastore::omap_manager::BtreeOMapManager;
-SeaStore::Shard::_omap_get_value_ret
+SeaStore::Shard::omaptree_get_value_ret
SeaStore::Shard::_get_attr(
Transaction& t,
Onode& onode,
return seastar::make_ready_future<ceph::bufferlist>(std::move(bl));
}
DEBUGT("name={} ...", t, name);
- return _omap_get_value(t, get_omap_root(omap_type_t::XATTR, onode), name);
+ return omaptree_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();
- return do_omap_get_values(
- t, std::nullopt, get_omap_root(omap_type_t::XATTR, onode)
+ return omaptree_get_values(
+ t, get_omap_root(omap_type_t::XATTR, onode), std::nullopt
).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 r = select_log_omap_root(onode);
omap_root_t root = r.get(onode.get_metadata_hint(device->get_block_size()));
- return _omap_get_values(t, std::move(root), keys);
+ return omaptree_get_values(
+ t, std::move(root), keys);
}).finally([this] {
assert(shard_stats.pending_read_num);
--(shard_stats.pending_read_num);
});
}
-SeaStore::Shard::_omap_get_value_ret
-SeaStore::Shard::_omap_get_value(
+SeaStore::Shard::omaptree_get_value_ret
+SeaStore::Shard::omaptree_get_value(
Transaction& t,
omap_root_t&& root,
std::string_view key) const
BtreeOMapManager(*transaction_manager),
std::move(root),
std::string(key),
- [&t](auto &manager, auto& root, auto& key) -> _omap_get_value_ret
+ [&t](auto &manager, auto& root, auto& key) -> omaptree_get_value_ret
{
- LOG_PREFIX(SeaStoreS::_omap_get_value);
+ LOG_PREFIX(SeaStoreS::omaptree_get_value);
if (root.is_null()) {
DEBUGT("key={} is absent because of null root", t, key);
return crimson::ct_error::enodata::make();
}
return manager.omap_get_value(root, t, key
- ).si_then([&key, &t, FNAME](auto opt) -> _omap_get_value_ret {
+ ).si_then([&key, &t, FNAME](auto opt) -> omaptree_get_value_ret {
if (!opt) {
DEBUGT("key={} is absent", t, key);
return crimson::ct_error::enodata::make();
}
SeaStore::base_iertr::future<SeaStore::Shard::omap_values_t>
-SeaStore::Shard::_omap_get_values(
+SeaStore::Shard::omaptree_get_values(
Transaction& t,
omap_root_t&& root,
const omap_keys_t& keys) const
{
- LOG_PREFIX(SeaStoreS::_omap_get_values);
+ LOG_PREFIX(SeaStoreS::omaptree_get_values);
if (root.is_null()) {
DEBUGT("{} keys are absent because of null root", t, keys.size());
return seastar::make_ready_future<omap_values_t>();
});
}
-SeaStore::Shard::omap_list_ret
-SeaStore::Shard::omap_list(
- omap_root_t&& root,
+SeaStore::Shard::omaptree_list_ret
+SeaStore::Shard::omaptree_list(
Transaction& t,
+ omap_root_t&& root,
const std::optional<std::string>& start,
OMapManager::omap_list_config_t config) const
{
if (root.is_null()) {
- return seastar::make_ready_future<omap_list_bare_ret>(
+ return seastar::make_ready_future<omaptree_list_bare_ret>(
true, omap_values_t{}
);
}
}
SeaStore::base_iertr::future<SeaStore::Shard::omap_values_paged_t>
-SeaStore::Shard::do_omap_get_values(
+SeaStore::Shard::omaptree_get_values(
Transaction& t,
- const std::optional<std::string>& start,
- omap_root_t&& root) const
+ omap_root_t&& root,
+ const std::optional<std::string>& start) const
{
- LOG_PREFIX(SeaStoreS::do_omap_get_values);
+ LOG_PREFIX(SeaStoreS::omaptree_get_values);
DEBUGT("start={} type={} ...", t, start.has_value() ? *start : "",
root.get_type());
auto config = OMapManager::omap_list_config_t()
.with_inclusive(false, false)
.without_max();
- return omap_list(std::move(root), t, start, config
+ return omaptree_list(t, std::move(root), start, config
).si_then([FNAME, &t](omap_values_paged_t ret) {
DEBUGT("got {} values, complete={}",
t, std::get<1>(ret).size(), std::get<0>(ret));
{
auto root = select_log_omap_root(onode).get(
onode.get_metadata_hint(device->get_block_size()));
- return do_omap_get_values(
- t, start, std::move(root));
+ return omaptree_get_values(
+ t, std::move(root), start);
}).finally([this] {
assert(shard_stats.pending_read_num);
--(shard_stats.pending_read_num);
onode->get_metadata_hint(device->get_block_size()));
DEBUGT("op OMAP_SETKEYS, oid={}, omap size={}, type={} ...",
*ctx.transaction, oid, aset.size(), root.get_type());
- return _omap_set_values(
+ return omaptree_set_keys(
*ctx.transaction,
+ std::move(root),
*onode,
- std::move(aset),
- std::move(root));
+ std::move(aset));
}
case Transaction::OP_OMAP_SETHEADER:
{
onode->get_metadata_hint(device->get_block_size()));
DEBUGT("op OMAP_RMKEYS, oid={}, omap size={}, type={} ...",
*ctx.transaction, oid, keys.size(), root.get_type());
- return _omap_rmkeys(
+ return omaptree_rm_keys(
*ctx.transaction,
+ std::move(root),
*onode,
- std::move(keys),
- std::move(root));
+ std::move(keys));
}
case Transaction::OP_OMAP_RMKEYRANGE:
{
onode->get_metadata_hint(device->get_block_size()));
DEBUGT("op OMAP_RMKEYRANGE, oid={}, first={}, last={}, type={}...",
*ctx.transaction, oid, first, last, root.get_type());
- return _omap_rmkeyrange(
+ return omaptree_rm_keyrange(
*ctx.transaction,
+ std::move(root),
*onode,
- std::move(first), std::move(last),
- std::move(root));
+ std::move(first), std::move(last));
}
case Transaction::OP_OMAP_CLEAR:
{
});
}
-SeaStore::Shard::tm_ret
-SeaStore::Shard::_clone_omaps(
+SeaStore::base_iertr::future<>
+SeaStore::Shard::omaptree_clone(
Transaction& t,
+ omap_type_t type,
Onode& onode,
- Onode& d_onode,
- const omap_type_t type)
+ Onode& d_onode)
{
return trans_intr::repeat([&t, &onode, &d_onode, this, type] {
return seastar::do_with(
{
auto config = OMapManager::omap_list_config_t()
.with_inclusive(false, false);
- return omap_list(get_omap_root(type, onode), t, start, config
+ return omaptree_list(t, get_omap_root(type, onode), start, config
).si_then([&t, &d_onode, this, type, &start](auto p) {
auto complete = std::get<0>(p);
auto &attrs = std::get<1>(p);
if (attrs.empty()) {
assert(complete);
- return tm_iertr::make_ready_future<
+ return base_iertr::make_ready_future<
seastar::stop_iteration>(
seastar::stop_iteration::yes);
}
std::string nstart = attrs.rbegin()->first;
- return _omap_set_values(
+ return omaptree_set_keys(
t,
+ get_omap_root(type, d_onode),
d_onode,
- std::map<std::string, ceph::bufferlist>(attrs.begin(), attrs.end()),
- get_omap_root(type, d_onode)
+ std::map<std::string, ceph::bufferlist>(attrs.begin(), attrs.end())
).si_then([complete, nstart=std::move(nstart), &start]() mutable {
if (complete) {
return seastar::make_ready_future<
onode,
&d_onode});
}).si_then([&ctx, &onode, &d_onode, this] {
- return _clone_omaps(
- *ctx.transaction, onode, d_onode, omap_type_t::XATTR);
+ return omaptree_clone(
+ *ctx.transaction, omap_type_t::XATTR, onode, d_onode);
}).si_then([&ctx, &onode, &d_onode, this] {
- return _clone_omaps(
- *ctx.transaction, onode, d_onode, omap_type_t::OMAP);
+ return omaptree_clone(
+ *ctx.transaction, omap_type_t::OMAP, onode, d_onode);
}).si_then([&ctx, &onode, &d_onode, this] {
- return _clone_omaps(
- *ctx.transaction, onode, d_onode, omap_type_t::LOG);
+ return omaptree_clone(
+ *ctx.transaction, omap_type_t::LOG, onode, d_onode);
});
}
});
}
-SeaStore::Shard::tm_ret
-SeaStore::Shard::_omap_set_values(
+SeaStore::base_iertr::future<>
+SeaStore::Shard::omaptree_set_keys(
Transaction& t,
+ omap_root_t&& root,
Onode& onode,
- std::map<std::string, ceph::bufferlist> &&kvs,
- omap_root_t&& root)
+ std::map<std::string, ceph::bufferlist>&& kvs)
{
return seastar::do_with(
BtreeOMapManager(*transaction_manager),
(auto &omap_manager, auto &root) mutable
{
assert(root.get_type() < omap_type_t::NONE);
- tm_iertr::future<> maybe_create_root = tm_iertr::now();
+ base_iertr::future<> maybe_create_root = base_iertr::now();
if (root.is_null()) {
maybe_create_root = omap_manager.initialize_omap(t,
onode.get_metadata_hint(device->get_block_size()),
).si_then([&t, &root, &omap_manager, kvs=std::move(kvs)]() mutable {
return omap_manager.omap_set_keys(root, t, std::move(kvs));
}).si_then([&root] {
- return tm_iertr::make_ready_future<omap_root_t>(std::move(root));
+ return base_iertr::make_ready_future<omap_root_t>(std::move(root));
});
}).si_then([&onode, &t](auto root) {
if (root.must_update()) {
internal_context_t &ctx,
Onode &onode)
{
- return _xattr_rmattr(
+ return omaptree_rm_key(
*ctx.transaction,
get_omap_root(omap_type_t::XATTR, onode),
onode,
});
}
-SeaStore::Shard::tm_ret
-SeaStore::Shard::_omap_rmkeys(
- Transaction &t,
+SeaStore::base_iertr::future<>
+SeaStore::Shard::omaptree_rm_keys(
+ Transaction& t,
+ omap_root_t&& root,
Onode& onode,
- omap_keys_t &&keys,
- omap_root_t&& root)
+ omap_keys_t&& keys)
{
if (root.is_null()) {
return seastar::now();
});
}
-SeaStore::Shard::tm_ret
-SeaStore::Shard::_omap_rmkeyrange(
+SeaStore::base_iertr::future<>
+SeaStore::Shard::omaptree_rm_keyrange(
Transaction& t,
+ omap_root_t&& root,
Onode& onode,
std::string first,
- std::string last,
- omap_root_t &&root)
+ std::string last)
{
if (first > last) {
LOG_PREFIX(SeaStoreS::_omap_rmkeyrange);
if (!layout.oi_size) {
// if oi was not in the layout, it probably exists in the omap,
// need to remove it first
- fut = _xattr_rmattr(
+ fut = omaptree_rm_key(
*ctx.transaction,
get_omap_root(omap_type_t::XATTR, onode),
onode,
if (likely(val.length() <= onode_layout_t::MAX_SS_LENGTH)) {
if (!layout.ss_size) {
- fut = _xattr_rmattr(
+ fut = omaptree_rm_key(
*ctx.transaction,
get_omap_root(omap_type_t::XATTR, onode),
onode,
DEBUGT("set attrs in omap", *ctx.transaction);
return std::move(fut
).si_then([this, &onode, &ctx, aset=std::move(aset)]() mutable {
- return _omap_set_values(
+ return omaptree_set_keys(
*ctx.transaction,
+ get_omap_root(omap_type_t::XATTR, onode),
onode,
- std::move(aset),
- get_omap_root(omap_type_t::XATTR, onode));
+ std::move(aset));
});
}
onode.clear_snapset(*ctx.transaction);
return tm_iertr::now();
} else {
- return _xattr_rmattr(
+ return omaptree_rm_key(
*ctx.transaction,
get_omap_root(omap_type_t::XATTR, onode),
onode,
}
}
-SeaStore::Shard::tm_ret
-SeaStore::Shard::_xattr_rmattr(
+SeaStore::base_iertr::future<>
+SeaStore::Shard::omaptree_rm_key(
Transaction& t,
omap_root_t&& root,
Onode& onode,
- std::string &&name)
+ std::string&& name)
{
if (root.is_null()) {
return base_iertr::now();
});
}
- using omap_list_bare_ret = OMapManager::omap_list_bare_ret;
- using omap_list_ret = OMapManager::omap_list_ret;
- omap_list_ret omap_list(
- omap_root_t&& omap_root,
- Transaction& t,
- const std::optional<std::string>& start,
- OMapManager::omap_list_config_t config) const;
-
- using _omap_get_value_iertr = base_iertr::extend<
- crimson::ct_error::enodata
- >;
- using _omap_get_value_ret = _omap_get_value_iertr::future<ceph::bufferlist>;
- _omap_get_value_ret _omap_get_value(
- Transaction &t,
- omap_root_t &&root,
- std::string_view key) const;
-
- base_iertr::future<omap_values_t> _omap_get_values(
- Transaction &t,
- omap_root_t &&root,
- const omap_keys_t &keys) const;
-
friend class SeaStoreOmapIterator;
base_iertr::future<ceph::bufferlist> _read(
std::size_t len,
uint32_t op_flags);
- _omap_get_value_ret _get_attr(
+ using omaptree_get_value_iertr = base_iertr::extend<
+ crimson::ct_error::enodata
+ >;
+ using omaptree_get_value_ret = omaptree_get_value_iertr::future<ceph::bufferlist>;
+ omaptree_get_value_ret _get_attr(
Transaction& t,
Onode& onode,
std::string_view name) const;
Onode& onode,
const ghobject_t& oid);
- base_iertr::future<omap_values_paged_t> do_omap_get_values(
- Transaction& t,
- const std::optional<std::string>& start,
- omap_root_t&& omap_root) const;
-
base_iertr::future<fiemap_ret_t> _fiemap(
Transaction &t,
Onode &onode,
uint64_t offset, size_t len,
ceph::bufferlist &&bl,
uint32_t fadvise_flags);
- tm_ret _clone_omaps(
- Transaction &t,
- Onode &onode,
- Onode &d_onode,
- const omap_type_t otype);
tm_ret _clone(
internal_context_t &ctx,
Onode &onode,
internal_context_t &ctx,
Onode &onode,
objaddr_t offset, extent_len_t len);
- tm_ret _omap_set_values(
- Transaction &t,
- Onode &onode,
- std::map<std::string, ceph::bufferlist> &&aset,
- omap_root_t&& omap_root);
tm_ret _omap_set_header(
internal_context_t &ctx,
Onode &onode,
tm_ret _omap_clear(
internal_context_t &ctx,
Onode &onode);
- tm_ret _omap_rmkeys(
- Transaction &t,
- Onode &onode,
- omap_keys_t &&aset,
- omap_root_t &&_omap_root);
- tm_ret _omap_rmkeyrange(
- Transaction &t,
- Onode &onode,
- std::string first,
- std::string last,
- omap_root_t &&_omap_root);
tm_ret _truncate(
internal_context_t &ctx,
Onode &onode, uint64_t size);
tm_ret _rmattrs(
internal_context_t &ctx,
Onode &onode);
- tm_ret _xattr_rmattr(
- Transaction &t,
- omap_root_t&& root,
- Onode &onode,
- std::string &&name);
tm_ret _create_collection(
internal_context_t &ctx,
const coll_t& cid, int bits);
return onode.get_root(type, device->get_block_size());
}
+ omaptree_get_value_ret omaptree_get_value(
+ Transaction& t,
+ omap_root_t&& root,
+ std::string_view key) const;
+
+ using omaptree_list_bare_ret = OMapManager::omap_list_bare_ret;
+ using omaptree_list_ret = OMapManager::omap_list_ret;
+ omaptree_list_ret omaptree_list(
+ Transaction& t,
+ omap_root_t&& root,
+ const std::optional<std::string>& start,
+ OMapManager::omap_list_config_t config) const;
+
+ base_iertr::future<omap_values_t> omaptree_get_values(
+ Transaction& t,
+ omap_root_t&& root,
+ const omap_keys_t& keys) const;
+
+ base_iertr::future<omap_values_paged_t> omaptree_get_values(
+ Transaction& t,
+ omap_root_t&& root,
+ const std::optional<std::string>& start) const;
+
+ base_iertr::future<> omaptree_set_keys(
+ Transaction& t,
+ omap_root_t&& root,
+ Onode& onode,
+ std::map<std::string, ceph::bufferlist>&& aset);
+
+ base_iertr::future<> omaptree_rm_key(
+ Transaction& t,
+ omap_root_t&& root,
+ Onode& onode,
+ std::string&& name);
+
+ base_iertr::future<> omaptree_rm_keys(
+ Transaction& t,
+ omap_root_t&& root,
+ Onode& onode,
+ omap_keys_t&& aset);
+
+ base_iertr::future<> omaptree_rm_keyrange(
+ Transaction& t,
+ omap_root_t&& root,
+ Onode& onode,
+ std::string first,
+ std::string last);
+
+ base_iertr::future<> omaptree_clone(
+ Transaction& t,
+ omap_type_t type,
+ Onode& onode,
+ Onode& d_onode);
+
base_iertr::future<omap_root_t> omaptree_do_clear(
Transaction& t,
omap_root_t&& root);