From 6ef83820564b07dbff91b3fc6909082537c0f815 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 18 Mar 2020 10:34:23 -0400 Subject: [PATCH] rgw: clean up attempt loop in ordered listing Convert a while loop into a for loop to better indicate how the "attempt" lcv is managed. Signed-off-by: J. Eric Ivancich --- src/rgw/rgw_rados.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 4f3e2f0c2e1..4e02715f5b2 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1781,14 +1781,9 @@ int RGWRados::Bucket::List::list_objects_ordered( } rgw_obj_index_key prev_marker; - 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 @@ -1983,11 +1978,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: -- 2.47.3