]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: clean up attempt loop in ordered listing 35882/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 18 Mar 2020 14:34:23 +0000 (10:34 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Thu, 2 Jul 2020 00:26:05 +0000 (20:26 -0400)
Convert a while loop into a for loop to better indicate how the
"attempt" lcv is managed.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 6ef83820564b07dbff91b3fc6909082537c0f815)

src/rgw/rgw_rados.cc

index 0cc0bc55254712f29a32b5cc48413256d7bed617..a6d3ad67e84a86fe087bd5e19e98bc6a2ad8792d 100644 (file)
@@ -2453,14 +2453,9 @@ int RGWRados::Bucket::List::list_objects_ordered(
 
   rgw_obj_index_key prev_marker;
   string skip_after_delim;
-  uint16_t attempt = 0;
-  while (true) {
+  for (uint16_t attempt = 1; /* empty */; ++attempt) {
     ldout(cct, 20) << "RGWRados::Bucket::List::" << __func__ <<
-      " beginning attempt=" << ++attempt << dendl;
-
-    // this loop is generally expected only to have a single
-    // iteration; the standard exit is at the bottom of the loop, but
-    // there's an error condition emergency exit as well
+      " starting attempt " << attempt << dendl;
 
     if (attempt > 1 && !(prev_marker < cur_marker)) {
       // we've failed to make forward progress
@@ -2607,11 +2602,7 @@ int RGWRados::Bucket::List::list_objects_ordered(
       // few, results, return with what we have
       break;
     }
-
-    ldout(cct, 1) << "RGWRados::Bucket::List::" << __func__ <<
-      " INFO ordered bucket listing requires read #" << (1 + attempt) <<
-      dendl;
-  } // read attempt loop
+  } // for (uint16_t attempt...
 
 done:
   if (is_truncated)