From: Ilya Dryomov Date: Wed, 26 Aug 2020 12:35:49 +0000 (+0200) Subject: rbd: rename some MapOptions instances to unmap_options X-Git-Tag: v16.1.0~1294^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da4ffd834fb8326ca3c3e096de4024198c8f42f2;p=ceph.git rbd: rename some MapOptions instances to unmap_options It is no longer a global variable, so rename the ones that have to do with options for unmapping (currently just "force"). Signed-off-by: Ilya Dryomov --- diff --git a/src/tools/rbd/action/Kernel.cc b/src/tools/rbd/action/Kernel.cc index 9d33aa543acd..cccd7932f496 100644 --- a/src/tools/rbd/action/Kernel.cc +++ b/src/tools/rbd/action/Kernel.cc @@ -206,7 +206,7 @@ static int parse_map_options(const std::string &options_string, } static int parse_unmap_options(const std::string &options_string, - MapOptions* map_options) + MapOptions* unmap_options) { char *options = strdup(options_string.c_str()); BOOST_SCOPE_EXIT(options) { @@ -222,7 +222,7 @@ static int parse_unmap_options(const std::string &options_string, *value_char++ = '\0'; if (!strcmp(this_char, "force")) { - put_map_option("force", this_char, map_options); + put_map_option("force", this_char, unmap_options); } else { std::cerr << "rbd: unknown unmap option '" << this_char << "'" << std::endl; @@ -416,7 +416,7 @@ out: static int do_kernel_unmap(const char *dev, const char *poolname, const char *nspace_name, const char *imgname, - const char *snapname, MapOptions&& map_options) + const char *snapname, MapOptions&& unmap_options) { #if defined(WITH_KRBD) struct krbd_ctx *krbd; @@ -427,8 +427,8 @@ static int do_kernel_unmap(const char *dev, const char *poolname, if (r < 0) return r; - for (auto it = map_options.cbegin(); it != map_options.cend(); ++it) { - if (it != map_options.cbegin()) + for (auto it = unmap_options.cbegin(); it != unmap_options.cend(); ++it) { + if (it != unmap_options.cbegin()) oss << ","; oss << it->second; } @@ -568,10 +568,10 @@ int execute_unmap(const po::variables_map &vm, return -EINVAL; } - MapOptions map_options; + MapOptions unmap_options; if (vm.count("options")) { for (auto &options : vm["options"].as>()) { - r = parse_unmap_options(options, &map_options); + r = parse_unmap_options(options, &unmap_options); if (r < 0) { std::cerr << "rbd: couldn't parse unmap options" << std::endl; return r; @@ -593,7 +593,7 @@ int execute_unmap(const po::variables_map &vm, r = do_kernel_unmap(device_name.empty() ? nullptr : device_name.c_str(), pool_name.c_str(), nspace_name.c_str(), image_name.c_str(), snap_name.c_str(), - std::move(map_options)); + std::move(unmap_options)); if (r < 0) { std::cerr << "rbd: unmap failed: " << cpp_strerror(r) << std::endl; return r;