* - snapshot context for writes (see
* rados_ioctx_selfmanaged_snap_set_write_ctx())
* - snapshot id to read from (see rados_ioctx_snap_set_read())
- * - object locator for all single-object operations (see
+ * - object locator for all single-object operation28e61811dc3dccd922bd0b30cf614c2768e7d6d0s (see
* rados_ioctx_locator_set_key())
*
* @warning changing any of these settings is not thread-safe -
*/
int64_t rados_ioctx_get_id(rados_ioctx_t io);
+/**
+ * Get the pool name of the io context
+ *
+ * @param io the io context to query
+ * @param buf pointer to buffer where name will be stored
+ * @param maxlen size of buffer where name will be stored
+ * @returns length of string stored, or -ERANGE if buffer to small
+ */
+int rados_ioctx_get_pool_name(rados_ioctx_t io, char *buf, unsigned maxlen);
+
/** @} pools */
/**
librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
return ctx->get_id();
}
+
+extern "C" int rados_ioctx_get_pool_name(rados_ioctx_t io, char *s, unsigned maxlen)
+{
+ librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
+ if (ctx->pool_name.length() >= maxlen)
+ return -ERANGE;
+ strcpy(s, ctx->pool_name.c_str());
+ return ctx->pool_name.length();
+}
+
// snaps
extern "C" int rados_ioctx_snap_create(rados_ioctx_t io, const char *snapname)