]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/test: cleanups in SetChunkOp
authormyoungwon oh <ohmyoungwon@gmail.com>
Tue, 2 Feb 2021 02:08:40 +0000 (11:08 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Mon, 29 Mar 2021 08:06:04 +0000 (17:06 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/test/osd/RadosModel.h

index b0a907d0c9dc98edaea76cef7fc8c12559794ad1..62b62f28b325df16b594247e0e4df241f98c37cb 100644 (file)
@@ -2346,9 +2346,10 @@ public:
          cout << num << ":  got expected ENOENT (src dne)" << std::endl;
        } else if (r == -EOPNOTSUPP) {
          bool is_overlapped = false;
+         interval_set<uint64_t> chunk;
+         chunk.insert(offset, length);
          for (auto &p : src_value.chunk_info) {
-           if ((p.first <= offset && p.first + p.second.length > offset) ||
-                (p.first > offset && p.first <= offset + length)) {
+           if (chunk.intersects(p.first, p.second.length)) {
              cout << " range is overlapped  offset: " << offset << " length: " << length
                    << " chunk_info offset: " << p.second.offset << " length " 
                    << p.second.length << std::endl;
@@ -2367,10 +2368,7 @@ public:
          ceph_abort();
        }
       } else {
-       ChunkDesc info;
-       info.offset = tgt_offset;
-       info.length = length;
-       info.oid = oid_tgt;
+       ChunkDesc info {tgt_offset, length, oid_tgt};
        context->update_object_chunk_target(oid, offset, info);
        context->update_object_version(oid, comp->get_version64());
       }