*
* Copies all configuration, as retrieved by the C++ API.
*
- * @note BUG: Since CephContext isn't accessible from the C API, this function is useless
- *
* @param cluster where to store the handle
* @param cct_ the existing configuration to use
* @returns 0 on success, negative error code on failure
*/
int rados_pool_list(rados_t cluster, char *buf, size_t len);
+/**
+ * Get CephContext for a rados cluster handle
+ *
+ * @param cluster cluster handle
+ * @returns CephContext for this cluster
+ */
+struct CephContext *rados_cct(rados_t cluster);
+
/**
* Create an io context
*
*/
void rados_ioctx_destroy(rados_ioctx_t io);
+/**
+ * Get CephContext for a pool handle
+ *
+ * @param io pool handle
+ * @returns CephContext for this cluster
+ */
+struct CephContext *rados_ioctx_cct(rados_ioctx_t io);
+
/**
* Get pool usage statistics
*
return client->connect();
}
+CephContext *librados::Rados::cct()
+{
+ return client->cct;
+}
+
void librados::Rados::shutdown()
{
if (!client)
return 0;
}
+extern "C" CephContext *rados_cct(rados_t cluster)
+{
+ librados::RadosClient *client = (librados::RadosClient *)cluster;
+ return client->cct;
+}
+
extern "C" int rados_connect(rados_t cluster)
{
librados::RadosClient *client = (librados::RadosClient *)cluster;
return 0;
}
+extern "C" struct CephContext *rados_ioctx_cct(rados_ioctx_t io)
+{
+ librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
+ return ctx->client->cct;
+}
extern "C" void rados_ioctx_snap_set_read(rados_ioctx_t io, rados_snap_t seq)
{