From c2dc437f78cd8be393c4d2eb8d79ce9c351ec4de Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 11 Nov 2020 21:25:55 +0800 Subject: [PATCH] crimson/osd/object_context: drop unused methods Signed-off-by: Kefu Chai --- src/crimson/osd/object_context.h | 53 -------------------------------- 1 file changed, 53 deletions(-) diff --git a/src/crimson/osd/object_context.h b/src/crimson/osd/object_context.h index d2ee138ac4eaf..7e14ac3e16f0c 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(); -- 2.39.5