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>
#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,
class Formatter;
}
-int krbd_showmapped(struct krbd_ctx *ctx, Formatter *f);
+int krbd_showmapped(struct krbd_ctx *ctx, ceph::Formatter *f);
#endif /* __cplusplus */
#include "common/TextTable.h"
#include "include/assert.h"
#include "include/stringify.h"
+#include "include/krbd.h"
#include "mon/MonMap.h"
#include <blkid/blkid.h>
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;