From: Patrick Donnelly Date: Wed, 21 Feb 2018 18:59:51 +0000 (-0800) Subject: mds: convert to boost::string_view X-Git-Tag: v12.2.5~99^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7d8b3c1082b6b870710989773f3cd98a472b9a3d;p=ceph.git mds: convert to boost::string_view This is a compatibility band-aid on this backport. Signed-off-by: Patrick Donnelly --- diff --git a/src/client/MetaRequest.h b/src/client/MetaRequest.h index a6f9d0e540c2..56dc4d973064 100644 --- a/src/client/MetaRequest.h +++ b/src/client/MetaRequest.h @@ -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(); diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc index 3375cb792c39..5479a6e3b36a 100644 --- a/src/common/Formatter.cc +++ b/src/common/Formatter.cc @@ -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 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); diff --git a/src/common/Formatter.h b/src/common/Formatter.h index 6cfe60dac04a..14d5f41ca3c3 100644 --- a/src/common/Formatter.h +++ b/src/common/Formatter.h @@ -6,6 +6,8 @@ #include "include/int_types.h" #include "include/buffer_fwd.h" +#include + #include #include #include @@ -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; diff --git a/src/common/HTMLFormatter.cc b/src/common/HTMLFormatter.cc index c096ec5ceea6..b9344b74b8b9 100644 --- a/src/common/HTMLFormatter.cc +++ b/src/common/HTMLFormatter.cc @@ -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; diff --git a/src/common/HTMLFormatter.h b/src/common/HTMLFormatter.h index ab725062beba..5e9b200f774e 100644 --- a/src/common/HTMLFormatter.h +++ b/src/common/HTMLFormatter.h @@ -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 void dump_template(const char *name, T arg); diff --git a/src/common/sstring.hh b/src/common/sstring.hh index 3783cc1efac6..d6c22abd1b3c 100644 --- a/src/common/sstring.hh +++ b/src/common/sstring.hh @@ -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 */ diff --git a/src/include/encoding.h b/src/include/encoding.h index 88c981c83165..65fe73266882 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -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); } diff --git a/src/include/filepath.h b/src/include/filepath.h index a7579010a71e..a2bba2d1ac12 100644 --- a/src/include/filepath.h +++ b/src/include/filepath.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include 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); diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index 3b646edb02de..ea59c57b827c 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -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), diff --git a/src/mds/Beacon.h b/src/mds/Beacon.h index 2e8b32efb678..5815a9014b61 100644 --- a/src/mds/Beacon.h +++ b/src/mds/Beacon.h @@ -16,7 +16,7 @@ #ifndef BEACON_STATE_H #define BEACON_STATE_H -#include +#include #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); diff --git a/src/mds/CDentry.h b/src/mds/CDentry.h index cee2a5df03af..abeb0c27f1e4 100644 --- a/src/mds/CDentry.h +++ b/src/mds/CDentry.h @@ -18,7 +18,7 @@ #define CEPH_CDENTRY_H #include -#include +#include #include #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; } diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index cdbd27f2a52e..46e250fc9e62 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -12,7 +12,7 @@ * */ -#include +#include #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& 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()); diff --git a/src/mds/CDir.h b/src/mds/CDir.h index 59cfdbdf55d7..8de1867329df 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #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& keys); protected: mempool::mds_co::compact_set wanted_items; @@ -599,8 +599,8 @@ protected: bufferlist& hdrbl, std::map& 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 > 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& 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& ls); void take_sub_waiting(std::list& ls); // dentry or ino void add_waiter(uint64_t mask, MDSInternalContextBase *c) override; diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 4d3bcd45f494..a2c395130191 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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. diff --git a/src/mds/CInode.h b/src/mds/CInode.h index b17ee20bc718..c87d30c4a4cc 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #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 { diff --git a/src/mds/Capability.cc b/src/mds/Capability.cc index bf43389bc77d..144f604e6510 100644 --- a/src/mds/Capability.cc +++ b/src/mds/Capability.cc @@ -192,13 +192,15 @@ void Capability::generate_test_instances(list& 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; diff --git a/src/mds/DamageTable.cc b/src/mds/DamageTable.cc index de6a5ee4b34f..2921f26d46e7 100644 --- a/src/mds/DamageTable.cc +++ b/src/mds/DamageTable.cc @@ -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( diff --git a/src/mds/DamageTable.h b/src/mds/DamageTable.h index a6550a9aa3a7..843ee32d5041 100644 --- a/src/mds/DamageTable.h +++ b/src/mds/DamageTable.h @@ -16,7 +16,7 @@ #ifndef DAMAGE_TABLE_H_ #define DAMAGE_TABLE_H_ -#include +#include #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( diff --git a/src/mds/FSMap.cc b/src/mds/FSMap.cc index 9280dc125e76..0ad1e8b10964 100644 --- a/src/mds/FSMap.cc +++ b/src/mds/FSMap.cc @@ -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 *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 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 { diff --git a/src/mds/FSMap.h b/src/mds/FSMap.h index a2e459a4783f..d1757f860122 100644 --- a/src/mds/FSMap.h +++ b/src/mds/FSMap.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include @@ -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 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 get_filesystem(fs_cluster_id_t fscid) const {return std::const_pointer_cast(filesystems.at(fscid));} std::shared_ptr get_filesystem(void) const {return std::const_pointer_cast(filesystems.begin()->second);} - std::shared_ptr get_filesystem(std::string_view name) const + std::shared_ptr 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 *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 >& summary, diff --git a/src/mds/FSMapUser.h b/src/mds/FSMapUser.h index 2ae0792ffd01..d8a73faea46f 100644 --- a/src/mds/FSMapUser.h +++ b/src/mds/FSMapUser.h @@ -16,7 +16,7 @@ #include #include -#include +#include #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; diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 22f7529b886a..e7af8f9b6606 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -12,7 +12,7 @@ * */ -#include +#include #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; diff --git a/src/mds/Locker.h b/src/mds/Locker.h index 17efa411d2bf..350264e93595 100644 --- a/src/mds/Locker.h +++ b/src/mds/Locker.h @@ -15,7 +15,7 @@ #ifndef CEPH_MDS_LOCKER_H #define CEPH_MDS_LOCKER_H -#include +#include #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); diff --git a/src/mds/LogEvent.cc b/src/mds/LogEvent.cc index 83ffbe6c1b99..64b0323527b7 100644 --- a/src/mds/LogEvent.cc +++ b/src/mds/LogEvent.cc @@ -119,7 +119,7 @@ const std::map 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)); } diff --git a/src/mds/LogEvent.h b/src/mds/LogEvent.h index df415cade583..704ccee3d7c4 100644 --- a/src/mds/LogEvent.h +++ b/src/mds/LogEvent.h @@ -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; } diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 501c097404fb..b0ff5e8bc2b6 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #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; diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index fd0e692aa96d..3d3f9686414b 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -17,7 +17,7 @@ #ifndef CEPH_MDCACHE_H #define CEPH_MDCACHE_H -#include +#include #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); diff --git a/src/mds/MDSAuthCaps.cc b/src/mds/MDSAuthCaps.cc index 6198320c45f6..7f9f4b02a34b 100644 --- a/src/mds/MDSAuthCaps.cc +++ b/src/mds/MDSAuthCaps.cc @@ -12,7 +12,7 @@ * */ -#include +#include #include #include @@ -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 *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") { diff --git a/src/mds/MDSAuthCaps.h b/src/mds/MDSAuthCaps.h index 1e6cda68cc2b..1061e9332934 100644 --- a/src/mds/MDSAuthCaps.h +++ b/src/mds/MDSAuthCaps.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #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 *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 *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); }; diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index 3a86bcf258c1..f9a6e27e4e04 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -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(m->get_connection()->get_priv()); assert(session != NULL); diff --git a/src/mds/MDSDaemon.h b/src/mds/MDSDaemon.h index 5cb0166a4c1a..713a3e44ea3d 100644 --- a/src/mds/MDSDaemon.h +++ b/src/mds/MDSDaemon.h @@ -15,7 +15,7 @@ #ifndef CEPH_MDS_H #define CEPH_MDS_H -#include +#include #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, diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index cb3c40578981..dc283024a836 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include @@ -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::const_iterator p = mds_info.begin(); p != mds_info.end(); ++p) { diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 7936416b1be0..ac75d074ffd5 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -12,7 +12,7 @@ * */ -#include +#include #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& scrubop_vec) +void MDSRank::command_scrub_path(Formatter *f, boost::string_view path, vector& scrubop_vec) { bool force = false; bool recursive = false; @@ -2120,7 +2120,7 @@ void MDSRank::command_scrub_path(Formatter *f, std::string_view path, vector +#include #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& 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& 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, diff --git a/src/mds/Mantle.cc b/src/mds/Mantle.cc index 1be12108515f..fef84259185b 100644 --- a/src/mds/Mantle.cc +++ b/src/mds/Mantle.cc @@ -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> &metrics, std::map &my_targets) diff --git a/src/mds/Mantle.h b/src/mds/Mantle.h index ffc1843a5e68..563227248d24 100644 --- a/src/mds/Mantle.h +++ b/src/mds/Mantle.h @@ -15,7 +15,7 @@ #ifndef CEPH_MANTLE_H #define CEPH_MANTLE_H -#include +#include #include #include @@ -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 > &metrics, std::map &my_targets); diff --git a/src/mds/ScrubHeader.h b/src/mds/ScrubHeader.h index 753216199a1c..30032d4da7dd 100644 --- a/src/mds/ScrubHeader.h +++ b/src/mds/ScrubHeader.h @@ -16,7 +16,7 @@ #ifndef SCRUB_HEADER_H_ #define SCRUB_HEADER_H_ -#include +#include 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; } diff --git a/src/mds/Server.cc b/src/mds/Server.cc index ea96f0dd2290..729457b38dc0 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -61,7 +61,7 @@ #include #include -#include +#include 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& srctrace = mdr->dn[1]; vector& 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] == '_') { diff --git a/src/mds/Server.h b/src/mds/Server.h index ae5886d33978..2866a51f3559 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -15,7 +15,7 @@ #ifndef CEPH_MDS_SERVER_H #define CEPH_MDS_SERVER_H -#include +#include #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 &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); diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index 8dc1d1b3161b..189b144ec220 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -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); diff --git a/src/mds/SnapClient.h b/src/mds/SnapClient.h index 5739c469e752..14e203f700c1 100644 --- a/src/mds/SnapClient.h +++ b/src/mds/SnapClient.h @@ -15,7 +15,7 @@ #ifndef CEPH_SNAPCLIENT_H #define CEPH_SNAPCLIENT_H -#include +#include #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; diff --git a/src/mds/SnapRealm.cc b/src/mds/SnapRealm.cc index d4f5c82f756a..2e3fea9573f2 100644 --- a/src/mds/SnapRealm.cc +++ b/src/mds/SnapRealm.cc @@ -16,7 +16,7 @@ #include "MDCache.h" #include "MDSRank.h" -#include +#include #include "messages/MClientSnap.h" @@ -340,7 +340,7 @@ void SnapRealm::get_snap_info(map& 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; diff --git a/src/mds/SnapRealm.h b/src/mds/SnapRealm.h index c0723882996e..7aacb47d61c1 100644 --- a/src/mds/SnapRealm.h +++ b/src/mds/SnapRealm.h @@ -15,7 +15,7 @@ #ifndef CEPH_MDS_SNAPREALM_H #define CEPH_MDS_SNAPREALM_H -#include +#include #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::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& get_snaps() const; const SnapContext& get_snap_context() const; diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index b0ba1f4680da..bd2b7fad10be 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -15,7 +15,7 @@ #ifndef CEPH_MDS_EMETABLOB_H #define CEPH_MDS_EMETABLOB_H -#include +#include #include @@ -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) {} diff --git a/src/mds/inode_backtrace.h b/src/mds/inode_backtrace.h index 87b988f82821..6eb3ce563085 100644 --- a/src/mds/inode_backtrace.h +++ b/src/mds/inode_backtrace.h @@ -3,7 +3,7 @@ #ifndef CEPH_INODE_BACKTRACE_H #define CEPH_INODE_BACKTRACE_H -#include +#include #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); diff --git a/src/mds/journal.cc b/src/mds/journal.cc index dcbfff20b571..ea7fa6f4ccdc 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -986,20 +986,20 @@ void EMetaBlob::get_paths( for (list >::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::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::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 const &nb_list = dl.get_dnull(); for (list::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 const &rb_list = dl.get_dremote(); for (list::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)); } } diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index d878ac6c679c..638924f6b668 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "common/config.h" #include "common/Clock.h" @@ -758,7 +758,7 @@ void inode_t::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; diff --git a/src/mds/snap.cc b/src/mds/snap.cc index 451e1f792909..cebf39368122 100644 --- a/src/mds/snap.cc +++ b/src/mds/snap.cc @@ -12,7 +12,7 @@ * */ -#include +#include #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]; diff --git a/src/mds/snap.h b/src/mds/snap.h index 0c44c83cfc6b..a10f4f86c4c5 100644 --- a/src/mds/snap.h +++ b/src/mds/snap.h @@ -15,7 +15,7 @@ #ifndef CEPH_MDS_SNAP_H #define CEPH_MDS_SNAP_H -#include +#include #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& ls); - std::string_view get_long_name(); + boost::string_view get_long_name(); }; WRITE_CLASS_ENCODER(SnapInfo) diff --git a/src/messages/MCacheExpire.h b/src/messages/MCacheExpire.h index 8361e598ca60..2f4331789d32 100644 --- a/src/messages/MCacheExpire.h +++ b/src/messages/MCacheExpire.h @@ -15,7 +15,7 @@ #ifndef CEPH_MCACHEEXPIRE_H #define CEPH_MCACHEEXPIRE_H -#include +#include #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(dn,last)] = nonce; } diff --git a/src/messages/MClientLease.h b/src/messages/MClientLease.h index f0596106b097..4af79716cef3 100644 --- a/src/messages/MClientLease.h +++ b/src/messages/MClientLease.h @@ -16,7 +16,7 @@ #ifndef CEPH_MCLIENTLEASE_H #define CEPH_MCLIENTLEASE_H -#include +#include #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; diff --git a/src/messages/MClientRequest.h b/src/messages/MClientRequest.h index 2a1c8fd558e5..4b46ae24b63d 100644 --- a/src/messages/MClientRequest.h +++ b/src/messages/MClientRequest.h @@ -33,7 +33,7 @@ * */ -#include +#include #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) { diff --git a/src/messages/MCommandReply.h b/src/messages/MCommandReply.h index ef312c4a2bf0..c5d93d0ef7c6 100644 --- a/src/messages/MCommandReply.h +++ b/src/messages/MCommandReply.h @@ -15,7 +15,7 @@ #ifndef CEPH_MCOMMANDREPLY_H #define CEPH_MCOMMANDREPLY_H -#include +#include #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: diff --git a/src/messages/MDentryLink.h b/src/messages/MDentryLink.h index 6e024d29b10f..e4f0dcc930ab 100644 --- a/src/messages/MDentryLink.h +++ b/src/messages/MDentryLink.h @@ -16,7 +16,7 @@ #ifndef CEPH_MDENTRYLINK_H #define CEPH_MDENTRYLINK_H -#include +#include 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), diff --git a/src/messages/MDentryUnlink.h b/src/messages/MDentryUnlink.h index b4fc42e92f49..3211697e0c8f 100644 --- a/src/messages/MDentryUnlink.h +++ b/src/messages/MDentryUnlink.h @@ -16,7 +16,7 @@ #ifndef CEPH_MDENTRYUNLINK_H #define CEPH_MDENTRYUNLINK_H -#include +#include 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) {} diff --git a/src/messages/MDiscoverReply.h b/src/messages/MDiscoverReply.h index 191b09e8eadf..12f1d6f2096b 100644 --- a/src/messages/MDiscoverReply.h +++ b/src/messages/MDiscoverReply.h @@ -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; } diff --git a/src/messages/MMDSBeacon.h b/src/messages/MMDSBeacon.h index 58ac160f35e1..60e64f816b63 100644 --- a/src/messages/MMDSBeacon.h +++ b/src/messages/MMDSBeacon.h @@ -15,7 +15,7 @@ #ifndef CEPH_MMDSBEACON_H #define CEPH_MMDSBEACON_H -#include +#include #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) diff --git a/src/messages/MMDSCacheRejoin.h b/src/messages/MMDSCacheRejoin.h index 57d7a192ffa2..21a051163e7a 100644 --- a/src/messages/MMDSCacheRejoin.h +++ b/src/messages/MMDSCacheRejoin.h @@ -15,7 +15,7 @@ #ifndef CEPH_MMDSCACHEREJOIN_H #define CEPH_MMDSCACHEREJOIN_H -#include +#include #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); } diff --git a/src/mgr/PyFormatter.cc b/src/mgr/PyFormatter.cc index f2ef0de0b6f3..8bcbaca4eb11 100644 --- a/src/mgr/PyFormatter.cc +++ b/src/mgr/PyFormatter.cc @@ -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())); } diff --git a/src/mgr/PyFormatter.h b/src/mgr/PyFormatter.h index 9048abd989e6..1a813dc40744 100644 --- a/src/mgr/PyFormatter.h +++ b/src/mgr/PyFormatter.h @@ -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; diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 481a37a518bd..1c5a7c2b082b 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -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()); } diff --git a/src/rgw/rgw_formats.h b/src/rgw/rgw_formats.h index 81cc5478d062..1ffc8cd4521c 100644 --- a/src/rgw/rgw_formats.h +++ b/src/rgw/rgw_formats.h @@ -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;