#include "RadosDump.h"
+using std::cerr;
+using std::cout;
+
int RadosDump::read_super()
{
bufferlist ebl;
};
struct attr_section {
- map<string,bufferlist,less<>> data;
- explicit attr_section(const map<string,bufferlist,less<>> &data) : data(data) { }
- explicit attr_section(map<string, bufferptr, less<>> &data_)
+ using data_t = std::map<std::string,bufferlist,std::less<>>;
+ data_t data;
+ explicit attr_section(const data_t &data) : data(data) { }
+ explicit attr_section(std::map<std::string, bufferptr, std::less<>> &data_)
{
- for (std::map<std::string, bufferptr>::iterator i = data_.begin();
- i != data_.end(); ++i) {
+ for (auto& [k, v] : data_) {
bufferlist bl;
- bl.push_back(i->second);
- data[i->first] = bl;
+ bl.push_back(v);
+ data.emplace(k, std::move(bl));
}
}
};
struct omap_section {
- map<string, bufferlist> omap;
- explicit omap_section(const map<string, bufferlist> &omap) :
+ std::map<std::string, bufferlist> omap;
+ explicit omap_section(const std::map<std::string, bufferlist> &omap) :
omap(omap) { }
omap_section() { }
PastIntervals past_intervals;
OSDMap osdmap;
bufferlist osdmap_bl; // Used in lieu of encoding osdmap due to crc checking
- map<eversion_t, hobject_t> divergent_priors;
+ std::map<eversion_t, hobject_t> divergent_priors;
pg_missing_t missing;
metadata_section(
if (struct_v >= 6) {
decode(past_intervals, bl);
} else if (struct_v > 1) {
- cout << "NOTICE: Older export with classic past_intervals" << std::endl;
+ std::cout << "NOTICE: Older export with classic past_intervals" << std::endl;
} else {
- cout << "NOTICE: Older export without past_intervals" << std::endl;
+ std::cout << "NOTICE: Older export without past_intervals" << std::endl;
}
if (struct_v > 2) {
osdmap.decode(bl);
} else {
- cout << "WARNING: Older export without OSDMap information" << std::endl;
+ std::cout << "WARNING: Older export without OSDMap information" << std::endl;
}
if (struct_v > 3) {
decode(divergent_priors, bl);
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_client
+using namespace std;
+
void usage()
{
std::cout << "Usage: ceph-client-debug [options] <inode number>" << std::endl;
namespace fs = std::filesystem;
+using namespace std;
+
void usage(ostream &out)
{
out << "usage: ceph-dencoder [commands ...]" << std::endl;
#endif
}
const dencoders_t& register_dencoders() {
- static constexpr string_view REGISTER_DENCODERS_FUNCTION = "register_dencoders\0";
+ static constexpr std::string_view REGISTER_DENCODERS_FUNCTION = "register_dencoders\0";
assert(mod);
using register_dencoders_t = void (*)(DencoderPlugin*);
class DencoderBase : public Dencoder {
protected:
T* m_object;
- list<T*> m_list;
+ std::list<T*> m_list;
bool stray_okay;
bool nondeterministic;
return e.what();
}
if (!stray_okay && !p.end()) {
- ostringstream ss;
+ std::ostringstream ss;
ss << "stray data at end of buffer, offset " << p.get_off();
return ss.str();
}
int num_generated() override {
return m_list.size();
}
- string select_generated(unsigned i) override {
+ std::string select_generated(unsigned i) override {
// allow 0- or 1-based (by wrapping)
if (i == 0)
i = m_list.size();
if ((i == 0) || (i > m_list.size()))
return "invalid id for generated object";
m_object = *(std::next(m_list.begin(), i-1));
- return string();
+ return {};
}
bool is_deterministic() override {
template<class T>
class MessageDencoderImpl : public Dencoder {
ref_t<T> m_object;
- list<ref_t<T>> m_list;
+ std::list<ref_t<T>> m_list;
public:
MessageDencoderImpl() : m_object{make_message<T>()} {}
~MessageDencoderImpl() override {}
- string decode(bufferlist bl, uint64_t seek) override {
+ std::string decode(bufferlist bl, uint64_t seek) override {
auto p = bl.cbegin();
p.seek(seek);
try {
if (!n)
throw std::runtime_error("failed to decode");
if (n->get_type() != m_object->get_type()) {
- stringstream ss;
+ std::stringstream ss;
ss << "decoded type " << n->get_type() << " instead of expected " << m_object->get_type();
throw std::runtime_error(ss.str());
}
return e.what();
}
if (!p.end()) {
- ostringstream ss;
+ std::ostringstream ss;
ss << "stray data at end of buffer, offset " << p.get_off();
return ss.str();
}
- return string();
+ return {};
}
void encode(bufferlist& out, uint64_t features) override {
int num_generated() override {
return m_list.size();
}
- string select_generated(unsigned i) override {
+ std::string select_generated(unsigned i) override {
// allow 0- or 1-based (by wrapping)
if (i == 0)
i = m_list.size();
if ((i == 0) || (i > m_list.size()))
return "invalid id for generated object";
m_object = *(std::next(m_list.begin(), i-1));
- return string();
+ return {};
}
bool is_deterministic() override {
return true;
#include "auth/Auth.h"
#include "auth/KeyRing.h"
+using std::map;
+using std::string;
+using std::vector;
+using std::cerr;
+using std::cout;
+
void usage()
{
cout << "usage: ceph-authtool keyringfile [OPTIONS]...\n"
using std::deque;
using std::string;
+using std::unique_ptr;
+using std::cerr;
+using std::cout;
+using std::vector;
static void usage(std::ostream& out)
{
cerr << "unable to parse option: '" << *i << "'" << std::endl;
cerr << "args:";
for (auto arg : orig_args) {
- cerr << " " << quoted(arg);
+ cerr << " " << std::quoted(arg);
}
cerr << std::endl;
usage(cerr);
#include "global/signal_handler.h"
#include "common/CDC.h"
+using namespace std;
+
struct EstimateResult {
std::unique_ptr<CDC> cdc;
#include "kvstore_tool.h"
+using namespace std;
+
void usage(const char *pname)
{
std::cout << "Usage: " << pname << " <leveldb|rocksdb|bluestore-kv> <store path> command [args...]\n"
namespace po = boost::program_options;
+using namespace std;
+
class TraceIter {
int fd;
unsigned idx;
#include "include/compat.h"
#include "include/util.h"
+using namespace std;
namespace po = boost::program_options;
#ifdef INTERNAL_TEST
#include "os/filestore/DBObjectMap.h"
#include "kv/KeyValueDB.h"
+using namespace std;
namespace po = boost::program_options;
int main(int argc, char **argv) {
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_crush
+using std::cerr;
+using std::cout;
+using std::decay_t;
+using std::ifstream;
+using std::ios;
+using std::is_same_v;
+using std::map;
+using std::ofstream;
+using std::pair;
+using std::set;
+using std::string;
+using std::vector;
const char *infn = "stdin";
namespace ceph {
namespace immutable_obj_cache {
-typedef shared_ptr<librados::Rados> RadosRef;
-typedef shared_ptr<librados::IoCtx> IoCtxRef;
+typedef std::shared_ptr<librados::Rados> RadosRef;
+typedef std::shared_ptr<librados::IoCtx> IoCtxRef;
class ObjectCacheStore {
public:
}
ObjectCacheReadReplyData::ObjectCacheReadReplyData(uint16_t t, uint64_t s,
- string cache_path)
+ std::string cache_path)
: ObjectCacheRequest(t, s), cache_path(cache_path) {}
ObjectCacheReadReplyData::ObjectCacheReadReplyData(uint16_t t, uint64_t s)
: ObjectCacheRequest(t, s) {}
#include "kv/KeyValueDB.h"
#include "kv/KeyValueHistogram.h"
+using namespace std;
+
StoreTool::StoreTool(const string& type,
const string& path,
bool to_repair,
#include "include/str_list.h"
#include "mon/MonMap.h"
+using std::cerr;
+using std::cout;
+using std::list;
+using std::map;
+using std::ostream;
+using std::set;
+using std::string;
+using std::string_view;
+using std::vector;
void usage()
{
#include "global/global_init.h"
#include "osd/OSDMap.h"
+using namespace std;
void usage()
{
#include "osd/OSDMap.h"
#include "include/buffer.h"
+using namespace std;
+
int main(int argc, char **argv)
{
/*
#include "PoolDump.h"
using namespace librados;
+using std::cerr;
+using std::less;
+using std::map;
+using std::string;
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rados
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rados
+using std::cerr;
+using std::cout;
+using std::map;
+using std::string;
+
int RadosImport::import(std::string pool, bool no_overwrite)
{
librados::IoCtx ioctx;
#include "osd/ECUtil.h"
+using namespace std::chrono_literals;
using namespace librados;
using ceph::util::generate_random_number;
+using std::cerr;
+using std::cout;
+using std::dec;
+using std::hex;
+using std::less;
+using std::list;
+using std::map;
+using std::multiset;
+using std::ofstream;
+using std::ostream;
+using std::pair;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::vector;
// two steps seem to be necessary to do this right
#define STR(x) _STR(x)
++total_sec;
std::streamsize original_precision = cout.precision();
cout.precision(3);
- cout << setw(5) << total_sec << ": throughput=" << rate << "MB/sec" << " pending data=" << sent - completed << std::endl;
+ cout << std::setw(5) << total_sec << ": throughput=" << rate << "MB/sec" << " pending data=" << sent - completed << std::endl;
cout.precision(original_precision);
stamp_time = now;
}
#include "include/types.h"
#include "include/rados/librados.hpp"
+using namespace std;
using namespace librados;
void buf_to_hex(const unsigned char *buf, int len, char *str)
#undef dout_prefix
#define dout_prefix *_dout << "rbd-wnbd: "
+using namespace std;
using boost::locale::conv::utf_to_utf;
std::wstring to_wstring(const std::string& str)
#include "os/ObjectStore.h"
#include "osd/OSD.h"
+using namespace std;
+
static int update_auth(const string& keyring_path,
const OSDSuperblock& sb,
MonitorDBStore& ms);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+using namespace std;
+
void buf_to_hex(const unsigned char *buf, int len, char *str)
{
str[0] = '\0';