]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mds/FSMap.h
update sources to v12.2.5
[ceph.git] / ceph / src / mds / FSMap.h
index d80daebd953c6b95c780443f203c1d96b1e0164c..d1757f8601224240984444b984b9d945a2dfc12a 100644 (file)
 #ifndef CEPH_FSMAP_H
 #define CEPH_FSMAP_H
 
+#include <map>
+#include <set>
+#include <string>
+#include <boost/utility/string_view.hpp>
+
 #include <errno.h>
 
 #include "include/types.h"
 #include "msg/Message.h"
 #include "mds/MDSMap.h"
 
-#include <set>
-#include <map>
-#include <string>
-
 #include "common/config.h"
 
 #include "include/CompatSet.h"
@@ -199,7 +200,7 @@ public:
   /**
    * Resolve daemon name to GID
    */
-  mds_gid_t find_mds_gid_by_name(const std::string& s) const
+  mds_gid_t find_mds_gid_by_name(boost::string_view s) const
   {
     const auto info = get_mds_info();
     for (const auto &p : info) {
@@ -213,7 +214,7 @@ public:
   /**
    * Resolve daemon name to status
    */
-  const MDSMap::mds_info_t* find_by_name(const std::string& name) const
+  const MDSMap::mds_info_t* find_by_name(boost::string_view name) const
   {
     std::map<mds_gid_t, MDSMap::mds_info_t> result;
     for (const auto &i : standby_daemons) {
@@ -304,7 +305,7 @@ public:
    * Caller must already have validated all arguments vs. the existing
    * FSMap and OSDMap contents.
    */
-  void create_filesystem(const std::string &name,
+  void create_filesystem(boost::string_view name,
                          int64_t metadata_pool, int64_t data_pool,
                          uint64_t features);
 
@@ -419,7 +420,7 @@ public:
   bool filesystem_exists(fs_cluster_id_t fscid) const {return filesystems.count(fscid) > 0;}
   std::shared_ptr<const Filesystem> get_filesystem(fs_cluster_id_t fscid) const {return std::const_pointer_cast<const Filesystem>(filesystems.at(fscid));}
   std::shared_ptr<const Filesystem> get_filesystem(void) const {return std::const_pointer_cast<const Filesystem>(filesystems.begin()->second);}
-  std::shared_ptr<const Filesystem> get_filesystem(const std::string &name) const
+  std::shared_ptr<const Filesystem> get_filesystem(boost::string_view name) const
   {
     for (const auto &i : filesystems) {
       if (i.second->mds_map.fs_name == name) {
@@ -438,12 +439,12 @@ public:
     }
 
   int parse_filesystem(
-      std::string const &ns_str,
+      boost::string_view ns_str,
       std::shared_ptr<const Filesystem> *result
       ) const;
 
   int parse_role(
-      const std::string &role_str,
+      boost::string_view role_str,
       mds_role_t *role,
       std::ostream &ss) const;
 
@@ -460,11 +461,11 @@ public:
     return false;
   }
 
-  mds_gid_t find_standby_for(mds_role_t mds, const std::string& name) const;
+  mds_gid_t find_standby_for(mds_role_t mds, boost::string_view name) const;
 
   mds_gid_t find_unused_for(mds_role_t mds, bool force_standby_active) const;
 
-  mds_gid_t find_replacement_for(mds_role_t mds, const std::string& name,
+  mds_gid_t find_replacement_for(mds_role_t mds, boost::string_view name,
                                  bool force_standby_active) const;
 
   void get_health(list<pair<health_status_t,std::string> >& summary,