From: Jason Dillaman Date: Tue, 28 Apr 2015 14:56:15 +0000 (-0400) Subject: krbd: fix incorrect types in the krbd API X-Git-Tag: v0.94.3~28^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18ede754388372cf210d7db87fa46f3536cf0e44;p=ceph.git krbd: fix incorrect types in the krbd API 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 (cherry picked from commit 740fd275a60630e60b3bcf41637a2ca486885d9c) --- diff --git a/src/include/krbd.h b/src/include/krbd.h index 702a76dbc6ac..d7e868c438d2 100644 --- a/src/include/krbd.h +++ b/src/include/krbd.h @@ -13,14 +13,15 @@ #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 */ diff --git a/src/krbd.cc b/src/krbd.cc index 04f400475429..3fb64fd67e63 100644 --- a/src/krbd.cc +++ b/src/krbd.cc @@ -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 @@ -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(cct); ctx->udev = udev_new(); if (!ctx->udev) { delete ctx;