]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/tri_mutex: drop the unused greedy param
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 21 Mar 2024 01:43:34 +0000 (09:43 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 19 Apr 2024 03:37:23 +0000 (11:37 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/common/tri_mutex.cc
src/crimson/common/tri_mutex.h

index e4b18128053e3cea5e6ac99300b48952811e1998..633be55f98c189a7976a50f8d2b0a88920dac523 100644 (file)
@@ -15,7 +15,7 @@ void read_lock::unlock()
 
 seastar::future<> write_lock::lock()
 {
-  return static_cast<tri_mutex*>(this)->lock_for_write(false);
+  return static_cast<tri_mutex*>(this)->lock_for_write();
 }
 
 void write_lock::unlock()
@@ -110,19 +110,19 @@ void tri_mutex::demote_to_read()
   ++readers;
 }
 
-seastar::future<> tri_mutex::lock_for_write(bool greedy)
+seastar::future<> tri_mutex::lock_for_write()
 {
-  if (try_lock_for_write(greedy)) {
+  if (try_lock_for_write()) {
     return seastar::make_ready_future<>();
   }
   waiters.emplace_back(seastar::promise<>(), type_t::write);
   return waiters.back().pr.get_future();
 }
 
-bool tri_mutex::try_lock_for_write(bool greedy) noexcept
+bool tri_mutex::try_lock_for_write() noexcept
 {
   if (!readers && !exclusively_used) {
-    if (greedy || waiters.empty()) {
+    if (waiters.empty()) {
       ++writers;
       return true;
     }
index 0533f3539d970d4067ed4cfafd0a00a92d8dd665..369a8802cf067bf9dc56369d9f133c4b3264b4d7 100644 (file)
@@ -99,8 +99,8 @@ public:
   }
 
   // for shared writers
-  seastar::future<> lock_for_write(bool greedy);
-  bool try_lock_for_write(bool greedy) noexcept;
+  seastar::future<> lock_for_write();
+  bool try_lock_for_write() noexcept;
   void unlock_for_write();
   void promote_from_write();
   void demote_to_write();