Skip to content

Commit

Permalink
rbd: drop unused default_empty_pool_name argument
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
idryomov committed Jul 14, 2022
1 parent 90bde16 commit c5a5b0f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 26 deletions.
3 changes: 1 addition & 2 deletions src/tools/rbd/Utils.cc
Expand Up @@ -197,8 +197,7 @@ std::string get_default_pool_name() {
}

int get_pool_and_namespace_names(
const boost::program_options::variables_map &vm,
bool default_empty_pool_name, bool validate_pool_name,
const boost::program_options::variables_map &vm, bool validate_pool_name,
std::string* pool_name, std::string* namespace_name, size_t *arg_index) {
if (namespace_name != nullptr && vm.count(at::NAMESPACE_NAME)) {
*namespace_name = vm[at::NAMESPACE_NAME].as<std::string>();
Expand Down
3 changes: 1 addition & 2 deletions src/tools/rbd/Utils.h
Expand Up @@ -105,8 +105,7 @@ void normalize_pool_name(std::string* pool_name);
std::string get_default_pool_name();

int get_pool_and_namespace_names(
const boost::program_options::variables_map &vm,
bool default_empty_pool_name, bool validate_pool_name,
const boost::program_options::variables_map &vm, bool validate_pool_name,
std::string* pool_name, std::string* namespace_name, size_t *arg_index);

int get_pool_image_snapshot_names(
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rbd/action/Group.cc
Expand Up @@ -123,7 +123,7 @@ int execute_list(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rbd/action/List.cc
Expand Up @@ -314,7 +314,7 @@ int execute(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down
22 changes: 11 additions & 11 deletions src/tools/rbd/action/MirrorPool.cc
Expand Up @@ -826,7 +826,7 @@ int execute_peer_bootstrap_create(
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -885,7 +885,7 @@ int execute_peer_bootstrap_import(
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -978,7 +978,7 @@ int execute_peer_add(const po::variables_map &vm,
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1069,7 +1069,7 @@ int execute_peer_remove(const po::variables_map &vm,
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1117,7 +1117,7 @@ int execute_peer_set(const po::variables_map &vm,
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1288,7 +1288,7 @@ int execute_disable(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand All @@ -1311,7 +1311,7 @@ int execute_enable(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1367,7 +1367,7 @@ int execute_info(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1463,7 +1463,7 @@ int execute_status(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1653,7 +1653,7 @@ int execute_promote(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -1692,7 +1692,7 @@ int execute_demote(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rbd/action/Namespace.cc
Expand Up @@ -30,7 +30,7 @@ int execute_create(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -69,7 +69,7 @@ int execute_remove(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -115,7 +115,7 @@ int execute_list(const po::variables_map &vm,
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, true, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, true, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd/action/Perf.cc
Expand Up @@ -584,7 +584,7 @@ int execute_iostat(const po::variables_map &vm,
std::string pool;
std::string pool_namespace;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, false, false, &pool,
int r = utils::get_pool_and_namespace_names(vm, false, &pool,
&pool_namespace, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -671,7 +671,7 @@ int execute_iotop(const po::variables_map &vm,
std::string pool;
std::string pool_namespace;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, false, false, &pool,
int r = utils::get_pool_and_namespace_names(vm, false, &pool,
&pool_namespace, &arg_index);
if (r < 0) {
return r;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd/action/Pool.cc
Expand Up @@ -29,7 +29,7 @@ int execute_init(const po::variables_map &vm,
const std::vector<std::string> &ceph_global_init_args) {
std::string pool_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
nullptr, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -68,7 +68,7 @@ int execute_stats(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd/action/Trash.cc
Expand Up @@ -357,7 +357,7 @@ int execute_list(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down Expand Up @@ -408,7 +408,7 @@ int execute_purge(const po::variables_map &vm,
std::string pool_name;
std::string namespace_name;
size_t arg_index = 0;
int r = utils::get_pool_and_namespace_names(vm, true, false, &pool_name,
int r = utils::get_pool_and_namespace_names(vm, false, &pool_name,
&namespace_name, &arg_index);
if (r < 0) {
return r;
Expand Down

0 comments on commit c5a5b0f

Please sign in to comment.