Skip to content

Commit

Permalink
drop unnecessary env_to_vec calls
Browse files Browse the repository at this point in the history
global[_pre]_init does this for us now.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Mar 6, 2018
1 parent 4eb0e7e commit 7f23142
Show file tree
Hide file tree
Showing 54 changed files with 2 additions and 56 deletions.
1 change: 0 additions & 1 deletion src/ceph_fuse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ int main(int argc, const char **argv, const char *envp[]) {
if (args.empty()) {
usage();
}
env_to_vec(args);

std::map<std::string,std::string> defaults = {
{ "pid_file", "" },
Expand Down
1 change: 0 additions & 1 deletion src/ceph_mds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ int main(int argc, const char **argv)

vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args,
CEPH_ENTITY_TYPE_MDS, CODE_ENVIRONMENT_DAEMON,
Expand Down
1 change: 0 additions & 1 deletion src/ceph_mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ int main(int argc, const char **argv)

vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

map<string,string> defaults = {
{ "keyring", "$mgr_data/keyring" }
Expand Down
1 change: 0 additions & 1 deletion src/ceph_mon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ int main(int argc, const char **argv)

vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

// We need to specify some default values that may be overridden by the
// user, that are specific to the monitor. The options we are overriding
Expand Down
1 change: 0 additions & 1 deletion src/ceph_osd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

map<string,string> defaults = {
// We want to enable leveldb's log, while allowing users to override this
Expand Down
1 change: 0 additions & 1 deletion src/librados-config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

bool opt_version = false;
bool opt_vernum = false;
Expand Down
1 change: 0 additions & 1 deletion src/os/bluestore/bluestore_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ int main(int argc, char **argv)
for (auto& i : ceph_option_strings) {
args.push_back(i.c_str());
}
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/rbd_replay/rbd-replay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ int main(int argc, const char **argv) {
vector<const char*> args;

argv_to_vec(argc, argv, args);
env_to_vec(args);
auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);

Expand Down
1 change: 0 additions & 1 deletion src/rgw/librgw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ int librgw_create(librgw_t* rgw, int argc, char **argv)
for (const auto& elt : spl_args) {
args.push_back(elt.c_str());
}
env_to_vec(args);
rc = rgwlib.init(args);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/rgw/rgw_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/rgw/rgw_es_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ int main(int argc, char *argv[])
{
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/rgw/rgw_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ int main(int argc, const char **argv)

vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

// First, let's determine which frontends are configured.
int flags = CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS;
Expand Down
1 change: 0 additions & 1 deletion src/rgw/rgw_object_expirer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ int main(const int argc, const char **argv)
{
vector<const char *> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_DAEMON,
Expand Down
1 change: 0 additions & 1 deletion src/rgw/rgw_token.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ int main(int argc, char **argv)
std::string val;
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/TestSignalHandlers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/TestTimers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/bench_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ int main(int argc, const char **argv)

vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_OSD,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/ceph_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ TEST_F(ForkDeathTest, MD5) {

int main(int argc, char **argv) {
std::vector<const char*> args(argv, argv + argc);
env_to_vec(args);
auto cct = global_init(NULL, args,
CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY,
Expand Down
1 change: 0 additions & 1 deletion src/test/crush/CrushWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,6 @@ TEST(CrushWrapper, try_remap_rule) {
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

map<string,string> defaults = {
{ "debug_crush", "0" }
Expand Down
1 change: 0 additions & 1 deletion src/test/direct_messenger/test_direct_messenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ int main(int argc, char **argv)
// command-line arguments
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_ANY,
CODE_ENVIRONMENT_DAEMON, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/messenger/simple_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ int main(int argc, const char **argv)
ts.tv_nsec = 0;

argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_ANY,
CODE_ENVIRONMENT_UTILITY,
Expand Down
1 change: 0 additions & 1 deletion src/test/messenger/simple_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ int main(int argc, const char **argv)
cout << "Simple Server starting..." << endl;

argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_ANY,
CODE_ENVIRONMENT_DAEMON,
Expand Down
1 change: 0 additions & 1 deletion src/test/messenger/xio_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ int main(int argc, const char **argv)
ts.tv_nsec = 0;

argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args,
CEPH_ENTITY_TYPE_ANY,
Expand Down
1 change: 0 additions & 1 deletion src/test/messenger/xio_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ int main(int argc, const char **argv)
cout << "Xio Server starting..." << endl;

argv_to_vec(argc, argv, args);
env_to_vec(args);

global_init(NULL, args, CEPH_ENTITY_TYPE_ANY, CODE_ENVIRONMENT_DAEMON,
0);
Expand Down
1 change: 0 additions & 1 deletion src/test/msgr/test_msgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,6 @@ TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
g_ceph_context->_conf->set_val("auth_cluster_required", "none");
Expand Down
1 change: 0 additions & 1 deletion src/test/objectstore/store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7071,7 +7071,6 @@ TEST_P(StoreTest, BluestoreRepairTest) {
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/objectstore/test_bluefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ TEST(BlueFS, test_replay) {
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

map<string,string> defaults = {
{ "debug_bluefs", "1/20" },
Expand Down
1 change: 0 additions & 1 deletion src/test/objectstore/test_bluestore_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,6 @@ TEST(BlueStoreRepairer, StoreSpaceTracker)
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);
auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
Expand Down
1 change: 0 additions & 1 deletion src/test/objectstore/test_kv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/objectstore_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ int main(int argc, const char *argv[])
// command-line arguments
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_OSD,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/osd/TestOSDMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ using namespace std;

int main(int argc, char **argv) {
std::vector<const char*> args(argv, argv+argc);
env_to_vec(args);
auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY,
CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
Expand Down
1 change: 0 additions & 1 deletion src/test/osdc/object_cacher_stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ int main(int argc, const char **argv)
{
std::vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);
auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);

Expand Down
1 change: 0 additions & 1 deletion src/test/rbd_mirror/random_write.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ int main(int argc, const char **argv)
{
std::vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/rgw/test_rgw_manifest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ TEST(TestRGWManifest, old_obj_manifest) {
int main(int argc, char **argv) {
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
Expand Down
1 change: 0 additions & 1 deletion src/test/test_mutate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ int main(int argc, const char **argv)
int ret = 0;
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);
auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
Expand Down
1 change: 0 additions & 1 deletion src/test/test_trans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/testkeys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/testmsgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ int main(int argc, const char **argv, const char *envp[]) {

vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/test/unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
*/
int main(int argc, char **argv) {
std::vector<const char*> args(argv, argv + argc);
env_to_vec(args);
auto cct = global_init(NULL, args,
CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/tools/ceph-client-debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ int main(int argc, const char **argv)
// Argument handling
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY,
Expand Down
1 change: 0 additions & 1 deletion src/tools/ceph_authtool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

std::string add_key;
std::string caps_fn;
Expand Down
1 change: 0 additions & 1 deletion src/tools/ceph_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ int main(int argc, const char **argv)
std::string dump_format;

argv_to_vec(argc, argv, args);
env_to_vec(args);
vector<const char*> orig_args = args;

global_pre_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_DAEMON,
Expand Down
1 change: 0 additions & 1 deletion src/tools/ceph_kvstore_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ int main(int argc, const char *argv[])
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(
NULL, args,
Expand Down
1 change: 0 additions & 1 deletion src/tools/ceph_objectstore_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,6 @@ int main(int argc, char **argv)
head = (vm.count("head") > 0);

vector<const char *> ceph_options;
env_to_vec(ceph_options);
ceph_options.reserve(ceph_options.size() + ceph_option_strings.size());
for (vector<string>::iterator i = ceph_option_strings.begin();
i != ceph_option_strings.end();
Expand Down
1 change: 0 additions & 1 deletion src/tools/cephfs/cephfs-data-scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/tools/cephfs/cephfs-journal-tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
1 change: 0 additions & 1 deletion src/tools/cephfs/cephfs-table-tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY, 0);
Expand Down
5 changes: 2 additions & 3 deletions src/tools/crushtool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,8 @@ int main(int argc, const char **argv)

// we use -c, don't confuse the generic arg parsing
// only parse arguments from CEPH_ARGS, if in the environment
vector<const char *> env_args;
env_to_vec(env_args);
auto cct = global_init(NULL, env_args, CEPH_ENTITY_TYPE_CLIENT,
vector<const char *> empty_args;
auto cct = global_init(NULL, empty_args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY,
CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
// crushtool times out occasionally when quits. so do not
Expand Down
1 change: 0 additions & 1 deletion src/tools/osdmaptool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ int main(int argc, const char **argv)
{
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);

auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
CODE_ENVIRONMENT_UTILITY,
Expand Down
Loading

0 comments on commit 7f23142

Please sign in to comment.