]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
krbd: fix incorrect types in the krbd API
authorJason Dillaman <dillaman@redhat.com>
Tue, 28 Apr 2015 14:56:15 +0000 (10:56 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 17 Jul 2015 18:17:04 +0000 (14:17 -0400)
The C API functions were referencing the C++ CephContext
instead of the C rados_config_t.  Additionally, the ceph
namespace was missing on the Formatter class.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 740fd275a60630e60b3bcf41637a2ca486885d9c)

src/include/krbd.h
src/krbd.cc

index 702a76dbc6acf2b6f07c52894e45c5f3727bc22b..d7e868c438d2d9486449695d4b1708f1ef8aecc7 100644 (file)
 #ifndef CEPH_KRBD_H
 #define CEPH_KRBD_H
 
+#include "rados/librados.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct krbd_ctx;
-struct CephContext;
 
-int krbd_create_from_context(struct CephContext *cct, struct krbd_ctx **pctx);
+int krbd_create_from_context(rados_config_t cct, struct krbd_ctx **pctx);
 void krbd_destroy(struct krbd_ctx *ctx);
 
 int krbd_map(struct krbd_ctx *ctx, const char *pool, const char *image,
@@ -38,7 +39,7 @@ namespace ceph {
   class Formatter;
 }
 
-int krbd_showmapped(struct krbd_ctx *ctx, Formatter *f);
+int krbd_showmapped(struct krbd_ctx *ctx, ceph::Formatter *f);
 
 #endif /* __cplusplus */
 
index 04f40047542984f9c546a5ab5d01e24b61cb2a9f..3fb64fd67e631c629402a32993b550293b0d96d5 100644 (file)
@@ -34,6 +34,7 @@
 #include "common/TextTable.h"
 #include "include/assert.h"
 #include "include/stringify.h"
+#include "include/krbd.h"
 #include "mon/MonMap.h"
 
 #include <blkid/blkid.h>
@@ -582,12 +583,12 @@ int dump_images(struct krbd_ctx *ctx, Formatter *f)
   return r;
 }
 
-extern "C" int krbd_create_from_context(struct CephContext *cct,
+extern "C" int krbd_create_from_context(rados_config_t cct,
                                         struct krbd_ctx **pctx)
 {
   struct krbd_ctx *ctx = new struct krbd_ctx();
 
-  ctx->cct = cct;
+  ctx->cct = reinterpret_cast<CephContext *>(cct);
   ctx->udev = udev_new();
   if (!ctx->udev) {
     delete ctx;