]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: convert to boost::string_view
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 21 Feb 2018 18:59:51 +0000 (10:59 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 21 Feb 2018 19:26:14 +0000 (11:26 -0800)
This is a compatibility band-aid on this backport.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
62 files changed:
src/client/MetaRequest.h
src/common/Formatter.cc
src/common/Formatter.h
src/common/HTMLFormatter.cc
src/common/HTMLFormatter.h
src/common/sstring.hh
src/include/encoding.h
src/include/filepath.h
src/mds/Beacon.cc
src/mds/Beacon.h
src/mds/CDentry.h
src/mds/CDir.cc
src/mds/CDir.h
src/mds/CInode.cc
src/mds/CInode.h
src/mds/Capability.cc
src/mds/DamageTable.cc
src/mds/DamageTable.h
src/mds/FSMap.cc
src/mds/FSMap.h
src/mds/FSMapUser.h
src/mds/Locker.cc
src/mds/Locker.h
src/mds/LogEvent.cc
src/mds/LogEvent.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDSAuthCaps.cc
src/mds/MDSAuthCaps.h
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mds/MDSMap.h
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Mantle.cc
src/mds/Mantle.h
src/mds/ScrubHeader.h
src/mds/Server.cc
src/mds/Server.h
src/mds/SessionMap.cc
src/mds/SnapClient.h
src/mds/SnapRealm.cc
src/mds/SnapRealm.h
src/mds/events/EMetaBlob.h
src/mds/inode_backtrace.h
src/mds/journal.cc
src/mds/mdstypes.h
src/mds/snap.cc
src/mds/snap.h
src/messages/MCacheExpire.h
src/messages/MClientLease.h
src/messages/MClientRequest.h
src/messages/MCommandReply.h
src/messages/MDentryLink.h
src/messages/MDentryUnlink.h
src/messages/MDiscoverReply.h
src/messages/MMDSBeacon.h
src/messages/MMDSCacheRejoin.h
src/mgr/PyFormatter.cc
src/mgr/PyFormatter.h
src/rgw/rgw_formats.cc
src/rgw/rgw_formats.h

index a6f9d0e540c2fd4fc9747f25615c82031896deee..56dc4d9730649e2e83892d55ef62775fdcc2489c 100644 (file)
@@ -169,7 +169,7 @@ public:
   void set_retry_attempt(int a) { head.num_retry = a; }
   void set_filepath(const filepath& fp) { path = fp; }
   void set_filepath2(const filepath& fp) { path2 = fp; }
-  void set_string2(const char *s) { path2.set_path(std::string_view(s), 0); }
+  void set_string2(const char *s) { path2.set_path(boost::string_view(s), 0); }
   void set_caller_perms(const UserPerm& _perms) {
     perms.shallow_copy(_perms);
     head.caller_uid = perms.uid();
index 3375cb792c390eda4edff3c6ae155de84b140fb9..5479a6e3b36ac9f4481c8451c56b6e43ac3788c0 100644 (file)
@@ -52,9 +52,9 @@ Formatter::Formatter() { }
 
 Formatter::~Formatter() { }
 
-Formatter *Formatter::create(std::string_view type,
-                            std::string_view default_type,
-                            std::string_view fallback)
+Formatter *Formatter::create(boost::string_view type,
+                            boost::string_view default_type,
+                            boost::string_view fallback)
 {
   std::string mytype(type);
   if (mytype == "")
@@ -161,7 +161,7 @@ void JSONFormatter::print_comma(json_formatter_stack_entry_d& entry)
     m_ss << "    ";
 }
 
-void JSONFormatter::print_quoted_string(std::string_view s)
+void JSONFormatter::print_quoted_string(boost::string_view s)
 {
   int len = escape_json_attr_len(s.data(), s.size());
   char escaped[len];
@@ -272,7 +272,7 @@ void JSONFormatter::dump_float(const char *name, double d)
   m_ss << foo;
 }
 
-void JSONFormatter::dump_string(const char *name, std::string_view s)
+void JSONFormatter::dump_string(const char *name, boost::string_view s)
 {
   print_name(name);
   print_quoted_string(s);
@@ -443,7 +443,7 @@ void XMLFormatter::dump_float(const char *name, double d)
     m_ss << "\n";
 }
 
-void XMLFormatter::dump_string(const char *name, std::string_view s)
+void XMLFormatter::dump_string(const char *name, boost::string_view s)
 {
   std::string e(name);
   std::transform(e.begin(), e.end(), e.begin(),
@@ -455,7 +455,7 @@ void XMLFormatter::dump_string(const char *name, std::string_view s)
     m_ss << "\n";
 }
 
-void XMLFormatter::dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs)
+void XMLFormatter::dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs)
 {
   std::string e(name);
   std::transform(e.begin(), e.end(), e.begin(),
@@ -564,7 +564,7 @@ void XMLFormatter::print_spaces()
   }
 }
 
-std::string XMLFormatter::escape_xml_str(std::string_view str)
+std::string XMLFormatter::escape_xml_str(boost::string_view str)
 {
   size_t len = escape_xml_attr_len(str.data());
   std::vector<char> escaped(len, '\0');
@@ -837,7 +837,7 @@ void TableFormatter::dump_float(const char *name, double d)
   m_ss.str("");
 }
 
-void TableFormatter::dump_string(const char *name, std::string_view s)
+void TableFormatter::dump_string(const char *name, boost::string_view s)
 {
   finish_pending_string();
   size_t i = m_vec_index(name);
@@ -848,7 +848,7 @@ void TableFormatter::dump_string(const char *name, std::string_view s)
   m_ss.str("");
 }
 
-void TableFormatter::dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs)
+void TableFormatter::dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs)
 {
   finish_pending_string();
   size_t i = m_vec_index(name);
index 6cfe60dac04a156c8fab3850cc5ddfc989b76903..14d5f41ca3c393d3cdcddb3a64c257f20eb3c7b5 100644 (file)
@@ -6,6 +6,8 @@
 #include "include/int_types.h"
 #include "include/buffer_fwd.h"
 
+#include <boost/utility/string_view.hpp>
+
 #include <deque>
 #include <list>
 #include <vector>
@@ -23,14 +25,14 @@ namespace ceph {
 
   class Formatter {
   public:
-    static Formatter *create(std::string_view type,
-                            std::string_view default_type,
-                            std::string_view fallback);
-    static Formatter *create(std::string_view type,
-                            std::string_view default_type) {
+    static Formatter *create(boost::string_view type,
+                            boost::string_view default_type,
+                            boost::string_view fallback);
+    static Formatter *create(boost::string_view type,
+                            boost::string_view default_type) {
       return create(type, default_type, "");
     }
-    static Formatter *create(std::string_view type) {
+    static Formatter *create(boost::string_view type) {
       return create(type, "json-pretty", "");
     }
 
@@ -54,7 +56,7 @@ namespace ceph {
     virtual void dump_unsigned(const char *name, uint64_t u) = 0;
     virtual void dump_int(const char *name, int64_t s) = 0;
     virtual void dump_float(const char *name, double d) = 0;
-    virtual void dump_string(const char *name, std::string_view s) = 0;
+    virtual void dump_string(const char *name, boost::string_view s) = 0;
     virtual void dump_bool(const char *name, bool b)
     {
       dump_format_unquoted(name, "%s", (b ? "true" : "false"));
@@ -81,7 +83,7 @@ namespace ceph {
     {
       open_object_section(name);
     }
-    virtual void dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs)
+    virtual void dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs)
     {
       dump_string(name, s);
     }
@@ -106,7 +108,7 @@ namespace ceph {
     void dump_unsigned(const char *name, uint64_t u) override;
     void dump_int(const char *name, int64_t u) override;
     void dump_float(const char *name, double d) override;
-    void dump_string(const char *name, std::string_view s) override;
+    void dump_string(const char *name, boost::string_view s) override;
     std::ostream& dump_stream(const char *name) override;
     void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
     int get_len() const override;
@@ -122,7 +124,7 @@ namespace ceph {
 
     bool m_pretty;
     void open_section(const char *name, bool is_array);
-    void print_quoted_string(std::string_view s);
+    void print_quoted_string(boost::string_view s);
     void print_name(const char *name);
     void print_comma(json_formatter_stack_entry_d& entry);
     void finish_pending_string();
@@ -154,7 +156,7 @@ namespace ceph {
     void dump_unsigned(const char *name, uint64_t u) override;
     void dump_int(const char *name, int64_t u) override;
     void dump_float(const char *name, double d) override;
-    void dump_string(const char *name, std::string_view s) override;
+    void dump_string(const char *name, boost::string_view s) override;
     std::ostream& dump_stream(const char *name) override;
     void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
     int get_len() const override;
@@ -163,13 +165,13 @@ namespace ceph {
     /* with attrs */
     void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
     void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
-    void dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs) override;
+    void dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs) override;
 
   protected:
     void open_section_in_ns(const char *name, const char *ns, const FormatterAttrs *attrs);
     void finish_pending_string();
     void print_spaces();
-    static std::string escape_xml_str(std::string_view str);
+    static std::string escape_xml_str(boost::string_view str);
     void get_attrs_str(const FormatterAttrs *attrs, std::string& attrs_str);
     char to_lower_underscore(char c) const;
 
@@ -206,9 +208,9 @@ namespace ceph {
     void dump_unsigned(const char *name, uint64_t u) override;
     void dump_int(const char *name, int64_t u) override;
     void dump_float(const char *name, double d) override;
-    void dump_string(const char *name, std::string_view s) override;
+    void dump_string(const char *name, boost::string_view s) override;
     void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
-    void dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs) override;
+    void dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs) override;
     std::ostream& dump_stream(const char *name) override;
 
     int get_len() const override;
index c096ec5ceea6403c5b2d2f56dfdc9640a1554fe9..b9344b74b8b9def645a07a5fe88787f04cdf0f76 100644 (file)
@@ -107,12 +107,12 @@ void HTMLFormatter::dump_float(const char *name, double d)
   dump_template(name, d);
 }
 
-void HTMLFormatter::dump_string(const char *name, std::string_view s)
+void HTMLFormatter::dump_string(const char *name, boost::string_view s)
 {
   dump_template(name, escape_xml_str(s.data()));
 }
 
-void HTMLFormatter::dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs)
+void HTMLFormatter::dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs)
 {
   std::string e(name);
   std::string attrs_str;
index ab725062bebae2a6f917bd996598f9650048c196..5e9b200f774e420b11c9429fab4ba09e39bceb25 100644 (file)
@@ -18,12 +18,12 @@ namespace ceph {
     void dump_unsigned(const char *name, uint64_t u) override;
     void dump_int(const char *name, int64_t u) override;
     void dump_float(const char *name, double d) override;
-    void dump_string(const char *name, std::string_view s) override;
+    void dump_string(const char *name, boost::string_view s) override;
     std::ostream& dump_stream(const char *name) override;
     void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
 
     /* with attrs */
-    void dump_string_with_attrs(const char *name, std::string_view s, const FormatterAttrs& attrs) override;
+    void dump_string_with_attrs(const char *name, boost::string_view s, const FormatterAttrs& attrs) override;
   private:
     template <typename T> void dump_template(const char *name, T arg);
 
index 3783cc1efac6c5c2586a69a99d00f9a54772f8e5..d6c22abd1b3cac476cdef2869bb531c0009bae26 100644 (file)
@@ -19,7 +19,7 @@
  * Copyright 2014 Cloudius Systems
  */
 /*
- * C++2014 dependencies removed.  Uses of std::string_view adapted to
+ * C++2014 dependencies removed.  Uses of boost::string_view adapted to
  * boost::string_ref.  Matt Benjamin <mbenjamin@redhat.com>
  */
 
index 88c981c83165af28c32cfc13ac8b6e74a37fe3ed..65fe732668829e60fac4a8cb74c31b0fb056b5a2 100644 (file)
@@ -19,7 +19,7 @@
 #include <deque>
 #include <vector>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 #include <tuple>
 #include <boost/optional/optional_io.hpp>
 #include <boost/tuple/tuple.hpp>
@@ -176,7 +176,7 @@ WRITE_INTTYPE_ENCODER(int16_t, le16)
 
 
 // string
-inline void encode(std::string_view s, bufferlist& bl, uint64_t features=0)
+inline void encode(boost::string_view s, bufferlist& bl, uint64_t features=0)
 {
   __u32 len = s.length();
   encode(len, bl);
@@ -185,7 +185,7 @@ inline void encode(std::string_view s, bufferlist& bl, uint64_t features=0)
 }
 inline void encode(const std::string& s, bufferlist& bl, uint64_t features=0)
 {
-  return encode(std::string_view(s), bl, features);
+  return encode(boost::string_view(s), bl, features);
 }
 inline void decode(std::string& s, bufferlist::iterator& p)
 {
@@ -195,13 +195,13 @@ inline void decode(std::string& s, bufferlist::iterator& p)
   p.copy(len, s);
 }
 
-inline void encode_nohead(std::string_view s, bufferlist& bl)
+inline void encode_nohead(boost::string_view s, bufferlist& bl)
 {
   bl.append(s.data(), s.length());
 }
 inline void encode_nohead(const std::string& s, bufferlist& bl)
 {
-  encode_nohead(std::string_view(s), bl);
+  encode_nohead(boost::string_view(s), bl);
 }
 inline void decode_nohead(int len, std::string& s, bufferlist::iterator& p)
 {
@@ -212,7 +212,7 @@ inline void decode_nohead(int len, std::string& s, bufferlist::iterator& p)
 // const char* (encode only, string compatible)
 inline void encode(const char *s, bufferlist& bl) 
 {
-  encode(std::string_view(s, strlen(s)), bl);
+  encode(boost::string_view(s, strlen(s)), bl);
 }
 
 
index a7579010a71e406330dec5f755ee1c1e279b8129..a2bba2d1ac123a1f6b4768ef75d75f1690d688b7 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <iosfwd>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 #include <vector>
 using namespace std;
 
@@ -74,7 +74,7 @@ class filepath {
 
  public:
   filepath() : ino(0), encoded(false) { }
-  filepath(std::string_view s, inodeno_t i) : ino(i), path(s), encoded(false) { }
+  filepath(boost::string_view s, inodeno_t i) : ino(i), path(s), encoded(false) { }
   filepath(const string& s, inodeno_t i) : ino(i), path(s), encoded(false) { }
   filepath(const char* s, inodeno_t i) : ino(i), path(s), encoded(false) { }
   filepath(const filepath& o) {
@@ -89,18 +89,18 @@ class filepath {
    * if we are fed a relative path as a string, either set ino=0 (strictly
    * relative) or 1 (absolute).  throw out any leading '/'.
    */
-  filepath(std::string_view s) : encoded(false) {
+  filepath(boost::string_view s) : encoded(false) {
     set_path(s);
   }
   filepath(const char *s) : encoded(false) {
-    set_path(std::string_view(s));
+    set_path(boost::string_view(s));
   }
 
-  void set_path(std::string_view s, inodeno_t b) {
+  void set_path(boost::string_view s, inodeno_t b) {
     path = s;
     ino = b;
   }
-  void set_path(std::string_view s) {
+  void set_path(boost::string_view s) {
     if (s[0] == '/') {
       path = s.substr(1);
       ino = 1;
@@ -168,7 +168,7 @@ class filepath {
     bits.pop_back();
     rebuild_path();
   }    
-  void push_dentry(std::string_view s) {
+  void push_dentry(boost::string_view s) {
     if (bits.empty() && path.length() > 0) 
       parse_bits();
     if (!bits.empty())
@@ -177,10 +177,10 @@ class filepath {
     bits.emplace_back(s);
   }
   void push_dentry(const string& s) {
-    push_dentry(std::string_view(s));
+    push_dentry(boost::string_view(s));
   }
   void push_dentry(const char *cs) {
-    push_dentry(std::string_view(cs, strlen(cs)));
+    push_dentry(boost::string_view(cs, strlen(cs)));
   }
   void push_front_dentry(const string& s) {
     bits.insert(bits.begin(), s);
index 3b646edb02deca3e937cdb623711ebd1e7753122..ea59c57b827c43b5e6ce3a57ff5982b26a0ebbd1 100644 (file)
@@ -34,7 +34,7 @@
 #define dout_prefix *_dout << "mds.beacon." << name << ' '
 
 
-Beacon::Beacon(CephContext *cct_, MonClient *monc_, std::string_view name_) :
+Beacon::Beacon(CephContext *cct_, MonClient *monc_, boost::string_view name_) :
   Dispatcher(cct_), lock("Beacon"), monc(monc_), timer(g_ceph_context, lock),
   name(name_), standby_for_rank(MDS_RANK_NONE),
   standby_for_fscid(FS_CLUSTER_ID_NONE), want_state(MDSMap::STATE_BOOT),
index 2e8b32efb6780568941ffa460595acc615b77d3e..5815a9014b6191a941819ad6350d519ac092bf00 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef BEACON_STATE_H
 #define BEACON_STATE_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "include/types.h"
 #include "include/Context.h"
@@ -42,7 +42,7 @@ class MDSRank;
 class Beacon : public Dispatcher
 {
 public:
-  Beacon(CephContext *cct_, MonClient *monc_, std::string_view name);
+  Beacon(CephContext *cct_, MonClient *monc_, boost::string_view name);
   ~Beacon() override;
 
   void init(MDSMap const *mdsmap);
index cee2a5df03afd4f5ee7ff21cae9ff322645c2b1d..abeb0c27f1e4c5778f0a7911029fffb2dab276c6 100644 (file)
@@ -18,7 +18,7 @@
 #define CEPH_CDENTRY_H
 
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 #include <set>
 
 #include "include/counter.h"
@@ -102,7 +102,7 @@ public:
   static const unsigned EXPORT_NONCE = 1;
 
 
-  CDentry(std::string_view n, __u32 h,
+  CDentry(boost::string_view n, __u32 h,
          snapid_t f, snapid_t l) :
     hash(h),
     first(f), last(l),
@@ -111,7 +111,7 @@ public:
     versionlock(this, &versionlock_type),
     name(n)
   {}
-  CDentry(std::string_view n, __u32 h, inodeno_t ino, unsigned char dt,
+  CDentry(boost::string_view n, __u32 h, inodeno_t ino, unsigned char dt,
          snapid_t f, snapid_t l) :
     hash(h),
     first(f), last(l),
@@ -149,7 +149,7 @@ public:
 
   const CDir *get_dir() const { return dir; }
   CDir *get_dir() { return dir; }
-  std::string_view get_name() const { return std::string_view(name); }
+  boost::string_view get_name() const { return boost::string_view(name); }
 
   __u32 get_hash() const { return hash; }
 
index cdbd27f2a52e710bd844247e4630fa8a79ad0924..46e250fc9e6255b2ef43f7ea1c8c27e4da00e7c8 100644 (file)
@@ -12,7 +12,7 @@
  * 
  */
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "include/types.h"
 
@@ -289,7 +289,7 @@ bool CDir::check_rstats(bool scrub)
   return good;
 }
 
-CDentry *CDir::lookup(std::string_view name, snapid_t snap)
+CDentry *CDir::lookup(boost::string_view name, snapid_t snap)
 { 
   dout(20) << "lookup (" << snap << ", '" << name << "')" << dendl;
   auto iter = items.lower_bound(dentry_key_t(snap, name, inode->hash_dentry_name(name)));
@@ -305,7 +305,7 @@ CDentry *CDir::lookup(std::string_view name, snapid_t snap)
   return 0;
 }
 
-CDentry *CDir::lookup_exact_snap(std::string_view name, snapid_t last) {
+CDentry *CDir::lookup_exact_snap(boost::string_view name, snapid_t last) {
   auto p = items.find(dentry_key_t(last, name, inode->hash_dentry_name(name)));
   if (p == items.end())
     return NULL;
@@ -316,7 +316,7 @@ CDentry *CDir::lookup_exact_snap(std::string_view name, snapid_t last) {
  * linking fun
  */
 
-CDentry* CDir::add_null_dentry(std::string_view dname,
+CDentry* CDir::add_null_dentry(boost::string_view dname,
                               snapid_t first, snapid_t last)
 {
   // foreign
@@ -359,7 +359,7 @@ CDentry* CDir::add_null_dentry(std::string_view dname,
 }
 
 
-CDentry* CDir::add_primary_dentry(std::string_view dname, CInode *in,
+CDentry* CDir::add_primary_dentry(boost::string_view dname, CInode *in,
                                  snapid_t first, snapid_t last) 
 {
   // primary
@@ -409,7 +409,7 @@ CDentry* CDir::add_primary_dentry(std::string_view dname, CInode *in,
   return dn;
 }
 
-CDentry* CDir::add_remote_dentry(std::string_view dname, inodeno_t ino, unsigned char d_type,
+CDentry* CDir::add_remote_dentry(boost::string_view dname, inodeno_t ino, unsigned char d_type,
                                 snapid_t first, snapid_t last) 
 {
   // foreign
@@ -677,7 +677,7 @@ void CDir::add_to_bloom(CDentry *dn)
   bloom->insert(dn->get_name().data(), dn->get_name().size());
 }
 
-bool CDir::is_in_bloom(std::string_view name)
+bool CDir::is_in_bloom(boost::string_view name)
 {
   if (!bloom)
     return false;
@@ -1218,7 +1218,7 @@ void CDir::assimilate_dirty_rstat_inodes_finish(MutationRef& mut, EMetaBlob *blo
  * WAITING
  */
 
-void CDir::add_dentry_waiter(std::string_view dname, snapid_t snapid, MDSInternalContextBase *c) 
+void CDir::add_dentry_waiter(boost::string_view dname, snapid_t snapid, MDSInternalContextBase *c) 
 {
   if (waiting_on_dentry.empty())
     get(PIN_DNWAITER);
@@ -1228,7 +1228,7 @@ void CDir::add_dentry_waiter(std::string_view dname, snapid_t snapid, MDSInterna
           << " " << c << " on " << *this << dendl;
 }
 
-void CDir::take_dentry_waiting(std::string_view dname, snapid_t first, snapid_t last,
+void CDir::take_dentry_waiting(boost::string_view dname, snapid_t first, snapid_t last,
                               list<MDSInternalContextBase*>& ls)
 {
   if (waiting_on_dentry.empty())
@@ -1463,7 +1463,7 @@ void CDir::fetch(MDSInternalContextBase *c, bool ignore_authpinnability)
   return fetch(c, want, ignore_authpinnability);
 }
 
-void CDir::fetch(MDSInternalContextBase *c, std::string_view want_dn, bool ignore_authpinnability)
+void CDir::fetch(MDSInternalContextBase *c, boost::string_view want_dn, bool ignore_authpinnability)
 {
   dout(10) << "fetch on " << *this << dendl;
   
@@ -1652,8 +1652,8 @@ void CDir::_omap_fetch_more(
 }
 
 CDentry *CDir::_load_dentry(
-    std::string_view key,
-    std::string_view dname,
+    boost::string_view key,
+    boost::string_view dname,
     const snapid_t last,
     bufferlist &bl,
     const int pos,
@@ -2013,7 +2013,7 @@ void CDir::_go_bad()
   finish_waiting(WAIT_COMPLETE, -EIO);
 }
 
-void CDir::go_bad_dentry(snapid_t last, std::string_view dname)
+void CDir::go_bad_dentry(snapid_t last, boost::string_view dname)
 {
   dout(10) << __func__ << " " << dname << dendl;
   std::string path(get_path());
index 59cfdbdf55d7d2db6381baab1dfdfede228ccd54..8de1867329df9aae00a736fc667b3ee69a241e2f 100644 (file)
@@ -22,7 +22,7 @@
 #include <map>
 #include <set>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "common/DecayCounter.h"
 #include "common/bloom_filter.hpp"
@@ -433,17 +433,17 @@ protected:
 
   // -- dentries and inodes --
  public:
-  CDentry* lookup_exact_snap(std::string_view dname, snapid_t last);
-  CDentry* lookup(std::string_view n, snapid_t snap=CEPH_NOSNAP);
+  CDentry* lookup_exact_snap(boost::string_view dname, snapid_t last);
+  CDentry* lookup(boost::string_view n, snapid_t snap=CEPH_NOSNAP);
   CDentry* lookup(const char *n, snapid_t snap=CEPH_NOSNAP) {
-    return lookup(std::string_view(n), snap);
+    return lookup(boost::string_view(n), snap);
   }
 
-  CDentry* add_null_dentry(std::string_view dname,
+  CDentry* add_null_dentry(boost::string_view dname,
                           snapid_t first=2, snapid_t last=CEPH_NOSNAP);
-  CDentry* add_primary_dentry(std::string_view dname, CInode *in,
+  CDentry* add_primary_dentry(boost::string_view dname, CInode *in,
                              snapid_t first=2, snapid_t last=CEPH_NOSNAP);
-  CDentry* add_remote_dentry(std::string_view dname, inodeno_t ino, unsigned char d_type,
+  CDentry* add_remote_dentry(boost::string_view dname, inodeno_t ino, unsigned char d_type,
                             snapid_t first=2, snapid_t last=CEPH_NOSNAP);
   void remove_dentry( CDentry *dn );         // delete dentry
   void link_remote_inode( CDentry *dn, inodeno_t ino, unsigned char d_type);
@@ -453,7 +453,7 @@ protected:
   void try_remove_unlinked_dn(CDentry *dn);
 
   void add_to_bloom(CDentry *dn);
-  bool is_in_bloom(std::string_view name);
+  bool is_in_bloom(boost::string_view name);
   bool has_bloom() { return (bloom ? true : false); }
   void remove_bloom() {
     bloom.reset();
@@ -589,7 +589,7 @@ private:
     return file_object_t(ino(), frag);
   }
   void fetch(MDSInternalContextBase *c, bool ignore_authpinnability=false);
-  void fetch(MDSInternalContextBase *c, std::string_view want_dn, bool ignore_authpinnability=false);
+  void fetch(MDSInternalContextBase *c, boost::string_view want_dn, bool ignore_authpinnability=false);
   void fetch(MDSInternalContextBase *c, const std::set<dentry_key_t>& keys);
 protected:
   mempool::mds_co::compact_set<mempool::mds_co::string> wanted_items;
@@ -599,8 +599,8 @@ protected:
     bufferlist& hdrbl, std::map<std::string, bufferlist>& omap,
     MDSInternalContextBase *fin);
   CDentry *_load_dentry(
-      std::string_view key,
-      std::string_view dname,
+      boost::string_view key,
+      boost::string_view dname,
       snapid_t last,
       bufferlist &bl,
       int pos,
@@ -616,7 +616,7 @@ protected:
   /**
    * Go bad due to a damaged dentry (register with damagetable and go BADFRAG)
    */
-  void go_bad_dentry(snapid_t last, std::string_view dname);
+  void go_bad_dentry(snapid_t last, boost::string_view dname);
 
   /**
    * Go bad due to a damaged header (register with damagetable and go BADFRAG)
@@ -666,11 +666,11 @@ protected:
   mempool::mds_co::compact_map< string_snap_t, mempool::mds_co::list<MDSInternalContextBase*> > waiting_on_dentry; // FIXME string_snap_t not in mempool
 
 public:
-  bool is_waiting_for_dentry(std::string_view dname, snapid_t snap) {
+  bool is_waiting_for_dentry(boost::string_view dname, snapid_t snap) {
     return waiting_on_dentry.count(string_snap_t(dname, snap));
   }
-  void add_dentry_waiter(std::string_view dentry, snapid_t snap, MDSInternalContextBase *c);
-  void take_dentry_waiting(std::string_view dentry, snapid_t first, snapid_t last, std::list<MDSInternalContextBase*>& ls);
+  void add_dentry_waiter(boost::string_view dentry, snapid_t snap, MDSInternalContextBase *c);
+  void take_dentry_waiting(boost::string_view dentry, snapid_t first, snapid_t last, std::list<MDSInternalContextBase*>& ls);
   void take_sub_waiting(std::list<MDSInternalContextBase*>& ls);  // dentry or ino
 
   void add_waiter(uint64_t mask, MDSInternalContextBase *c) override;
index 4d3bcd45f49465172cdba85ef5d492ac9ba81d3b..a2c3951301912c4d1e1fdba0b2371babd1d55f21 100644 (file)
@@ -495,7 +495,7 @@ void CInode::pop_projected_snaprealm(sr_t *next_snaprealm)
 
 // dirfrags
 
-__u32 InodeStoreBase::hash_dentry_name(std::string_view dn)
+__u32 InodeStoreBase::hash_dentry_name(boost::string_view dn)
 {
   int which = inode.dir_layout.dl_dir_hash;
   if (!which)
@@ -504,7 +504,7 @@ __u32 InodeStoreBase::hash_dentry_name(std::string_view dn)
   return ceph_str_hash(which, dn.data(), dn.length());
 }
 
-frag_t InodeStoreBase::pick_dirfrag(std::string_view dn)
+frag_t InodeStoreBase::pick_dirfrag(boost::string_view dn)
 {
   if (dirfragtree.empty())
     return frag_t();          // avoid the string hash if we can.
@@ -1329,7 +1329,7 @@ void InodeStoreBase::decode_bare(bufferlist::iterator &bl,
   if (is_symlink()) {
     std::string tmp;
     decode(tmp, bl);
-    symlink = std::string_view(tmp);
+    symlink = boost::string_view(tmp);
   }
   ::decode(dirfragtree, bl);
   ::decode(xattrs, bl);
@@ -3492,7 +3492,7 @@ void CInode::_decode_base(bufferlist::iterator& p)
   {
     std::string tmp;
     ::decode(tmp, p);
-    symlink = std::string_view(tmp);
+    symlink = boost::string_view(tmp);
   }
   ::decode(dirfragtree, p);
   ::decode(xattrs, p);
@@ -3810,7 +3810,7 @@ void CInode::validate_disk_state(CInode::validated_data *results,
     /**
      * Fetch backtrace and set tag if tag is non-empty
      */
-    void fetch_backtrace_and_tag(CInode *in, std::string_view tag,
+    void fetch_backtrace_and_tag(CInode *in, boost::string_view tag,
                                  Context *fin, int *bt_r, bufferlist *bt)
     {
       const int64_t pool = in->get_backtrace_pool();
@@ -3851,7 +3851,7 @@ void CInode::validate_disk_state(CInode::validated_data *results,
       // present)
       if (in->scrub_infop) {
         // I'm a non-orphan, so look up my ScrubHeader via my linkage
-        std::string_view tag = in->scrub_infop->header->get_tag();
+        boost::string_view tag = in->scrub_infop->header->get_tag();
         // Rather than using the usual CInode::fetch_backtrace,
         // use a special variant that optionally writes a tag in the same
         // operation.
index b17ee20bc718ff7c0abc38b32ec274ea7e72a64f..c87d30c4a4ccfe1cae3d3ebd75339720b1e1909e 100644 (file)
@@ -20,7 +20,7 @@
 #include <list>
 #include <map>
 #include <set>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "common/config.h"
 #include "include/counter.h"
@@ -108,8 +108,8 @@ public:
   void dump(Formatter *f) const;
 
   /* For use by offline tools */
-  __u32 hash_dentry_name(std::string_view dn);
-  frag_t pick_dirfrag(std::string_view dn);
+  __u32 hash_dentry_name(boost::string_view dn);
+  frag_t pick_dirfrag(boost::string_view dn);
 };
 
 class InodeStore : public InodeStoreBase {
index bf43389bc77d3072e4408b1a6b85f1e5147c7bcc..144f604e6510890c4ff3afe6ad8daeb8ba657377 100644 (file)
@@ -192,13 +192,15 @@ void Capability::generate_test_instances(list<Capability*>& ls)
   ls.back()->_wanted = 14;
   ls.back()->_pending = 15;
   {
-    auto &r = ls.back()->_revokes.emplace_back();
+    ls.back()->_revokes.emplace_back();
+    auto &r = ls.back()->_revokes.back();
     r.before = 16;
     r.seq = 17;
     r.last_issue = 18;
   }
   {
-    auto &r = ls.back()->_revokes.emplace_back();
+    ls.back()->_revokes.emplace_back();
+    auto &r = ls.back()->_revokes.back();
     r.before = 19;
     r.seq = 20;
     r.last_issue = 21;
index de6a5ee4b34f0938f0e5ea73fce0e487ff20087a..2921f26d46e7bd148b8e250fb7e849bc8e506413 100644 (file)
@@ -70,7 +70,7 @@ class DentryDamage : public DamageEntry
   DentryDamage(
       inodeno_t ino_,
       frag_t frag_,
-      std::string_view dname_,
+      boost::string_view dname_,
       snapid_t snap_id_)
     : ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_)
   {}
@@ -129,7 +129,7 @@ DamageEntry::~DamageEntry()
 
 bool DamageTable::notify_dentry(
     inodeno_t ino, frag_t frag,
-    snapid_t snap_id, std::string_view dname, std::string_view path)
+    snapid_t snap_id, boost::string_view dname, boost::string_view path)
 {
   if (oversized()) {
     return true;
@@ -160,7 +160,7 @@ bool DamageTable::notify_dentry(
 }
 
 bool DamageTable::notify_dirfrag(inodeno_t ino, frag_t frag,
-                                 std::string_view path)
+                                 boost::string_view path)
 {
   // Special cases: damage to these dirfrags is considered fatal to
   // the MDS rank that owns them.
@@ -189,7 +189,7 @@ bool DamageTable::notify_dirfrag(inodeno_t ino, frag_t frag,
   return false;
 }
 
-bool DamageTable::notify_remote_damaged(inodeno_t ino, std::string_view path)
+bool DamageTable::notify_remote_damaged(inodeno_t ino, boost::string_view path)
 {
   if (oversized()) {
     return true;
@@ -212,7 +212,7 @@ bool DamageTable::oversized() const
 
 bool DamageTable::is_dentry_damaged(
         const CDir *dir_frag,
-        std::string_view dname,
+        boost::string_view dname,
         const snapid_t snap_id) const
 {
   if (dentries.count(
index a6550a9aa3a7c5c4bff9d8796145ad473afde4ab..843ee32d5041ac0f6d2f62fd8e40c0e9560eacb1 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef DAMAGE_TABLE_H_
 #define DAMAGE_TABLE_H_
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "mdstypes.h"
 #include "auth/Crypto.h"
@@ -95,7 +95,7 @@ class DentryIdent
     }
   }
 
-  DentryIdent(std::string_view dname_, snapid_t snap_id_)
+  DentryIdent(boost::string_view dname_, snapid_t snap_id_)
     : dname(dname_), snap_id(snap_id_)
   {}
 };
@@ -163,7 +163,7 @@ public:
    *
    * @return true if fatal
    */
-  bool notify_dirfrag(inodeno_t ino, frag_t frag, std::string_view path);
+  bool notify_dirfrag(inodeno_t ino, frag_t frag, boost::string_view path);
 
   /**
    * Indicate that a particular dentry cannot be loaded.
@@ -172,17 +172,17 @@ public:
    */
   bool notify_dentry(
     inodeno_t ino, frag_t frag,
-    snapid_t snap_id, std::string_view dname, std::string_view path);
+    snapid_t snap_id, boost::string_view dname, boost::string_view path);
 
   /**
    * Indicate that a particular Inode could not be loaded by number
    */
   bool notify_remote_damaged(
-      inodeno_t ino, std::string_view path);
+      inodeno_t ino, boost::string_view path);
 
   bool is_dentry_damaged(
       const CDir *dir_frag,
-      std::string_view dname,
+      boost::string_view dname,
       const snapid_t snap_id) const;
 
   bool is_dirfrag_damaged(
index 9280dc125e76838274f6c7451ddca9a837632c11..0ad1e8b10964d8a26bc94996c2d6f25e0e900d4b 100644 (file)
@@ -225,7 +225,7 @@ void FSMap::print_summary(Formatter *f, ostream *out) const
 }
 
 
-void FSMap::create_filesystem(std::string_view name,
+void FSMap::create_filesystem(boost::string_view name,
                               int64_t metadata_pool, int64_t data_pool,
                               uint64_t features)
 {
@@ -650,7 +650,7 @@ void Filesystem::decode(bufferlist::iterator& p)
 }
 
 int FSMap::parse_filesystem(
-      std::string_view ns_str,
+      boost::string_view ns_str,
       std::shared_ptr<const Filesystem> *result
       ) const
 {
@@ -678,7 +678,7 @@ void Filesystem::print(std::ostream &out) const
   mds_map.print(out);
 }
 
-mds_gid_t FSMap::find_standby_for(mds_role_t role, std::string_view name) const
+mds_gid_t FSMap::find_standby_for(mds_role_t role, boost::string_view name) const
 {
   mds_gid_t result = MDS_GID_NONE;
 
@@ -753,7 +753,7 @@ mds_gid_t FSMap::find_unused_for(mds_role_t role,
   return MDS_GID_NONE;
 }
 
-mds_gid_t FSMap::find_replacement_for(mds_role_t role, std::string_view name,
+mds_gid_t FSMap::find_replacement_for(mds_role_t role, boost::string_view name,
                                bool force_standby_active) const {
   const mds_gid_t standby = find_standby_for(role, name);
   if (standby)
@@ -1003,7 +1003,7 @@ std::list<mds_gid_t> FSMap::stop(mds_gid_t who)
  * if legacy_client_ns is set.
  */
 int FSMap::parse_role(
-    std::string_view role_str,
+    boost::string_view role_str,
     mds_role_t *role,
     std::ostream &ss) const
 {
index a2e459a4783f829d0cba48925d2920239b3618bd..d1757f8601224240984444b984b9d945a2dfc12a 100644 (file)
@@ -19,7 +19,7 @@
 #include <map>
 #include <set>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include <errno.h>
 
@@ -200,7 +200,7 @@ public:
   /**
    * Resolve daemon name to GID
    */
-  mds_gid_t find_mds_gid_by_name(std::string_view 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) {
@@ -214,7 +214,7 @@ public:
   /**
    * Resolve daemon name to status
    */
-  const MDSMap::mds_info_t* find_by_name(std::string_view 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) {
@@ -305,7 +305,7 @@ public:
    * Caller must already have validated all arguments vs. the existing
    * FSMap and OSDMap contents.
    */
-  void create_filesystem(std::string_view name,
+  void create_filesystem(boost::string_view name,
                          int64_t metadata_pool, int64_t data_pool,
                          uint64_t features);
 
@@ -420,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(std::string_view 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) {
@@ -439,12 +439,12 @@ public:
     }
 
   int parse_filesystem(
-      std::string_view ns_str,
+      boost::string_view ns_str,
       std::shared_ptr<const Filesystem> *result
       ) const;
 
   int parse_role(
-      std::string_view role_str,
+      boost::string_view role_str,
       mds_role_t *role,
       std::ostream &ss) const;
 
@@ -461,11 +461,11 @@ public:
     return false;
   }
 
-  mds_gid_t find_standby_for(mds_role_t mds, std::string_view 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, std::string_view 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,
index 2ae0792ffd01683adc2fba86c5d172b80293de4b..d8a73faea46ff9474d2e18b35249689fe5897c38 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <map>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "mds/mdstypes.h"
 
@@ -39,7 +39,7 @@ public:
 
   epoch_t get_epoch() const { return epoch; }
 
-  fs_cluster_id_t get_fs_cid(std::string_view name) const {
+  fs_cluster_id_t get_fs_cid(boost::string_view name) const {
     for (auto &p : filesystems) {
       if (p.second.name == name)
        return p.first;
index 22f7529b886a4fede6bc96f774680422d5b80c0f..e7af8f9b660690b98e1fcc0a23ffab3a8d49e4b3 100644 (file)
@@ -12,7 +12,7 @@
  * 
  */
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "MDSRank.h"
 #include "MDCache.h"
@@ -2902,7 +2902,7 @@ public:
 };
 
 void Locker::process_request_cap_release(MDRequestRef& mdr, client_t client, const ceph_mds_request_release& item,
-                                        std::string_view dname)
+                                        boost::string_view dname)
 {
   inodeno_t ino = (uint64_t)item.ino;
   uint64_t cap_id = item.cap_id;
index 17efa411d2bfde58b6f42e9aa156c739de218f1f..350264e935958348f13db5bb587001168457b2aa 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MDS_LOCKER_H
 #define CEPH_MDS_LOCKER_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "include/types.h"
 
@@ -179,7 +179,7 @@ public:
   bool should_defer_client_cap_frozen(CInode *in);
 
   void process_request_cap_release(MDRequestRef& mdr, client_t client, const ceph_mds_request_release& r,
-                                  std::string_view dname);
+                                  boost::string_view dname);
 
   void kick_cap_releases(MDRequestRef& mdr);
   void kick_issue_caps(CInode *in, client_t client, ceph_seq_t seq);
index 83ffbe6c1b99330c6562d9da48d8460cb09adbc9..64b0323527b7c56853fa4d9a4b2512f55e76b19f 100644 (file)
@@ -119,7 +119,7 @@ const std::map<std::string, LogEvent::EventType> LogEvent::types = {
  *
  * Return -1 if not found
  */
-LogEvent::EventType LogEvent::str_to_type(std::string_view str)
+LogEvent::EventType LogEvent::str_to_type(boost::string_view str)
 {
   return LogEvent::types.at(std::string(str));
 }
index df415cade5833eab806431698ca76ff5e4c3fa89..704ccee3d7c48e7b965f459c4238f2e406541d9f 100644 (file)
@@ -73,7 +73,7 @@ public:
   virtual ~LogEvent() { }
 
   string get_type_str() const;
-  static EventType str_to_type(std::string_view str);
+  static EventType str_to_type(boost::string_view str);
   EventType get_type() const { return _type; }
   void set_type(EventType t) { _type = t; }
 
index 501c097404fbf410a4150efec722a1176ae4e889..b0ff5e8bc2b600636b40a4665e7a204cf418d0b2 100644 (file)
@@ -17,7 +17,7 @@
 #include <iostream>
 #include <sstream>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 #include <map>
 
 #include "MDCache.h"
@@ -8136,7 +8136,7 @@ CInode *MDCache::cache_traverse(const filepath& fp)
     return NULL;
 
   for (unsigned i = 0; i < fp.depth(); i++) {
-    std::string_view dname = fp[i];
+    boost::string_view dname = fp[i];
     frag_t fg = in->pick_dirfrag(dname);
     dout(20) << " " << i << " " << dname << " frag " << fg << " from " << *in << dendl;
     CDir *curdir = in->get_dirfrag(fg);
@@ -11861,27 +11861,27 @@ int MDCache::cache_status(Formatter *f)
   return 0;
 }
 
-int MDCache::dump_cache(std::string_view file_name)
+int MDCache::dump_cache(boost::string_view file_name)
 {
   return dump_cache(file_name, NULL);
 }
 
 int MDCache::dump_cache(Formatter *f)
 {
-  return dump_cache(std::string_view(""), f);
+  return dump_cache(boost::string_view(""), f);
 }
 
-int MDCache::dump_cache(std::string_view dump_root, int depth, Formatter *f)
+int MDCache::dump_cache(boost::string_view dump_root, int depth, Formatter *f)
 {
-  return dump_cache(std::string_view(""), f, dump_root, depth);
+  return dump_cache(boost::string_view(""), f, dump_root, depth);
 }
 
 /**
  * Dump the metadata cache, either to a Formatter, if
  * provided, else to a plain text file.
  */
-int MDCache::dump_cache(std::string_view fn, Formatter *f,
-                        std::string_view dump_root, int depth)
+int MDCache::dump_cache(boost::string_view fn, Formatter *f,
+                        boost::string_view dump_root, int depth)
 {
   int r = 0;
   int fd = -1;
@@ -12051,8 +12051,8 @@ public:
 };
 
 void MDCache::enqueue_scrub(
-    std::string_view path,
-    std::string_view tag,
+    boost::string_view path,
+    boost::string_view tag,
     bool force, bool recursive, bool repair,
     Formatter *f, Context *fin)
 {
@@ -12348,7 +12348,7 @@ do_rdlocks:
   mds->server->respond_to_request(mdr, 0);
 }
 
-void MDCache::flush_dentry(std::string_view path, Context *fin)
+void MDCache::flush_dentry(boost::string_view path, Context *fin)
 {
   if (is_readonly()) {
     dout(10) << __func__ << ": read-only FS" << dendl;
index fd0e692aa96d6586d564546028ba98521f974f5a..3d3f9686414b3855592a2a9efd27cae05a87206c 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef CEPH_MDCACHE_H
 #define CEPH_MDCACHE_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "include/types.h"
 #include "include/filepath.h"
@@ -797,7 +797,7 @@ public:
       return NULL;
     return in->get_dirfrag(df.frag);
   }
-  CDir* get_dirfrag(inodeno_t ino, std::string_view dn) {
+  CDir* get_dirfrag(inodeno_t ino, boost::string_view dn) {
     CInode *in = get_inode(ino);
     if (!in)
       return NULL;
@@ -1162,14 +1162,14 @@ public:
   void discard_delayed_expire(CDir *dir);
 
 protected:
-  int dump_cache(std::string_view fn, Formatter *f,
-                 std::string_view dump_root = "",
+  int dump_cache(boost::string_view fn, Formatter *f,
+                 boost::string_view dump_root = "",
                  int depth = -1);
 public:
   int dump_cache() { return dump_cache(NULL, NULL); }
-  int dump_cache(std::string_view filename);
+  int dump_cache(boost::string_view filename);
   int dump_cache(Formatter *f);
-  int dump_cache(std::string_view dump_root, int depth, Formatter *f);
+  int dump_cache(boost::string_view dump_root, int depth, Formatter *f);
 
   int cache_status(Formatter *f);
 
@@ -1204,11 +1204,11 @@ protected:
   void repair_dirfrag_stats_work(MDRequestRef& mdr);
   friend class C_MDC_RepairDirfragStats;
 public:
-  void flush_dentry(std::string_view path, Context *fin);
+  void flush_dentry(boost::string_view path, Context *fin);
   /**
    * Create and start an OP_ENQUEUE_SCRUB
    */
-  void enqueue_scrub(std::string_view path, std::string_view tag,
+  void enqueue_scrub(boost::string_view path, boost::string_view tag,
                      bool force, bool recursive, bool repair,
                     Formatter *f, Context *fin);
   void repair_inode_stats(CInode *diri);
index 6198320c45f6045f0547462330e5485aefca4157..7f9f4b02a34bbaeaae4c1773d5d797669a31a02d 100644 (file)
@@ -12,7 +12,7 @@
  * 
  */
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include <errno.h>
 #include <fcntl.h>
@@ -109,7 +109,7 @@ void MDSCapMatch::normalize_path()
   // drop ..
 }
 
-bool MDSCapMatch::match(std::string_view target_path,
+bool MDSCapMatch::match(boost::string_view target_path,
                        const int caller_uid,
                        const int caller_gid,
                        const vector<uint64_t> *caller_gid_list) const
@@ -141,7 +141,7 @@ bool MDSCapMatch::match(std::string_view target_path,
   return true;
 }
 
-bool MDSCapMatch::match_path(std::string_view target_path) const
+bool MDSCapMatch::match_path(boost::string_view target_path) const
 {
   if (path.length()) {
     if (target_path.find(path) != 0)
@@ -161,7 +161,7 @@ bool MDSCapMatch::match_path(std::string_view target_path) const
  * Is the client *potentially* able to access this path?  Actual
  * permission will depend on uids/modes in the full is_capable.
  */
-bool MDSAuthCaps::path_capable(std::string_view inode_path) const
+bool MDSAuthCaps::path_capable(boost::string_view inode_path) const
 {
   for (const auto &i : grants) {
     if (i.match.match_path(inode_path)) {
@@ -179,7 +179,7 @@ bool MDSAuthCaps::path_capable(std::string_view inode_path) const
  * This is true if any of the 'grant' clauses in the capability match the
  * requested path + op.
  */
-bool MDSAuthCaps::is_capable(std::string_view inode_path,
+bool MDSAuthCaps::is_capable(boost::string_view inode_path,
                             uid_t inode_uid, gid_t inode_gid,
                             unsigned inode_mode,
                             uid_t caller_uid, gid_t caller_gid,
@@ -279,7 +279,7 @@ void MDSAuthCaps::set_allow_all()
                        MDSCapMatch()));
 }
 
-bool MDSAuthCaps::parse(CephContext *c, std::string_view str, ostream *err)
+bool MDSAuthCaps::parse(CephContext *c, boost::string_view str, ostream *err)
 {
   // Special case for legacy caps
   if (str == "allow") {
index 1e6cda68cc2b023d6f3228fd011256d6fd34f658..1061e93329347411dbba7f458f3d5131f3d7b5b4 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <sstream>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 #include <vector>
 
 #include "include/types.h"
@@ -93,7 +93,7 @@ struct MDSCapMatch {
   }
 
   // check whether this grant matches against a given file and caller uid:gid
-  bool match(std::string_view target_path,
+  bool match(boost::string_view target_path,
             const int caller_uid,
             const int caller_gid,
             const vector<uint64_t> *caller_gid_list) const;
@@ -104,7 +104,7 @@ struct MDSCapMatch {
    *
    * @param target_path filesystem path without leading '/'
    */
-  bool match_path(std::string_view target_path) const;
+  bool match_path(boost::string_view target_path) const;
 };
 
 struct MDSCapGrant {
@@ -130,14 +130,14 @@ public:
     : cct(NULL), grants(grants_) { }
 
   void set_allow_all();
-  bool parse(CephContext *cct, std::string_view str, std::ostream *err);
+  bool parse(CephContext *cct, boost::string_view str, std::ostream *err);
 
   bool allow_all() const;
-  bool is_capable(std::string_view inode_path,
+  bool is_capable(boost::string_view inode_path,
                  uid_t inode_uid, gid_t inode_gid, unsigned inode_mode,
                  uid_t uid, gid_t gid, const vector<uint64_t> *caller_gid_list,
                  unsigned mask, uid_t new_uid, gid_t new_gid) const;
-  bool path_capable(std::string_view inode_path) const;
+  bool path_capable(boost::string_view inode_path) const;
 
   friend std::ostream &operator<<(std::ostream &out, const MDSAuthCaps &cap);
 };
index 3a86bcf258c1303bffc1d821365453544ba85873..f9a6e27e4e040f07b9987c0e87d391150e395b10 100644 (file)
@@ -70,7 +70,7 @@
 #define dout_prefix *_dout << "mds." << name << ' '
 
 // cons/des
-MDSDaemon::MDSDaemon(std::string_view n, Messenger *m, MonClient *mc) :
+MDSDaemon::MDSDaemon(boost::string_view n, Messenger *m, MonClient *mc) :
   Dispatcher(m->cct),
   mds_lock("MDSDaemon::mds_lock"),
   stopping(false),
@@ -554,7 +554,7 @@ void MDSDaemon::tick()
 
 void MDSDaemon::send_command_reply(MCommand *m, MDSRank *mds_rank,
                                   int r, bufferlist outbl,
-                                  std::string_view outs)
+                                  boost::string_view outs)
 {
   Session *session = static_cast<Session *>(m->get_connection()->get_priv());
   assert(session != NULL);
index 5cb0166a4c1a8ea90bc1cd3aaea655d3ff6b501b..713a3e44ea3d358d8123c6d720ce501f143f3b04 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MDS_H
 #define CEPH_MDS_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "common/LogClient.h"
 #include "common/Mutex.h"
@@ -65,7 +65,7 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
   MDSRankDispatcher *mds_rank;
 
  public:
-  MDSDaemon(std::string_view n, Messenger *m, MonClient *mc);
+  MDSDaemon(boost::string_view n, Messenger *m, MonClient *mc);
   ~MDSDaemon() override;
   int orig_argc;
   const char **orig_argv;
@@ -143,7 +143,7 @@ protected:
   // special message types
   friend class C_MDS_Send_Command_Reply;
   static void send_command_reply(MCommand *m, MDSRank* mds_rank, int r,
-                                bufferlist outbl, std::string_view outs);
+                                bufferlist outbl, boost::string_view outs);
   int _handle_command(
       const cmdmap_t &cmdmap,
       MCommand *m,
index cb3c40578981deec97c3c86431fa365476ddc16a..dc283024a836e116523215701136e46eb6cfabc4 100644 (file)
@@ -20,7 +20,7 @@
 #include <map>
 #include <set>
 #include <string>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include <errno.h>
 
@@ -263,7 +263,7 @@ public:
   void set_flag(int f) { flags |= f; }
   void clear_flag(int f) { flags &= ~f; }
 
-  std::string_view get_fs_name() const {return fs_name;}
+  boost::string_view get_fs_name() const {return fs_name;}
 
   void set_snaps_allowed() {
     set_flag(CEPH_MDSMAP_ALLOW_SNAPS);
@@ -344,7 +344,7 @@ public:
     assert(up.count(m) && mds_info.count(up.at(m)));
     return mds_info.at(up.at(m));
   }
-  mds_gid_t find_mds_gid_by_name(std::string_view s) const {
+  mds_gid_t find_mds_gid_by_name(boost::string_view s) const {
     for (std::map<mds_gid_t,mds_info_t>::const_iterator p = mds_info.begin();
         p != mds_info.end();
         ++p) {
index 7936416b1be0abb582253fd6e614f89eabe5cf48..ac75d074ffd5b3354128bde36d20fe116d188504 100644 (file)
@@ -12,7 +12,7 @@
  *
  */
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "common/debug.h"
 #include "common/errno.h"
@@ -2001,7 +2001,7 @@ protected:
 public:
   C_MDS_Send_Command_Reply(MDSRank *_mds, MCommand *_m) :
     MDSInternalContext(_mds), m(_m) { m->get(); }
-  void send (int r, std::string_view out_str) {
+  void send (int r, boost::string_view out_str) {
     bufferlist bl;
     MDSDaemon::send_command_reply(m, mds, r, bl, out_str);
     m->put();
@@ -2097,7 +2097,7 @@ void MDSRankDispatcher::dump_sessions(const SessionFilter &filter, Formatter *f)
   f->close_section(); //sessions
 }
 
-void MDSRank::command_scrub_path(Formatter *f, std::string_view path, vector<string>& scrubop_vec)
+void MDSRank::command_scrub_path(Formatter *f, boost::string_view path, vector<string>& scrubop_vec)
 {
   bool force = false;
   bool recursive = false;
@@ -2120,7 +2120,7 @@ void MDSRank::command_scrub_path(Formatter *f, std::string_view path, vector<str
 }
 
 void MDSRank::command_tag_path(Formatter *f,
-    std::string_view path, std::string_view tag)
+    boost::string_view path, boost::string_view tag)
 {
   C_SaferCond scond;
   {
@@ -2130,7 +2130,7 @@ void MDSRank::command_tag_path(Formatter *f,
   scond.wait();
 }
 
-void MDSRank::command_flush_path(Formatter *f, std::string_view path)
+void MDSRank::command_flush_path(Formatter *f, boost::string_view path)
 {
   C_SaferCond scond;
   {
@@ -2308,7 +2308,7 @@ void MDSRank::command_get_subtrees(Formatter *f)
 
 
 void MDSRank::command_export_dir(Formatter *f,
-    std::string_view path,
+    boost::string_view path,
     mds_rank_t target)
 {
   int r = _command_export_dir(path, target);
@@ -2318,7 +2318,7 @@ void MDSRank::command_export_dir(Formatter *f,
 }
 
 int MDSRank::_command_export_dir(
-    std::string_view path,
+    boost::string_view path,
     mds_rank_t target)
 {
   Mutex::Locker l(mds_lock);
index 4fa586a670cf29b3b998ef2b9326a9445bf7ed0d..ce4d369e2398cc210d08be375bc46ef28fdbd1ed 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef MDS_RANK_H_
 #define MDS_RANK_H_
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "common/DecayCounter.h"
 #include "common/LogClient.h"
@@ -416,14 +416,14 @@ class MDSRank {
 
   protected:
     void dump_clientreplay_status(Formatter *f) const;
-    void command_scrub_path(Formatter *f, std::string_view path, vector<string>& scrubop_vec);
-    void command_tag_path(Formatter *f, std::string_view path,
-                          std::string_view tag);
-    void command_flush_path(Formatter *f, std::string_view path);
+    void command_scrub_path(Formatter *f, boost::string_view path, vector<string>& scrubop_vec);
+    void command_tag_path(Formatter *f, boost::string_view path,
+                          boost::string_view tag);
+    void command_flush_path(Formatter *f, boost::string_view path);
     void command_flush_journal(Formatter *f);
     void command_get_subtrees(Formatter *f);
     void command_export_dir(Formatter *f,
-        std::string_view path, mds_rank_t dest);
+        boost::string_view path, mds_rank_t dest);
     bool command_dirfrag_split(
         cmdmap_t cmdmap,
         std::ostream &ss);
@@ -434,7 +434,7 @@ class MDSRank {
         cmdmap_t cmdmap,
         std::ostream &ss,
         Formatter *f);
-    int _command_export_dir(std::string_view path, mds_rank_t dest);
+    int _command_export_dir(boost::string_view path, mds_rank_t dest);
     int _command_flush_journal(std::stringstream *ss);
     CDir *_command_dirfrag_get(
         const cmdmap_t &cmdmap,
index 1be12108515ffa0691ee8a33daf8f653762b0aeb..fef84259185b8ee62c5b1de7aaa688e4c6dd480e 100644 (file)
@@ -44,7 +44,7 @@ static int dout_wrapper(lua_State *L)
   return 0;
 }
 
-int Mantle::balance(std::string_view script,
+int Mantle::balance(boost::string_view script,
                     mds_rank_t whoami,
                     const std::vector<std::map<std::string, double>> &metrics,
                     std::map<mds_rank_t, double> &my_targets)
index ffc1843a5e68fc92770299af8c74fdcd07a21fad..563227248d24ded36f6e0d5aa1606f6b4b057b0d 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MANTLE_H
 #define CEPH_MANTLE_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include <lua.hpp>
 #include <vector>
@@ -28,7 +28,7 @@ class Mantle {
   public:
     Mantle();
     ~Mantle() { if (L) lua_close(L); }
-    int balance(std::string_view script,
+    int balance(boost::string_view script,
                 mds_rank_t whoami,
                 const std::vector <std::map<std::string, double>> &metrics,
                 std::map<mds_rank_t,double> &my_targets);
index 753216199a1c1c335d353f365ac2254986197323..30032d4da7dd9554e70bef1bd0a0c4c4fc2b82bd 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef SCRUB_HEADER_H_
 #define SCRUB_HEADER_H_
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 class CInode;
 
@@ -26,7 +26,7 @@ class CInode;
  */
 class ScrubHeader {
 public:
-  ScrubHeader(std::string_view tag_, bool force_, bool recursive_,
+  ScrubHeader(boost::string_view tag_, bool force_, bool recursive_,
               bool repair_, Formatter *f_)
       : tag(tag_), force(force_), recursive(recursive_), repair(repair_),
         formatter(f_), origin(nullptr)
@@ -42,7 +42,7 @@ public:
   bool get_repair() const { return repair; }
   bool get_force() const { return force; }
   const CInode *get_origin() const { return origin; }
-  std::string_view get_tag() const { return tag; }
+  boost::string_view get_tag() const { return tag; }
   Formatter &get_formatter() const { return *formatter; }
 
   bool get_repaired() const { return repaired; }
index ea96f0dd2290829984a6e7f23d0cf2bbcaba9cff..729457b38dc0b90e249e1628107fd69355adf360 100644 (file)
@@ -61,7 +61,7 @@
 
 #include <list>
 #include <iostream>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 using namespace std;
 
 #include "common/config.h"
@@ -2463,7 +2463,7 @@ bool Server::check_fragment_space(MDRequestRef &mdr, CDir *in)
  * verify that the dir exists and would own the dname.
  * do not check if the dentry exists.
  */
-CDir *Server::validate_dentry_dir(MDRequestRef& mdr, CInode *diri, std::string_view dname)
+CDir *Server::validate_dentry_dir(MDRequestRef& mdr, CInode *diri, boost::string_view dname)
 {
   // make sure parent is a dir?
   if (!diri->is_dir()) {
@@ -2493,7 +2493,7 @@ CDir *Server::validate_dentry_dir(MDRequestRef& mdr, CInode *diri, std::string_v
  * prepare a null (or existing) dentry in given dir. 
  * wait for any dn lock.
  */
-CDentry* Server::prepare_null_dentry(MDRequestRef& mdr, CDir *dir, std::string_view dname, bool okexist)
+CDentry* Server::prepare_null_dentry(MDRequestRef& mdr, CDir *dir, boost::string_view dname, bool okexist)
 {
   dout(10) << "prepare_null_dentry " << dname << " in " << *dir << dendl;
   assert(dir->is_auth());
@@ -2891,7 +2891,7 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequestRef& mdr, int n,
   }
 
   // make a null dentry?
-  std::string_view dname = refpath.last_dentry();
+  boost::string_view dname = refpath.last_dentry();
   CDentry *dn;
   if (mustexist) {
     dn = dir->lookup(dname);
@@ -6505,7 +6505,7 @@ void Server::handle_client_rename(MDRequestRef& mdr)
     respond_to_request(mdr, -EINVAL);
     return;
   }
-  std::string_view destname = destpath.last_dentry();
+  boost::string_view destname = destpath.last_dentry();
 
   vector<CDentry*>& srctrace = mdr->dn[1];
   vector<CDentry*>& desttrace = mdr->dn[0];
@@ -8507,7 +8507,7 @@ void Server::handle_client_mksnap(MDRequestRef& mdr)
     return;
   }
   
-  std::string_view snapname = req->get_filepath().last_dentry();
+  boost::string_view snapname = req->get_filepath().last_dentry();
 
   if (mdr->client_request->get_caller_uid() < g_conf->mds_snap_min_uid || mdr->client_request->get_caller_uid() > g_conf->mds_snap_max_uid) {
     dout(20) << "mksnap " << snapname << " on " << *diri << " denied to uid " << mdr->client_request->get_caller_uid() << dendl;
@@ -8649,7 +8649,7 @@ void Server::handle_client_rmsnap(MDRequestRef& mdr)
     return;
   }
 
-  std::string_view snapname = req->get_filepath().last_dentry();
+  boost::string_view snapname = req->get_filepath().last_dentry();
 
   if (mdr->client_request->get_caller_uid() < g_conf->mds_snap_min_uid || mdr->client_request->get_caller_uid() > g_conf->mds_snap_max_uid) {
     dout(20) << "rmsnap " << snapname << " on " << *diri << " denied to uid " << mdr->client_request->get_caller_uid() << dendl;
@@ -8787,8 +8787,8 @@ void Server::handle_client_renamesnap(MDRequestRef& mdr)
     return;
   }
 
-  std::string_view dstname = req->get_filepath().last_dentry();
-  std::string_view srcname = req->get_filepath2().last_dentry();
+  boost::string_view dstname = req->get_filepath().last_dentry();
+  boost::string_view srcname = req->get_filepath2().last_dentry();
   dout(10) << "renamesnap " << srcname << "->" << dstname << " on " << *diri << dendl;
 
   if (srcname.length() == 0 || srcname[0] == '_') {
index ae5886d339780356202c8208c383fe5e28ef34c6..2866a51f35595ce71587fedfbd707667b205667a 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MDS_SERVER_H
 #define CEPH_MDS_SERVER_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "MDSRank.h"
 #include "Mutation.h"
@@ -167,9 +167,9 @@ public:
   bool check_fragment_space(MDRequestRef& mdr, CDir *in);
   bool check_access(MDRequestRef& mdr, CInode *in, unsigned mask);
   bool _check_access(Session *session, CInode *in, unsigned mask, int caller_uid, int caller_gid, int setattr_uid, int setattr_gid);
-  CDir *validate_dentry_dir(MDRequestRef& mdr, CInode *diri, std::string_view dname);
+  CDir *validate_dentry_dir(MDRequestRef& mdr, CInode *diri, boost::string_view dname);
   CDir *traverse_to_auth_dir(MDRequestRef& mdr, vector<CDentry*> &trace, filepath refpath);
-  CDentry *prepare_null_dentry(MDRequestRef& mdr, CDir *dir, std::string_view dname, bool okexist=false);
+  CDentry *prepare_null_dentry(MDRequestRef& mdr, CDir *dir, boost::string_view dname, bool okexist=false);
   CDentry *prepare_stray_dentry(MDRequestRef& mdr, CInode *in);
   CInode* prepare_new_inode(MDRequestRef& mdr, CDir *dir, inodeno_t useino, unsigned mode,
                            file_layout_t *layout=NULL);
index 8dc1d1b3161b96036bdf553e56486d09aad6a46a..189b144ec2203c01e8809de6c989026a240ad7fd 100644 (file)
@@ -976,7 +976,7 @@ int SessionFilter::parse(
        * Strict boolean parser.  Allow true/false/0/1.
        * Anything else is -EINVAL.
        */
-      auto is_true = [](std::string_view bstr, bool *out) -> bool
+      auto is_true = [](boost::string_view bstr, bool *out) -> bool
       {
         assert(out != nullptr);
 
index 5739c469e7528f07f461a0a1cc1369260721a4e0..14e203f700c19e54bd6641c25b77cba2faf74343 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_SNAPCLIENT_H
 #define CEPH_SNAPCLIENT_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "MDSTableClient.h"
 #include "snap.h"
@@ -31,7 +31,7 @@ public:
   void resend_queries() override {}
   void handle_query_result(MMDSTableRequest *m) override {}
 
-  void prepare_create(inodeno_t dirino, std::string_view name, utime_t stamp,
+  void prepare_create(inodeno_t dirino, boost::string_view name, utime_t stamp,
                      version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
     bufferlist bl;
     __u32 op = TABLE_OP_CREATE;
@@ -59,7 +59,7 @@ public:
     _prepare(bl, pstid, pbl, onfinish);
   }
 
-  void prepare_update(inodeno_t ino, snapid_t snapid, std::string_view name, utime_t stamp,
+  void prepare_update(inodeno_t ino, snapid_t snapid, boost::string_view name, utime_t stamp,
                      version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
     bufferlist bl;
     __u32 op = TABLE_OP_UPDATE;
index d4f5c82f756aac4d6b9905813802218f290eb07f..2e3fea9573f23dbb0fee5d5cc6dad5b5b5d694c6 100644 (file)
@@ -16,7 +16,7 @@
 #include "MDCache.h"
 #include "MDSRank.h"
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "messages/MClientSnap.h"
 
@@ -340,7 +340,7 @@ void SnapRealm::get_snap_info(map<snapid_t,SnapInfo*>& infomap, snapid_t first,
     parent->get_snap_info(infomap, MAX(first, srnode.current_parent_since), last);
 }
 
-std::string_view SnapRealm::get_snapname(snapid_t snapid, inodeno_t atino)
+boost::string_view SnapRealm::get_snapname(snapid_t snapid, inodeno_t atino)
 {
   auto srnode_snaps_entry = srnode.snaps.find(snapid);
   if (srnode_snaps_entry != srnode.snaps.end()) {
@@ -363,7 +363,7 @@ std::string_view SnapRealm::get_snapname(snapid_t snapid, inodeno_t atino)
   return parent->get_snapname(snapid, atino);
 }
 
-snapid_t SnapRealm::resolve_snapname(std::string_view n, inodeno_t atino, snapid_t first, snapid_t last)
+snapid_t SnapRealm::resolve_snapname(boost::string_view n, inodeno_t atino, snapid_t first, snapid_t last)
 {
   // first try me
   dout(10) << "resolve_snapname '" << n << "' in [" << first << "," << last << "]" << dendl;
index c0723882996e7d0def54b1b0c47c590f643e460f..7aacb47d61c1c881af18ad8332f251642d0aec0b 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MDS_SNAPREALM_H
 #define CEPH_MDS_SNAPREALM_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "mdstypes.h"
 #include "snap.h"
@@ -65,7 +65,7 @@ public:
     inodes_with_caps(0) 
   { }
 
-  bool exists(std::string_view name) const {
+  bool exists(boost::string_view name) const {
     for (map<snapid_t,SnapInfo>::const_iterator p = srnode.snaps.begin();
         p != srnode.snaps.end();
         ++p) {
@@ -96,8 +96,8 @@ public:
   const bufferlist& get_snap_trace();
   void build_snap_trace(bufferlist& snapbl) const;
 
-  std::string_view get_snapname(snapid_t snapid, inodeno_t atino);
-  snapid_t resolve_snapname(std::string_view name, inodeno_t atino, snapid_t first=0, snapid_t last=CEPH_NOSNAP);
+  boost::string_view get_snapname(snapid_t snapid, inodeno_t atino);
+  snapid_t resolve_snapname(boost::string_view name, inodeno_t atino, snapid_t first=0, snapid_t last=CEPH_NOSNAP);
 
   const set<snapid_t>& get_snaps() const;
   const SnapContext& get_snap_context() const;
index b0ba1f4680daf5c596433d7b660c7114c1eb5ef1..bd2b7fad10bef8da4bf453db2b57080dca14c256 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MDS_EMETABLOB_H
 #define CEPH_MDS_EMETABLOB_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include <stdlib.h>
 
@@ -80,9 +80,9 @@ public:
     fullbit(const fullbit& o);
     const fullbit& operator=(const fullbit& o);
 
-    fullbit(std::string_view d, snapid_t df, snapid_t dl, 
+    fullbit(boost::string_view d, snapid_t df, snapid_t dl, 
            version_t v, const CInode::mempool_inode& i, const fragtree_t &dft,
-           const CInode::mempool_xattr_map &xa, std::string_view sym,
+           const CInode::mempool_xattr_map &xa, boost::string_view sym,
            snapid_t os, const bufferlist &sbl, __u8 st,
            const CInode::mempool_old_inode_map *oi = NULL) :
       dn(d), dnfirst(df), dnlast(dl), dnv(v), inode(i), xattrs(xa),
@@ -145,7 +145,7 @@ public:
     unsigned char d_type;
     bool dirty;
 
-    remotebit(std::string_view d, snapid_t df, snapid_t dl, version_t v, inodeno_t i, unsigned char dt, bool dr) : 
+    remotebit(boost::string_view d, snapid_t df, snapid_t dl, version_t v, inodeno_t i, unsigned char dt, bool dr) : 
       dn(d), dnfirst(df), dnlast(dl), dnv(v), ino(i), d_type(dt), dirty(dr) { }
     explicit remotebit(bufferlist::iterator &p) { decode(p); }
     remotebit(): dnfirst(0), dnlast(0), dnv(0), ino(0),
@@ -172,7 +172,7 @@ public:
     version_t dnv;
     bool dirty;
 
-    nullbit(std::string_view d, snapid_t df, snapid_t dl, version_t v, bool dr) :
+    nullbit(boost::string_view d, snapid_t df, snapid_t dl, version_t v, bool dr) :
       dn(d), dnfirst(df), dnlast(dl), dnv(v), dirty(dr) { }
     explicit nullbit(bufferlist::iterator &p) { decode(p); }
     nullbit(): dnfirst(0), dnlast(0), dnv(0), dirty(false) {}
index 87b988f82821da03a06252dc155b0c7a3e400c38..6eb3ce56308515b744a3335ac3793ee0a5686400 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef CEPH_INODE_BACKTRACE_H
 #define CEPH_INODE_BACKTRACE_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "mdstypes.h"
 
@@ -27,7 +27,7 @@ struct inode_backpointer_t {
   version_t version;   // child's version at time of backpointer creation
 
   inode_backpointer_t() : version(0) {}
-  inode_backpointer_t(inodeno_t i, std::string_view d, version_t v) : dirino(i), dname(d), version(v) {}
+  inode_backpointer_t(inodeno_t i, boost::string_view d, version_t v) : dirino(i), dname(d), version(v) {}
 
   void encode(bufferlist& bl) const;
   void decode(bufferlist::iterator &bl);
index dcbfff20b571e4278267579791b825b4c09af162..ea7fa6f4ccdc4cff082fa02769993050da340507 100644 (file)
@@ -986,20 +986,20 @@ void EMetaBlob::get_paths(
 
     for (list<ceph::shared_ptr<fullbit> >::const_iterator
         iter = fb_list.begin(); iter != fb_list.end(); ++iter) {
-      std::string_view dentry = (*iter)->dn;
+      boost::string_view dentry = (*iter)->dn;
       children[dir_ino].emplace_back(dentry);
       ino_locations[(*iter)->inode.ino] = Location(dir_ino, dentry);
     }
 
     for (list<nullbit>::const_iterator
        iter = nb_list.begin(); iter != nb_list.end(); ++iter) {
-      std::string_view dentry = iter->dn;
+      boost::string_view dentry = iter->dn;
       children[dir_ino].emplace_back(dentry);
     }
 
     for (list<remotebit>::const_iterator
        iter = rb_list.begin(); iter != rb_list.end(); ++iter) {
-      std::string_view dentry = iter->dn;
+      boost::string_view dentry = iter->dn;
       children[dir_ino].emplace_back(dentry);
     }
   }
@@ -1029,14 +1029,14 @@ void EMetaBlob::get_paths(
     list<nullbit> const &nb_list = dl.get_dnull();
     for (list<nullbit>::const_iterator
        iter = nb_list.begin(); iter != nb_list.end(); ++iter) {
-      std::string_view dentry = iter->dn;
+      boost::string_view dentry = iter->dn;
       leaf_locations.push_back(Location(dir_ino, dentry));
     }
 
     list<remotebit> const &rb_list = dl.get_dremote();
     for (list<remotebit>::const_iterator
        iter = rb_list.begin(); iter != rb_list.end(); ++iter) {
-      std::string_view dentry = iter->dn;
+      boost::string_view dentry = iter->dn;
       leaf_locations.push_back(Location(dir_ino, dentry));
     }
   }
index d878ac6c679c219ae3624d9393619a3989a6b0fc..638924f6b668186cc701cc7a3c308ebd3ce3a7d6 100644 (file)
@@ -9,7 +9,7 @@
 #include <ostream>
 #include <set>
 #include <map>
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "common/config.h"
 #include "common/Clock.h"
@@ -758,7 +758,7 @@ void inode_t<Allocator>::decode(bufferlist::iterator &p)
   if (struct_v >= 12) {
     std::string tmp;
     ::decode(tmp, p);
-    stray_prior_path = std::string_view(tmp);
+    stray_prior_path = boost::string_view(tmp);
   }
 
   if (struct_v >= 13) {
@@ -1093,10 +1093,10 @@ WRITE_CLASS_ENCODER_FEATURES(session_info_t)
 
 struct dentry_key_t {
   snapid_t snapid = 0;
-  std::string_view name;
+  boost::string_view name;
   __u32 hash = 0;
   dentry_key_t() {}
-  dentry_key_t(snapid_t s, std::string_view n, __u32 h=0) :
+  dentry_key_t(snapid_t s, boost::string_view n, __u32 h=0) :
     snapid(s), name(n), hash(h) {}
 
   bool is_valid() { return name.length() || snapid; }
@@ -1125,10 +1125,10 @@ struct dentry_key_t {
     ::decode(key, bl);
     decode_helper(key, nm, sn);
   }
-  static void decode_helper(std::string_view key, string& nm, snapid_t& sn) {
+  static void decode_helper(boost::string_view key, string& nm, snapid_t& sn) {
     size_t i = key.find_last_of('_');
     assert(i != string::npos);
-    if (key.compare(i+1, std::string_view::npos, "head") == 0) {
+    if (key.compare(i+1, boost::string_view::npos, "head") == 0) {
       // name_head
       sn = CEPH_NOSNAP;
     } else {
@@ -1138,7 +1138,7 @@ struct dentry_key_t {
       sscanf(x_str.c_str(), "%llx", &x);
       sn = x;
     }  
-    nm = key.substr(0, i);
+    nm = std::string(key.substr(0, i));
   }
 };
 
@@ -1169,7 +1169,7 @@ struct string_snap_t {
   string name;
   snapid_t snapid;
   string_snap_t() {}
-  string_snap_t(std::string_view n, snapid_t s) : name(n), snapid(s) {}
+  string_snap_t(boost::string_view n, snapid_t s) : name(n), snapid(s) {}
   string_snap_t(const char *n, snapid_t s) : name(n), snapid(s) {}
 
   void encode(bufferlist& bl) const;
@@ -1269,7 +1269,7 @@ struct cap_reconnect_t {
     memset(&capinfo, 0, sizeof(capinfo));
     snap_follows = 0;
   }
-  cap_reconnect_t(uint64_t cap_id, inodeno_t pino, std::string_view p, int w, int i,
+  cap_reconnect_t(uint64_t cap_id, inodeno_t pino, boost::string_view p, int w, int i,
                  inodeno_t sr, snapid_t sf, bufferlist& lb) :
     path(p) {
     capinfo.cap_id = cap_id;
index 451e1f7929099ab4244959a00df2a6019e5feece..cebf393681224529ac790f272ecb6c7e66794286 100644 (file)
@@ -12,7 +12,7 @@
  * 
  */
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "snap.h"
 
@@ -68,7 +68,7 @@ ostream& operator<<(ostream& out, const SnapInfo &sn)
             << "' " << sn.stamp << ")";
 }
 
-std::string_view SnapInfo::get_long_name()
+boost::string_view SnapInfo::get_long_name()
 {
   if (long_name.length() == 0) {
     char nm[80];
index 0c44c83cfc6bd53fa36f42a285e8926295b17a91..a10f4f86c4c59bbb915b988079e27123cc68a58f 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MDS_SNAP_H
 #define CEPH_MDS_SNAP_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "mdstypes.h"
 #include "common/snap_types.h"
@@ -36,7 +36,7 @@ struct SnapInfo {
   void dump(Formatter *f) const;
   static void generate_test_instances(list<SnapInfo*>& ls);
 
-  std::string_view get_long_name();
+  boost::string_view get_long_name();
 };
 WRITE_CLASS_ENCODER(SnapInfo)
 
index 8361e598ca602eb9b9f1f4f2b8c9e1b0e18b43a3..2f4331789d32a630b2219dac7cc6583cccea97d9 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MCACHEEXPIRE_H
 #define CEPH_MCACHEEXPIRE_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "mds/mdstypes.h"
 
@@ -78,7 +78,7 @@ public:
   void add_dir(dirfrag_t r, dirfrag_t df, unsigned nonce) {
     realms[r].dirs[df] = nonce;
   }
-  void add_dentry(dirfrag_t r, dirfrag_t df, std::string_view dn, snapid_t last, unsigned nonce) {
+  void add_dentry(dirfrag_t r, dirfrag_t df, boost::string_view dn, snapid_t last, unsigned nonce) {
     realms[r].dentries[df][pair<string,snapid_t>(dn,last)] = nonce;
   }
 
index f0596106b0973215d58f5591b0eaeb43027967a9..4af79716cef31cc06946fdbe62901ef7655cc9be 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef CEPH_MCLIENTLEASE_H
 #define CEPH_MCLIENTLEASE_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "msg/Message.h"
 
@@ -42,7 +42,7 @@ struct MClientLease : public Message {
     h.last = sl;
     h.duration_ms = 0;
   }
-  MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl, std::string_view d) :
+  MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl, boost::string_view d) :
     Message(CEPH_MSG_CLIENT_LEASE),
     dname(d) {
     h.action = ac;
index 2a1c8fd558e5726b3427ad4178c8dfa2f96ebd5e..4b46ae24b63d9daac440ea2586920db952e87c98 100644 (file)
@@ -33,7 +33,7 @@
  *  
  */
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "msg/Message.h"
 #include "include/filepath.h"
@@ -137,7 +137,7 @@ public:
   void set_retry_attempt(int a) { head.num_retry = a; }
   void set_filepath(const filepath& fp) { path = fp; }
   void set_filepath2(const filepath& fp) { path2 = fp; }
-  void set_string2(const char *s) { path2.set_path(std::string_view(s), 0); }
+  void set_string2(const char *s) { path2.set_path(boost::string_view(s), 0); }
   void set_caller_uid(unsigned u) { head.caller_uid = u; }
   void set_caller_gid(unsigned g) { head.caller_gid = g; }
   void set_gid_list(int count, const gid_t *gids) {
index ef312c4a2bf032742d2598a67175b176305bcb51..c5d93d0ef7c67d411afeaacaa4b480c213128ade 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MCOMMANDREPLY_H
 #define CEPH_MCOMMANDREPLY_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "msg/Message.h"
 #include "MCommand.h"
@@ -31,7 +31,7 @@ class MCommandReply : public Message {
     : Message(MSG_COMMAND_REPLY), r(_r) {
     header.tid = m->get_tid();
   }
-  MCommandReply(int _r, std::string_view s)
+  MCommandReply(int _r, boost::string_view s)
     : Message(MSG_COMMAND_REPLY),
       r(_r), rs(s) { }
 private:
index 6e024d29b10f239a4ece2e00708648e435bad1f0..e4f0dcc930ab5bcbad1fcdaeef76fbc569a4912a 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef CEPH_MDENTRYLINK_H
 #define CEPH_MDENTRYLINK_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 class MDentryLink : public Message {
   dirfrag_t subtree;
@@ -34,7 +34,7 @@ class MDentryLink : public Message {
 
   MDentryLink() :
     Message(MSG_MDS_DENTRYLINK) { }
-  MDentryLink(dirfrag_t r, dirfrag_t df, std::string_view n, bool p) :
+  MDentryLink(dirfrag_t r, dirfrag_t df, boost::string_view n, bool p) :
     Message(MSG_MDS_DENTRYLINK),
     subtree(r),
     dirfrag(df),
index b4fc42e92f49c2652d711b1ee44267fe19f2ceb5..3211697e0c8f264ebf51cfec2b6e9fdfd3724bfa 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef CEPH_MDENTRYUNLINK_H
 #define CEPH_MDENTRYUNLINK_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 class MDentryUnlink : public Message {
   dirfrag_t dirfrag;
@@ -30,7 +30,7 @@ class MDentryUnlink : public Message {
 
   MDentryUnlink() :
     Message(MSG_MDS_DENTRYUNLINK) { }
-  MDentryUnlink(dirfrag_t df, std::string_view n) :
+  MDentryUnlink(dirfrag_t df, boost::string_view n) :
     Message(MSG_MDS_DENTRYUNLINK),
     dirfrag(df),
     dn(n) {}
index 191b09e8eadfd081832d486dfe7494f8bb071d8f..12f1d6f2096bb8d2f32cba367a29555aa2d1e132 100644 (file)
@@ -158,7 +158,7 @@ public:
   }
 
   //  void set_flag_forward() { flag_forward = true; }
-  void set_flag_error_dn(std::string_view dn) { 
+  void set_flag_error_dn(boost::string_view dn) { 
     flag_error_dn = true; 
     error_dentry = dn; 
   }
@@ -168,7 +168,7 @@ public:
   void set_dir_auth_hint(int a) {
     dir_auth_hint = a;
   }
-  void set_error_dentry(std::string_view dn) {
+  void set_error_dentry(boost::string_view dn) {
     error_dentry = dn;
   }
 
index 58ac160f35e10991a9a3c9cb71491dc8c222cb6b..60e64f816b63306f9de83aec7a7f72dca30773b4 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MMDSBEACON_H
 #define CEPH_MMDSBEACON_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "messages/PaxosServiceMessage.h"
 
@@ -140,7 +140,7 @@ struct MDSHealthMetric
   }
 
   MDSHealthMetric() : type(MDS_HEALTH_NULL), sev(HEALTH_OK) {}
-  MDSHealthMetric(mds_metric_t type_, health_status_t sev_, std::string_view message_)
+  MDSHealthMetric(mds_metric_t type_, health_status_t sev_, boost::string_view message_)
     : type(type_), sev(sev_), message(message_) {}
 };
 WRITE_CLASS_ENCODER(MDSHealthMetric)
index 57d7a192ffa28254b10d2dabe526dc8b3e18c5d4..21a051163e7a6500af262377430443a4b137746d 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_MMDSCACHEREJOIN_H
 #define CEPH_MMDSCACHEREJOIN_H
 
-#include <string_view>
+#include <boost/utility/string_view.hpp>
 
 #include "msg/Message.h"
 
@@ -268,20 +268,20 @@ public:
   void add_weak_dirfrag(dirfrag_t df) {
     weak_dirfrags.insert(df);
   }
-  void add_weak_dentry(inodeno_t dirino, std::string_view dname, snapid_t last, dn_weak& dnw) {
+  void add_weak_dentry(inodeno_t dirino, boost::string_view dname, snapid_t last, dn_weak& dnw) {
     weak[dirino][string_snap_t(dname, last)] = dnw;
   }
-  void add_weak_primary_dentry(inodeno_t dirino, std::string_view dname, snapid_t first, snapid_t last, inodeno_t ino) {
+  void add_weak_primary_dentry(inodeno_t dirino, boost::string_view dname, snapid_t first, snapid_t last, inodeno_t ino) {
     weak[dirino][string_snap_t(dname, last)] = dn_weak(first, ino);
   }
-  void add_strong_dentry(dirfrag_t df, std::string_view dname, snapid_t first, snapid_t last, inodeno_t pi, inodeno_t ri, unsigned char rdt, int n, int ls) {
+  void add_strong_dentry(dirfrag_t df, boost::string_view dname, snapid_t first, snapid_t last, inodeno_t pi, inodeno_t ri, unsigned char rdt, int n, int ls) {
     strong_dentries[df][string_snap_t(dname, last)] = dn_strong(first, pi, ri, rdt, n, ls);
   }
-  void add_dentry_authpin(dirfrag_t df, std::string_view dname, snapid_t last,
+  void add_dentry_authpin(dirfrag_t df, boost::string_view dname, snapid_t last,
                          const metareqid_t& ri, __u32 attempt) {
     authpinned_dentries[df][string_snap_t(dname, last)].push_back(slave_reqid(ri, attempt));
   }
-  void add_dentry_xlock(dirfrag_t df, std::string_view dname, snapid_t last,
+  void add_dentry_xlock(dirfrag_t df, boost::string_view dname, snapid_t last,
                        const metareqid_t& ri, __u32 attempt) {
     xlocked_dentries[df][string_snap_t(dname, last)] = slave_reqid(ri, attempt);
   }
index f2ef0de0b6f32ef756baead7ed03ea12caefc4af..8bcbaca4eb11e3fe4b7e2589b394fcf5bd7b4b30 100644 (file)
@@ -55,7 +55,7 @@ void PyFormatter::dump_float(const char *name, double d)
   dump_pyobject(name, PyFloat_FromDouble(d));
 }
 
-void PyFormatter::dump_string(const char *name, std::string_view s)
+void PyFormatter::dump_string(const char *name, boost::string_view s)
 {
   dump_pyobject(name, PyString_FromString(s.data()));
 }
index 9048abd989e643e11bf14f954a49715bf7fea5c5..1a813dc407443df3adb20f56de5f33ab854e9505 100644 (file)
@@ -91,7 +91,7 @@ public:
   void dump_unsigned(const char *name, uint64_t u) override;
   void dump_int(const char *name, int64_t u) override;
   void dump_float(const char *name, double d) override;
-  void dump_string(const char *name, std::string_view s) override;
+  void dump_string(const char *name, boost::string_view s) override;
   std::ostream& dump_stream(const char *name) override;
   void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
 
index 481a37a518bd6e8e57e994fbb3383c2acd504a52..1c5a7c2b082b7ee064ee92754655ffeb9ca7e90e 100644 (file)
@@ -125,7 +125,7 @@ void RGWFormatter_Plain::dump_float(const char *name, double d)
   dump_value_int(name, "%f", d);
 }
 
-void RGWFormatter_Plain::dump_string(const char *name, std::string_view s)
+void RGWFormatter_Plain::dump_string(const char *name, boost::string_view s)
 {
   dump_format(name, "%s", s.data());
 }
index 81cc5478d0627edffd9db1e5586aa08301529e63..1ffc8cd4521cce6bd3610bf8e8040d1dfd8d895e 100644 (file)
@@ -41,7 +41,7 @@ public:
   void dump_unsigned(const char *name, uint64_t u) override;
   void dump_int(const char *name, int64_t u) override;
   void dump_float(const char *name, double d) override;
-  void dump_string(const char *name, std::string_view s) override;
+  void dump_string(const char *name, boost::string_view s) override;
   std::ostream& dump_stream(const char *name) override;
   void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
   int get_len() const override;