]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix test compilation on 32-bit
authorJosh Durgin <josh.durgin@inktank.com>
Thu, 9 Aug 2012 22:13:46 +0000 (15:13 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Thu, 9 Aug 2012 23:41:30 +0000 (16:41 -0700)
32-bit can't implicitly convert size_t or unsigned to uint64_t

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/test/rbd/fsx.c
src/test/rbd/test_cls_rbd.cc
src/test/test_librbd.cc

index 8838fd3c30050ff8d83da41f6449ba3334a64316..20cb13e4b8f3d7dbc496f5cf871fe5ee119046e2 100644 (file)
@@ -759,7 +759,8 @@ do_punch_hole(unsigned offset, unsigned length)
                prt("%lu punch\tfrom 0x%x to 0x%x, (0x%x bytes)\n", testcalls,
                        offset, offset+length, length);
        }
-       if ((ret = rbd_discard(image, offset, length)) < 0) {
+       if ((ret = rbd_discard(image, (unsigned long long) offset,
+                              (unsigned long long) length)) < 0) {
                prt("%punch hole: %x to %x\n", offset, length);
                prterrcode("do_punch_hole: discard", ret);
                report_failure(161);
index 34219a281edf8a84d358084b1772e03c9b594141..39011f9454814c8d911279b34ef59bfc99e1b2bb 100644 (file)
@@ -70,7 +70,7 @@ TEST(cls_rbd, copyup)
   // copyup of 0-len nonexistent object should create new 0-len object
   ioctx.remove(oid);
   ASSERT_EQ(0, copyup(&ioctx, oid, inbl));
-  size_t size;
+  uint64_t size;
   ASSERT_EQ(0, ioctx.stat(oid, &size, NULL));
   ASSERT_EQ(0U, size);
 
index 07fafd9d35def47a85a45bdf12e5396dad10b601..51f6a2ceb9a41a92bfa30b5e4c3ad9eb88ee05f9 100644 (file)
@@ -616,7 +616,7 @@ void write_test_data(rbd_image_t image, const char *test_data, uint64_t off, siz
   assert(written == (ssize_t)len);
 }
 
-void aio_discard_test_data(rbd_image_t image, uint64_t off, size_t len)
+void aio_discard_test_data(rbd_image_t image, uint64_t off, uint64_t len)
 {
   rbd_completion_t comp;
   rbd_aio_create_completion(NULL, (rbd_callback_t) simple_write_cb, &comp);