]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types: clarify comments in calc_refs_to_drop_on_removal 29283/head
authorSamuel Just <sjust@redhat.com>
Thu, 9 Jul 2020 01:38:15 +0000 (18:38 -0700)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 9 Jul 2020 09:38:42 +0000 (18:38 +0900)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/osd_types.cc

index 55e6e154c93b25a3c0ea78948dbde83745469674..bfc84d94e7edd70a61737a28e506b44a02d9d970 100644 (file)
@@ -5883,15 +5883,20 @@ void object_manifest_t::calc_refs_to_drop_on_removal(
       std::numeric_limits<uint64_t>::max() : i->first;
   };
 
-  // Translate current, iter, map to a chunk_info_t, nullopt_t if iter
-  // is ahead of current or is at end()
+  /* If current matches the offset at iter, returns the chunk at *iter
+   * and increments iter.  Otherwise, returns nullptr.
+   *
+   * current will always be derived from the min of *giter, *iter, and
+   * *liter on each cycle, so the result will be that each loop iteration
+   * will pick up all chunks at the offest being considered, each offset
+   * will be considered once, and all offsets will be considered.
+   */
   auto get_chunk = [](
     uint64_t current, decltype(iter) &i, const object_manifest_t &manifest)
     -> const chunk_info_t * {
     if (i == manifest.chunk_map.end() || current != i->first) {
       return nullptr;
     } else {
-      // We advance the iterator iff we consider the chunk_map on this iteration
       return &(i++)->second;
     }
   };