]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/alienstore: return attrs retrieved from bluestore directly 42054/head
authorKefu Chai <kchai@redhat.com>
Tue, 29 Jun 2021 04:01:20 +0000 (12:01 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 29 Jun 2021 11:27:25 +0000 (11:27 +0000)
since ObjectStore returns a map<...,less<>> already, there is not point to
convert the returned map to the type expected by AlienStore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/alienstore/alien_store.cc
src/crimson/osd/replicated_recovery_backend.cc
src/crimson/osd/replicated_recovery_backend.h

index aa9758147df0cb9ba3c626e58b885650c3a895f1..091e438466c5ea488536c5c2fad0d2da86d48961 100644 (file)
@@ -338,13 +338,7 @@ AlienStore::get_attrs(CollectionRef ch,
   return seastar::do_with(attrs_t{}, [=] (auto &aset) {
     return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, &aset] {
       auto c = static_cast<AlienCollection*>(ch.get());
-      std::map<std::string, ceph::bufferptr> blueaset;
-      const auto r = store->getattrs(c->collection, oid, blueaset);
-      for (auto& [bluekey, blueval] : blueaset) {
-        ceph::bufferlist bl;
-        bl.push_back(std::move(blueval));
-        aset.emplace(std::move(bluekey), std::move(bl));
-      }
+      const auto r = store->getattrs(c->collection, oid, aset);
       return r;
     }).then([&aset] (int r) -> get_attrs_ertr::future<attrs_t> {
       if (r == -ENOENT) {
index 79e39c6fed3ef313cc030f9d1d0acff31cd4affe..927551d07681907d9b8b43f6ab339e2378a79454 100644 (file)
@@ -927,7 +927,7 @@ ReplicatedRecoveryBackend::prep_push_target(
   bool complete,
   bool clear_omap,
   ObjectStore::Transaction* t,
-  const map<string, bufferlist>& attrs,
+  const map<string, bufferlist, less<>>& attrs,
   bufferlist&& omap_header)
 {
   if (!first) {
@@ -1003,7 +1003,7 @@ ReplicatedRecoveryBackend::submit_push_data(
   interval_set<uint64_t>&& intervals_included,
   bufferlist&& data_included,
   bufferlist&& omap_header,
-  const map<string, bufferlist> &attrs,
+  const map<string, bufferlist, less<>> &attrs,
   map<string, bufferlist>&& omap_entries,
   ObjectStore::Transaction *t)
 {
index 55cd0f17861bdd99785ec2506ecbf16d4cc1fc32..1d9b6042b9b18e23d1d509715159fecb309a12db 100644 (file)
@@ -82,7 +82,7 @@ protected:
     interval_set<uint64_t>&& intervals_included,
     ceph::bufferlist&& data_included,
     ceph::bufferlist&& omap_header,
-    const std::map<string, bufferlist> &attrs,
+    const std::map<std::string, bufferlist, std::less<>> &attrs,
     std::map<string, bufferlist>&& omap_entries,
     ceph::os::Transaction *t);
   void submit_push_complete(
@@ -161,7 +161,7 @@ private:
     bool complete,
     bool clear_omap,
     ObjectStore::Transaction* t,
-    const map<string, bufferlist> &attrs,
+    const std::map<std::string, bufferlist, std::less<>> &attrs,
     bufferlist&& omap_header);
   using interruptor = crimson::interruptible::interruptor<
     crimson::osd::IOInterruptCondition>;