]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: PG::with_locked_obc() doesn't depend on MOSDOp anymore.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 31 Mar 2021 17:47:00 +0000 (17:47 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 12 May 2021 13:26:49 +0000 (13:26 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/ops_executer.h
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 498ec07f6ace82e24cd5a6f1d345f48cbbe89ffe..3e688d16bebb851f5e6dfface2a2036cd5f12a0e 100644 (file)
@@ -86,6 +86,7 @@ public:
   struct ExecutableMessage {
     virtual crimson::net::ConnectionRef get_connection() const = 0;
     virtual osd_reqid_t get_reqid() const = 0;
+    virtual utime_t get_mtime() const = 0;
     virtual epoch_t get_map_epoch() const = 0;
     virtual entity_inst_t get_orig_source_inst() const = 0;
     virtual uint64_t get_features() const = 0;
@@ -103,6 +104,9 @@ public:
     osd_reqid_t get_reqid() const final {
       return pimpl->get_reqid();
     }
+    utime_t get_mtime() const final {
+      return pimpl->get_mtime();
+    };
     epoch_t get_map_epoch() const final {
       return pimpl->get_map_epoch();
     }
@@ -330,7 +334,7 @@ OpsExecuter::flush_changes_n_do_ops_effects(Ref<PG> pg, MutFunc&& mut_func) &&
   auto maybe_mutated = interruptor::make_interruptible(osd_op_errorator::now());
   if (want_mutate) {
     osd_op_params->req_id = msg->get_reqid();
-    //osd_op_params->mtime = msg->get_mtime();
+    osd_op_params->mtime = msg->get_mtime();
     maybe_mutated = std::forward<MutFunc>(mut_func)(std::move(txn),
                                                     std::move(obc),
                                                     std::move(*osd_op_params),
index 2a1e652e137faa9407155a49aaeef327e04657d6..563ce9af481be2933c8cb1c623493e9e3e176f1d 100644 (file)
@@ -182,7 +182,8 @@ ClientRequest::process_op(Ref<PG> &pg)
           [this, pg]() mutable -> PG::load_obc_iertr::future<> {
           logger().debug("{}: got obc lock", *this);
           op_info.set_from_op(&*m, *pg->get_osdmap());
-          return pg->with_locked_obc(m, op_info, [this, pg](auto obc) mutable {
+          return pg->with_locked_obc(m->get_hobj(), op_info,
+                                     [this, pg](auto obc) mutable {
             return with_blocking_future_interruptible<IOInterruptCondition>(
               handle.enter(pp(*pg).process)
             ).then_interruptible([this, pg, obc]() mutable {
index 69e5e4b838ee07fb80775596446e5e8aef3cda9d..35b41fbc2944b87df9fbe9f5dbf2b16887cffbcd 100644 (file)
@@ -1052,13 +1052,14 @@ PG::reload_obc(crimson::osd::ObjectContext& obc) const
 }
 
 PG::load_obc_iertr::future<>
-PG::with_locked_obc(Ref<MOSDOp> &m, const OpInfo &op_info,
-                   with_obc_func_t &&f)
+PG::with_locked_obc(const hobject_t &hobj,
+                    const OpInfo &op_info,
+                    with_obc_func_t &&f)
 {
   if (__builtin_expect(stopping, false)) {
     throw crimson::common::system_shutdown_exception();
   }
-  const hobject_t oid = get_oid(m->get_hobj());
+  const hobject_t oid = get_oid(hobj);
   switch (get_lock_type(op_info)) {
   case RWState::RWREAD:
     if (oid.is_head()) {
index 2af1619690d164446203703303f2a9ae583e43cf..281374e8837f20c5696398213c9e7b0ae8b81971 100644 (file)
@@ -523,7 +523,7 @@ public:
     ObjectContextRef obc,
     with_obc_func_t&& f);
   load_obc_iertr::future<> with_locked_obc(
-    Ref<MOSDOp> &m,
+    const hobject_t &hobj,
     const OpInfo &op_info,
     with_obc_func_t&& f);
 
@@ -769,6 +769,9 @@ struct PG::do_osd_ops_params_t {
   osd_reqid_t get_reqid() const {
     return reqid;
   }
+  utime_t get_mtime() const {
+    return mtime;
+  };
   epoch_t get_map_epoch() const {
     return map_epoch;
   }
@@ -780,6 +783,7 @@ struct PG::do_osd_ops_params_t {
   }
   crimson::net::ConnectionRef conn;
   osd_reqid_t reqid;
+  utime_t mtime;
   epoch_t map_epoch;
   entity_inst_t orig_source_inst;
   uint64_t features;