]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: use seastar::make_ready_future()
authorKefu Chai <kchai@redhat.com>
Wed, 9 Sep 2020 02:08:20 +0000 (10:08 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 9 Sep 2020 04:03:37 +0000 (12:03 +0800)
instead of seastar::now(). as seastar::now() was moved into
seastar/util/laster.hh.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/throttle.cc
src/crimson/net/Interceptor.h
src/crimson/net/Socket.cc
src/crimson/osd/object_context.h
src/crimson/osd/osd_operation.h

index 4ddf77dee227ab7b97f88e93734b488d76f7231a..bd919518107a2e50d81e2354ea5b6f6a49d49cc2 100644 (file)
@@ -27,13 +27,13 @@ int64_t Throttle::put(int64_t c)
 seastar::future<> Throttle::get(size_t c)
 {
   if (!max) {
-    return seastar::now();
+    return seastar::make_ready_future<>();
   }
   return on_free_slots.wait([this, c] {
     return !_should_wait(c);
   }).then([this, c] {
     count += c;
-    return seastar::now();
+    return seastar::make_ready_future<>();
   });
 }
 
index fcd3ea6f469cf89b8e59f853e65089b7af7bbd22..dfa2183ec03a88570d70294c99c392e18031b615 100644 (file)
@@ -59,7 +59,7 @@ class socket_blocker {
   seastar::future<> wait_blocked() {
     ceph_assert(!p_blocked);
     if (p_unblocked) {
-      return seastar::now();
+      return seastar::make_ready_future<>();
     } else {
       p_blocked = seastar::abort_source();
       return seastar::sleep_abortable(10s, *p_blocked).then([] {
index 5fa41e646bc6fabf4df88633e5455bc0c2c71f10..24608b2d802cb0ed6f5dcf5b4e3e70af672f06df 100644 (file)
@@ -133,7 +133,7 @@ seastar::future<> Socket::close() {
     in.close(),
     close_and_handle_errors(out)
   ).then_unpack([] {
-    return seastar::now();
+    return seastar::make_ready_future<>();
   }).handle_exception([] (auto eptr) {
     logger().error("Socket::close(): unexpected exception {}", eptr);
     ceph_abort();
@@ -159,7 +159,7 @@ seastar::future<> Socket::try_trap_pre(bp_action_t& trap) {
    default:
     ceph_abort("unexpected action from trap");
   }
-  return seastar::now();
+  return seastar::make_ready_future<>();
 }
 
 seastar::future<> Socket::try_trap_post(bp_action_t& trap) {
@@ -175,7 +175,7 @@ seastar::future<> Socket::try_trap_post(bp_action_t& trap) {
    default:
     ceph_abort("unexpected action from trap");
   }
-  return seastar::now();
+  return seastar::make_ready_future<>();
 }
 
 void Socket::set_trap(bp_type_t type, bp_action_t action, socket_blocker* blocker_) {
index c7d70c193446c11428a2750a12bb6bd0636ba504..6a2ba9f2c877cf2de722db75565f65afd20d4efd 100644 (file)
@@ -140,10 +140,10 @@ public:
     case RWState::RWEXCL:
       return get_lock(op, [this] { return rwstate.get_excl_lock(); });
     case RWState::RWNONE:
-      return seastar::now();
+      return seastar::make_ready_future<>();
     default:
       ceph_abort_msg("invalid lock type");
-      return seastar::now();
+      return seastar::make_ready_future<>();
     }
   }
 
index d6919ddfc00059bbc7717d500378b29976d630a9..ef975f7545f9d385dbc7774ff350cc8ba23ca651 100644 (file)
@@ -169,7 +169,7 @@ blocking_future<> join_blocking_futures(T &&t) {
       [](auto &&bf) {
        return std::move(bf.fut);
       }).then([agg=std::move(agg)] {
-       return seastar::now();
+       return seastar::make_ready_future<>();
       }));
 }
 
@@ -349,7 +349,7 @@ public:
       if (cont)
        return with_throttle_while(op, params, f);
       else
-       return seastar::now();
+       return seastar::make_ready_future<>();
     });
   }
 protected: