From aa28b51f3c5434253c1788927100fb0b6e41bdbb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 9 Sep 2020 10:08:20 +0800 Subject: [PATCH] crimson: use seastar::make_ready_future() instead of seastar::now(). as seastar::now() was moved into seastar/util/laster.hh. Signed-off-by: Kefu Chai --- src/crimson/common/throttle.cc | 4 ++-- src/crimson/net/Interceptor.h | 2 +- src/crimson/net/Socket.cc | 6 +++--- src/crimson/osd/object_context.h | 4 ++-- src/crimson/osd/osd_operation.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/crimson/common/throttle.cc b/src/crimson/common/throttle.cc index 4ddf77dee227a..bd919518107a2 100644 --- a/src/crimson/common/throttle.cc +++ b/src/crimson/common/throttle.cc @@ -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<>(); }); } diff --git a/src/crimson/net/Interceptor.h b/src/crimson/net/Interceptor.h index fcd3ea6f469cf..dfa2183ec03a8 100644 --- a/src/crimson/net/Interceptor.h +++ b/src/crimson/net/Interceptor.h @@ -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([] { diff --git a/src/crimson/net/Socket.cc b/src/crimson/net/Socket.cc index 5fa41e646bc6f..24608b2d802cb 100644 --- a/src/crimson/net/Socket.cc +++ b/src/crimson/net/Socket.cc @@ -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_) { diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index c7d70c193446c..6a2ba9f2c877c 100644 --- a/src/crimson/osd/object_context.h +++ b/src/crimson/osd/object_context.h @@ -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<>(); } } diff --git a/src/crimson/osd/osd_operation.h b/src/crimson/osd/osd_operation.h index d6919ddfc0005..ef975f7545f9d 100644 --- a/src/crimson/osd/osd_operation.h +++ b/src/crimson/osd/osd_operation.h @@ -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: -- 2.39.5