]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: make OperationThrottler aware about exact type of operation
authorRadosław Zarzyński <rzarzyns@redhat.com>
Fri, 1 Apr 2022 18:03:15 +0000 (20:03 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Thu, 5 May 2022 02:06:31 +0000 (04:06 +0200)
This is a step towards making op's blocker registry static and
compile-time checked.

Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/crimson/osd/osd_operation.h

index 8bde25e0efd9f655a8f6f87b4ffcebf93c3e5189..3416a0e733c458ba8e9f1966aadd231f89fc4546 100644 (file)
@@ -115,9 +115,9 @@ using OSDOperationRegistry = OperationRegistryT<
  */
 class OperationThrottler : public Blocker,
                        private md_config_obs_t {
-  template <typename F>
+  template <typename OperationT, typename F>
   auto with_throttle(
-    OperationRef op,
+    OperationT* op,
     crimson::osd::scheduler::params_t params,
     F &&f) {
     if (!max_in_progress) return f();
@@ -138,9 +138,9 @@ public:
                          const std::set<std::string> &changed) final;
   void update_from_config(const ConfigProxy &conf);
 
-  template <typename F>
+  template <typename OperationT, typename F>
   seastar::future<> with_throttle_while(
-    OperationRef op,
+    OperationT* op,
     crimson::osd::scheduler::params_t params,
     F &&f) {
     return with_throttle(op, params, f).then([this, params, op, f](bool cont) {