]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: simplify math
authorSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 08:22:19 +0000 (01:22 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Thu, 4 Oct 2012 22:45:50 +0000 (15:45 -0700)
Bending over backwards hasn't made coverity happy.  We'll just ignore it
there.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c517fde2691f974693ce581f8e215512194e79d3)

src/librbd/internal.cc

index 9176ec9198f610ed4c316b50d16712077088809f..e664b351047d018110d9b67c71c15cba043d43e1 100644 (file)
@@ -141,9 +141,7 @@ namespace librbd {
     iss.ignore(object_prefix.length() + 1);
     uint64_t num, offset;
     iss >> std::hex >> num;
-    uint64_t block_size = 1ULL << order;
-    assert(num > (ULLONG_MAX / block_size));
-    offset = num * block_size;
+    offset = num * (1ULL << order);
     return offset;
   }