]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/AuthRegistry: more constness
authorKefu Chai <kchai@redhat.com>
Tue, 16 Apr 2019 12:13:03 +0000 (20:13 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 16 Apr 2019 23:13:46 +0000 (07:13 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/auth/AuthRegistry.cc
src/auth/AuthRegistry.h

index 241db4a9c733fd46004bed586069474acf68cd39..2229c8ab90660373eec03418847f0a7e67746478 100644 (file)
@@ -178,7 +178,7 @@ void AuthRegistry::_refresh_config()
 void AuthRegistry::get_supported_methods(
   int peer_type,
   std::vector<uint32_t> *methods,
-  std::vector<uint32_t> *modes)
+  std::vector<uint32_t> *modes) const
 {
   if (methods) {
     methods->clear();
@@ -253,14 +253,14 @@ void AuthRegistry::get_supported_methods(
   }
 }
 
-bool AuthRegistry::is_supported_method(int peer_type, int method)
+bool AuthRegistry::is_supported_method(int peer_type, int method) const
 {
   std::vector<uint32_t> s;
   get_supported_methods(peer_type, &s);
   return std::find(s.begin(), s.end(), method) != s.end();
 }
 
-bool AuthRegistry::any_supported_methods(int peer_type)
+bool AuthRegistry::any_supported_methods(int peer_type) const
 {
   std::vector<uint32_t> s;
   get_supported_methods(peer_type, &s);
@@ -270,7 +270,7 @@ bool AuthRegistry::any_supported_methods(int peer_type)
 void AuthRegistry::get_supported_modes(
   int peer_type,
   uint32_t auth_method,
-  std::vector<uint32_t> *modes)
+  std::vector<uint32_t> *modes) const
 {
   std::vector<uint32_t> s;
   get_supported_methods(peer_type, nullptr, &s);
index 0b986965cb48e9a573b338ad24cbb78b831ee5ad..4be051ee17110cf990e433fedae65cd5db33e234 100644 (file)
@@ -14,7 +14,7 @@
 
 class AuthRegistry : public md_config_obs_t {
   CephContext *cct;
-  ceph::mutex lock = ceph::make_mutex("AuthRegistry::lock");
+  mutable ceph::mutex lock = ceph::make_mutex("AuthRegistry::lock");
 
   std::map<int,AuthAuthorizeHandler*> authorize_handlers;
 
@@ -48,13 +48,13 @@ public:
 
   void get_supported_methods(int peer_type,
                             std::vector<uint32_t> *methods,
-                            std::vector<uint32_t> *modes=nullptr);
-  bool is_supported_method(int peer_type, int method);
-  bool any_supported_methods(int peer_type);
+                            std::vector<uint32_t> *modes=nullptr) const;
+  bool is_supported_method(int peer_type, int method) const;
+  bool any_supported_methods(int peer_type) const;
 
   void get_supported_modes(int peer_type,
                           uint32_t auth_method,
-                          std::vector<uint32_t> *modes);
+                          std::vector<uint32_t> *modes) const;
 
   uint32_t pick_mode(int peer_type,
                     uint32_t auth_method,