]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: rename some MapOptions instances to unmap_options 36854/head
authorIlya Dryomov <idryomov@gmail.com>
Wed, 26 Aug 2020 12:35:49 +0000 (14:35 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 27 Aug 2020 13:53:38 +0000 (15:53 +0200)
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 <idryomov@gmail.com>
src/tools/rbd/action/Kernel.cc

index 9d33aa543acd06db58561c0ec8b99ff5050b7910..cccd7932f4966d393394f7aaed6d3053e974bbe1 100644 (file)
@@ -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<std::vector<std::string>>()) {
-      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;