From: Kefu Chai Date: Wed, 11 Nov 2020 13:25:55 +0000 (+0800) Subject: crimson/osd/object_context: drop unused methods X-Git-Tag: v16.1.0~567^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38022%2Fhead;p=ceph.git crimson/osd/object_context: drop unused methods Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index d2ee138ac4ea..7e14ac3e16f0 100644 --- a/src/crimson/osd/object_context.h +++ b/src/crimson/osd/object_context.h @@ -140,59 +140,6 @@ public: assert(0 == "noop"); } } - seastar::future<> get_lock_type(Operation *op, RWState::State type) { - switch (type) { - case RWState::RWWRITE: - return get_lock(op, lock.lock_for_write(false)); - case RWState::RWREAD: - return get_lock(op, lock.lock_for_read()); - case RWState::RWEXCL: - return get_lock(op, lock.lock_for_excl()); - case RWState::RWNONE: - return seastar::make_ready_future<>(); - default: - assert(0 == "invalid lock type"); - } - } - - void put_lock_type(RWState::State type) { - switch (type) { - case RWState::RWWRITE: - return lock.unlock_for_write(); - case RWState::RWREAD: - return lock.unlock_for_read(); - case RWState::RWEXCL: - return lock.unlock_for_excl(); - case RWState::RWNONE: - return; - default: - assert(0 == "invalid lock type"); - } - } - - void degrade_excl_to(RWState::State type) { - // assume we already hold an excl lock - lock.unlock_for_excl(); - bool success = false; - switch (type) { - case RWState::RWWRITE: - success = lock.try_lock_for_write(false); - break; - case RWState::RWREAD: - success = lock.try_lock_for_read(); - break; - case RWState::RWEXCL: - success = lock.try_lock_for_excl(); - break; - case RWState::RWNONE: - success = true; - break; - default: - assert(0 == "invalid lock type"); - break; - } - ceph_assert(success); - } bool empty() const { return !lock.is_acquired();