]> git.apps.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)
committerjdillaman <jdillaman@ubuntu.(none)>
Thu, 30 Apr 2015 14:56:54 +0000 (10:56 -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>
src/include/krbd.h
src/krbd.cc

index 656512f99c38e05bf5323d2fa7aa663b6a3b73e0..75206cded658dd46ba2500e65c4ccb0ac69cb3e9 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,
@@ -40,7 +41,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 33990bceaf628a054cde4c7cf609bdd20e2e0a10..9901edbfb154ff2c2b8b34285b03029bb79de21b 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>
@@ -692,12 +693,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;