]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: rename howmany to avoid conflict
authorNoah Watkins <noahwatkins@gmail.com>
Sat, 7 Dec 2013 17:59:13 +0000 (09:59 -0800)
committerNoah Watkins <noahwatkins@gmail.com>
Sun, 8 Dec 2013 02:07:03 +0000 (18:07 -0800)
A howmany macro exists on some platforms in standard headers, but there
really isn't any sort of standard that I've found. We just avoid the
conflict entirely this way.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/librbd/internal.cc

index 4185f36b18157fa073cc78f931e9913fc2eb1cd7..f7899053a375404c22461dc4066660ccd9d7e9be 100644 (file)
@@ -28,7 +28,7 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "librbd: "
 
-#define howmany(x, y)  (((x) + (y) - 1) / (y))
+#define rbd_howmany(x, y)  (((x) + (y) - 1) / (y))
 
 using std::map;
 using std::pair;
@@ -119,7 +119,7 @@ namespace librbd {
     ictx->snap_lock.put_read();
     ictx->md_lock.put_read();
     info.obj_size = 1ULL << obj_order;
-    info.num_objs = howmany(info.size, ictx->get_object_size());
+    info.num_objs = rbd_howmany(info.size, ictx->get_object_size());
     info.order = obj_order;
     memcpy(&info.block_name_prefix, ictx->object_prefix.c_str(),
           min((size_t)RBD_MAX_BLOCK_NAME_SIZE,