]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Finisher: add `const` to several fields
authorMax Kellermann <max.kellermann@ionos.com>
Wed, 9 Oct 2024 12:17:54 +0000 (14:17 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Thu, 10 Oct 2024 05:31:52 +0000 (07:31 +0200)
These are never changed; `const` prevents accidental changes and
allows further compiler optimizations.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/common/Finisher.h

index 4cc5643efad0c7d4a4bd4ecf04d38a5b18c9fefa..28c519b409c82bb4b67400fd851047d4651bbb43 100644 (file)
@@ -36,7 +36,7 @@ enum {
  * contexts to complete is thread-safe.
  */
 class Finisher {
-  CephContext *cct;
+  CephContext *const cct;
   ceph::mutex finisher_lock; ///< Protects access to queues and finisher_running.
   ceph::condition_variable finisher_cond; ///< Signaled when there is something to process.
   ceph::condition_variable finisher_empty_cond; ///< Signaled when the finisher has nothing more to process.
@@ -48,7 +48,7 @@ class Finisher {
   std::vector<std::pair<Context*,int>> finisher_queue;
   std::vector<std::pair<Context*,int>> in_progress_queue;
 
-  std::string thread_name;
+  const std::string thread_name;
 
   /// Performance counter for the finisher's queue length.
   /// Only active for named finishers.