diff --git a/src/cauthtool.cc b/src/cauthtool.cc index cfd9a8d45cc..17256a70343 100644 --- a/src/cauthtool.cc +++ b/src/cauthtool.cc @@ -18,6 +18,7 @@ using namespace std; #include "common/ConfUtils.h" #include "common/ceph_argparse.h" +#include "global/global_context.h" #include "global/global_init.h" #include "auth/Crypto.h" #include "auth/Auth.h" diff --git a/src/common/Clock.cc b/src/common/Clock.cc index cb59044e96c..7707fb3d2d3 100644 --- a/src/common/Clock.cc +++ b/src/common/Clock.cc @@ -14,6 +14,7 @@ #include "common/Clock.h" +#include "common/ceph_context.h" #include "common/config.h" #include "include/utime.h" diff --git a/src/common/common_init.cc b/src/common/common_init.cc index 8e70e018e96..63402c3a729 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -14,10 +14,12 @@ #include "common/DoutStreambuf.h" #include "common/ceph_argparse.h" +#include "common/ceph_context.h" #include "common/ceph_crypto.h" #include "common/code_environment.h" #include "common/common_init.h" #include "common/config.h" +#include "common/dout.h" #include "common/errno.h" #include "common/safe_io.h" #include "common/version.h" diff --git a/src/common/config.h b/src/common/config.h index 026daf2a8f4..ac8705f99f5 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -529,6 +529,4 @@ struct config_option { const void *conf_ptr(const md_config_t *conf) const; }; -#include "common/debug.h" // TODO: remove - #endif diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index ceb0a7439f5..64cc394f690 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -13,7 +13,7 @@ */ #include "BackTrace.h" #include "Clock.h" -#include "common/config.h" +#include "common/dout.h" #include "common/environment.h" #include "include/types.h" #include "lockdep.h" diff --git a/src/crushtool.cc b/src/crushtool.cc index d3d03499199..7b02eeafcc4 100644 --- a/src/crushtool.cc +++ b/src/crushtool.cc @@ -19,10 +19,12 @@ #include +#include "common/debug.h" #include "common/errno.h" #include "common/config.h" #include "common/ceph_argparse.h" +#include "global/global_context.h" #include "global/global_init.h" #include "crush/CrushWrapper.h" #include "crush/grammar.h" diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 22930e4ffd1..fb26a9aff2c 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -18,10 +18,12 @@ #include "common/code_environment.h" #include "common/common_init.h" #include "common/config.h" +#include "common/debug.h" #include "common/errno.h" #include "common/safe_io.h" #include "common/signal.h" #include "common/version.h" +#include "global/global_context.h" #include "global/global_init.h" #include "global/pidfile.h" #include "global/signal_handler.h" diff --git a/src/include/Context.h b/src/include/Context.h index 51398696449..18f341e850b 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -16,7 +16,7 @@ #ifndef CEPH_CONTEXT_H #define CEPH_CONTEXT_H -#include "common/config.h" +#include "common/dout.h" #include "assert.h" #include diff --git a/src/include/frag.h b/src/include/frag.h index 5530363611f..f52ebdd2870 100644 --- a/src/include/frag.h +++ b/src/include/frag.h @@ -393,24 +393,24 @@ public: _splits[x] += childbits; } - bool force_to_leaf(frag_t x) { + bool force_to_leaf(CephContext *cct, frag_t x) { if (is_leaf(x)) return false; - generic_dout(10) << "force_to_leaf " << x << " on " << _splits << dendl; + lgeneric_dout(cct, 10) << "force_to_leaf " << x << " on " << _splits << dendl; frag_t parent = get_branch_or_leaf(x); assert(parent.bits() <= x.bits()); - generic_dout(10) << "parent is " << parent << dendl; + lgeneric_dout(cct, 10) << "parent is " << parent << dendl; // do we need to split from parent to x? if (parent.bits() < x.bits()) { int spread = x.bits() - parent.bits(); int nb = get_split(parent); - generic_dout(10) << "spread " << spread << ", parent splits by " << nb << dendl; + lgeneric_dout(cct, 10) << "spread " << spread << ", parent splits by " << nb << dendl; if (nb == 0) { // easy: split parent (a leaf) by the difference - generic_dout(10) << "splitting parent " << parent << " by spread " << spread << dendl; + lgeneric_dout(cct, 10) << "splitting parent " << parent << " by spread " << spread << dendl; split(parent, spread); assert(is_leaf(x)); return true; @@ -426,7 +426,7 @@ public: for (std::list::iterator p = subs.begin(); p != subs.end(); ++p) { - generic_dout(10) << "splitting intermediate " << *p << " by " << (nb-spread) << dendl; + lgeneric_dout(cct, 10) << "splitting intermediate " << *p << " by " << (nb-spread) << dendl; split(*p, nb - spread, false); } } @@ -440,13 +440,13 @@ public: q.pop_front(); int nb = get_split(t); if (nb) { - generic_dout(10) << "merging child " << t << " by " << nb << dendl; + lgeneric_dout(cct, 10) << "merging child " << t << " by " << nb << dendl; merge(t, nb, false); // merge this point, and t.split(nb, q); // queue up children } } - generic_dout(10) << "force_to_leaf done" << dendl; + lgeneric_dout(cct, 10) << "force_to_leaf done" << dendl; assert(is_leaf(x)); return true; } diff --git a/src/librados-config.cc b/src/librados-config.cc index f2ccfafdcf9..9d63a75098c 100644 --- a/src/librados-config.cc +++ b/src/librados-config.cc @@ -17,6 +17,7 @@ #include "common/ceph_argparse.h" #include "global/global_init.h" +#include "global/global_context.h" #include "include/rados/librados.h" void usage() diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 81143087262..4ec6559547f 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -42,6 +42,7 @@ #include #include "common/config.h" +#include "global/global_context.h" #define DOUT_SUBSYS mds #undef dout_prefix @@ -1328,7 +1329,7 @@ void CInode::decode_lock_state(int type, bufferlist& bl) for (set::iterator p = authfrags.begin(); p != authfrags.end(); ++p) if (!dirfragtree.is_leaf(*p)) { dout(10) << " forcing frag " << *p << " to leaf (split|merge)" << dendl; - dirfragtree.force_to_leaf(*p); + dirfragtree.force_to_leaf(g_ceph_context, *p); dirfragtreelock.mark_dirty(); // ok bc we're auth and caller will handle } } else { @@ -1342,7 +1343,7 @@ void CInode::decode_lock_state(int type, bufferlist& bl) p++) if (!dirfragtree.is_leaf(p->first)) { dout(10) << " forcing open dirfrag " << p->first << " to leaf (racing with split|merge)" << dendl; - dirfragtree.force_to_leaf(p->first); + dirfragtree.force_to_leaf(g_ceph_context, p->first); } } if (g_conf->mds_debug_frag) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 0dfff427bbc..d11799295cf 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8817,7 +8817,7 @@ CDir *MDCache::add_replica_dir(bufferlist::iterator& p, CInode *diri, int from, if (!diri->dirfragtree.is_leaf(df.frag)) { dout(7) << "add_replica_dir forcing frag " << df.frag << " to leaf in the fragtree " << diri->dirfragtree << dendl; - diri->dirfragtree.force_to_leaf(df.frag); + diri->dirfragtree.force_to_leaf(g_ceph_context, df.frag); } // add replica. @@ -9257,7 +9257,7 @@ void MDCache::adjust_dir_fragments(CInode *diri, // adjust fragtree // yuck. we may have discovered the inode while it was being fragmented. if (!diri->dirfragtree.is_leaf(basefrag)) - diri->dirfragtree.force_to_leaf(basefrag); + diri->dirfragtree.force_to_leaf(g_ceph_context, basefrag); if (bits > 0) diri->dirfragtree.split(basefrag, bits); diff --git a/src/mds/flock.h b/src/mds/flock.h index f6194653b59..0befe02b43b 100644 --- a/src/mds/flock.h +++ b/src/mds/flock.h @@ -5,6 +5,7 @@ #include +#include "common/debug.h" #include "mdstypes.h" diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index c8aa8991cc5..70b8dafcab7 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -1485,10 +1485,10 @@ protected: if (waiting.empty()) get(PIN_WAITER); waiting.insert(pair(mask, c)); - pdout(10,g_conf->debug_mds) << (mdsco_db_line_prefix(this)) - << "add_waiter " << hex << mask << dec << " " << c - << " on " << *this - << dendl; +// pdout(10,g_conf->debug_mds) << (mdsco_db_line_prefix(this)) +// << "add_waiter " << hex << mask << dec << " " << c +// << " on " << *this +// << dendl; } virtual void take_waiting(uint64_t mask, list& ls) { @@ -1497,17 +1497,17 @@ protected: while (it != waiting.end()) { if (it->first & mask) { ls.push_back(it->second); - pdout(10,g_conf->debug_mds) << (mdsco_db_line_prefix(this)) - << "take_waiting mask " << hex << mask << dec << " took " << it->second - << " tag " << hex << it->first << dec - << " on " << *this - << dendl; +// pdout(10,g_conf->debug_mds) << (mdsco_db_line_prefix(this)) +// << "take_waiting mask " << hex << mask << dec << " took " << it->second +// << " tag " << hex << it->first << dec +// << " on " << *this +// << dendl; waiting.erase(it++); } else { - pdout(10,g_conf->debug_mds) << "take_waiting mask " << hex << mask << dec << " SKIPPING " << it->second - << " tag " << hex << it->first << dec - << " on " << *this - << dendl; +// pdout(10,g_conf->debug_mds) << "take_waiting mask " << hex << mask << dec << " SKIPPING " << it->second +// << " tag " << hex << it->first << dec +// << " on " << *this +// << dendl; it++; } } diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index 48b3a328c7a..f9a6af4b6b4 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -21,6 +21,7 @@ #ifndef CEPH_PGMAP_H #define CEPH_PGMAP_H +#include "common/debug.h" #include "osd/osd_types.h" #include "common/config.h" #include diff --git a/src/objclass/class_debug.cc b/src/objclass/class_debug.cc index 85c809f910a..e0773e0b363 100644 --- a/src/objclass/class_debug.cc +++ b/src/objclass/class_debug.cc @@ -1,5 +1,6 @@ #include "common/config.h" +#include "common/debug.h" #include "objclass/objclass.h" #include diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index a6a66283be6..d6e3a0a2a33 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -12,7 +12,7 @@ * */ -#include "common/config.h" +#include "common/debug.h" #include "common/errno.h" #include "common/safe_io.h" #include "FileJournal.h" diff --git a/src/os/JournalingObjectStore.cc b/src/os/JournalingObjectStore.cc index 2041f5e1ae2..1b960638701 100644 --- a/src/os/JournalingObjectStore.cc +++ b/src/os/JournalingObjectStore.cc @@ -1,7 +1,7 @@ #include "JournalingObjectStore.h" -#include "common/config.h" +#include "common/debug.h" #define DOUT_SUBSYS journal #undef dout_prefix diff --git a/src/osd/Ager.cc b/src/osd/Ager.cc index fb8afd7e9b8..71753f8facc 100644 --- a/src/osd/Ager.cc +++ b/src/osd/Ager.cc @@ -6,8 +6,9 @@ #include "Ager.h" #include "os/ObjectStore.h" -#include "common/config.h" #include "common/Clock.h" +#include "common/debug.h" +#include "global/global_context.h" // ick #include diff --git a/src/rados.cc b/src/rados.cc index ac71b561690..97154f5cc31 100644 --- a/src/rados.cc +++ b/src/rados.cc @@ -23,6 +23,7 @@ using namespace librados; #include "common/ceph_argparse.h" #include "global/global_init.h" #include "common/Cond.h" +#include "common/debug.h" #include "mds/inode_backtrace.h" #include #include diff --git a/src/rados_sync.cc b/src/rados_sync.cc index 486a94bd6f5..b346291140f 100644 --- a/src/rados_sync.cc +++ b/src/rados_sync.cc @@ -28,6 +28,7 @@ #include #include "common/ceph_argparse.h" +#include "global/global_context.h" #include "global/global_init.h" #include "common/config.h" #include "common/errno.h" diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index 16cb3c92d5f..0ec6331cfe8 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -17,15 +17,14 @@ #include "rgw/rgw_acl.h" #include "rgw_acl.h" #include "common/ceph_argparse.h" +#include "common/ceph_context.h" #include "common/common_init.h" -#include "common/config.h" +#include "common/dout.h" #include #include #include -#define RGW_LOG(x) pdout(x, g_conf->rgw_log) - int librgw_create(librgw_t *rgw, const char * const id) { CephInitParameters iparams(CEPH_ENTITY_TYPE_CLIENT, CEPH_CONF_FILE_DEFAULT); @@ -66,11 +65,11 @@ int librgw_acl_bin2xml(librgw_t rgw, const char *bin, int bin_len, char **xml) return 0; } catch (const std::exception &e) { - RGW_LOG(-1) << "librgw_acl_bin2xml: caught exception " << e.what() << dendl; + lderr(rgw) << "librgw_acl_bin2xml: caught exception " << e.what() << dendl; return -2000; } catch (...) { - RGW_LOG(-1) << "librgw_acl_bin2xml: caught unknown exception " << dendl; + lderr(rgw) << "librgw_acl_bin2xml: caught unknown exception " << dendl; return -2000; } } @@ -111,10 +110,10 @@ int librgw_acl_xml2bin(librgw_t rgw, const char *xml, char **bin, int *bin_len) return 0; } catch (const std::exception &e) { - RGW_LOG(-1) << "librgw_acl_bin2xml: caught exception " << e.what() << dendl; + lderr(rgw) << "librgw_acl_bin2xml: caught exception " << e.what() << dendl; } catch (...) { - RGW_LOG(-1) << "librgw_acl_bin2xml: caught unknown exception " << dendl; + lderr(rgw) << "librgw_acl_bin2xml: caught unknown exception " << dendl; } if (!bin_) free(bin_); diff --git a/src/streamtest.cc b/src/streamtest.cc index 4dc19ba43a9..9736281f1a0 100644 --- a/src/streamtest.cc +++ b/src/streamtest.cc @@ -16,6 +16,7 @@ #include "os/FileStore.h" #include "global/global_init.h" #include "common/ceph_argparse.h" +#include "common/debug.h" #undef dout_prefix #define dout_prefix *_dout diff --git a/src/test/TestDoutStreambuf.cc b/src/test/TestDoutStreambuf.cc index 1cce7d9f756..22d612b8a09 100644 --- a/src/test/TestDoutStreambuf.cc +++ b/src/test/TestDoutStreambuf.cc @@ -20,8 +20,10 @@ */ #include "common/DoutStreambuf.h" #include "common/ceph_argparse.h" -#include "global/global_init.h" #include "common/config.h" +#include "common/debug.h" +#include "global/global_context.h" +#include "global/global_init.h" #include #include diff --git a/src/test/TestSignalHandlers.cc b/src/test/TestSignalHandlers.cc index 3a8acefe6ac..171060506fa 100644 --- a/src/test/TestSignalHandlers.cc +++ b/src/test/TestSignalHandlers.cc @@ -21,6 +21,7 @@ #include "common/ceph_argparse.h" #include "global/global_init.h" #include "common/errno.h" +#include "common/debug.h" #include "common/config.h" #include diff --git a/src/test/test_mutate.cc b/src/test/test_mutate.cc index c6fb6acdc4d..d93ac1cd0bf 100644 --- a/src/test/test_mutate.cc +++ b/src/test/test_mutate.cc @@ -17,6 +17,7 @@ */ #include "common/ceph_argparse.h" +#include "common/debug.h" #include "common/config.h" #include "global/global_init.h" #include "include/rados/librados.hpp" diff --git a/src/test_trans.cc b/src/test_trans.cc index 2a12c15b12d..f36f6d44d7d 100644 --- a/src/test_trans.cc +++ b/src/test_trans.cc @@ -14,6 +14,7 @@ #include #include "common/ceph_argparse.h" +#include "common/debug.h" #include "os/FileStore.h" #include "global/global_init.h" diff --git a/src/testcrypto.cc b/src/testcrypto.cc index f8abdad6e68..85195e4ec7c 100644 --- a/src/testcrypto.cc +++ b/src/testcrypto.cc @@ -2,6 +2,7 @@ #include "common/Clock.h" #include "common/config.h" +#include "common/debug.h" #define AES_KEY_LEN 16