]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: expose pool id
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 13 Jun 2011 18:29:30 +0000 (11:29 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 13 Jun 2011 22:30:37 +0000 (15:30 -0700)
Conflicts:

src/librados.cc

src/include/rados/librados.h
src/include/rados/librados.hpp
src/librados.cc

index b681cfcbe0c16e2bf7e7f83b699d154b2cab05b7..16cd3103f41d6324db037456b58e1eee6c90d7a0 100644 (file)
@@ -17,7 +17,7 @@ extern "C" {
 #endif
 
 #define LIBRADOS_VER_MAJOR 0
-#define LIBRADOS_VER_MINOR 27
+#define LIBRADOS_VER_MINOR 30
 #define LIBRADOS_VER_EXTRA 0
 
 #define LIBRADOS_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra)
@@ -114,6 +114,7 @@ int rados_pool_delete(rados_t cluster, const char *pool_name);
 int rados_ioctx_pool_set_auid(rados_ioctx_t io, uint64_t auid);
 
 void rados_ioctx_locator_set_key(rados_ioctx_t io, const char *key);
+int rados_ioctx_get_id(rados_ioctx_t io);
 
 /* objects */
 int rados_objects_list_open(rados_ioctx_t io, rados_list_ctx_t *ctx);
index 8609777a0a3fadf2e6ba0d2dae6c7d228359b97e..7f956fb6dfd2fee1158785547f16f4494db8ee10 100644 (file)
@@ -234,6 +234,8 @@ namespace librados
     const std::string& get_pool_name() const;
 
     void locator_set_key(const std::string& key);
+
+    int get_id();
   private:
     /* You can only get IoCtx instances from Rados */
     IoCtx(IoCtxImpl *io_ctx_impl_);
index df4cd475af1199cc6cb7e2b7fff20d9a72c260a4..a7f513263abe3368e86704d112dca5b68774caa7 100644 (file)
@@ -144,6 +144,10 @@ struct librados::IoCtxImpl {
   void queue_aio_write(struct AioCompletionImpl *c);
   void complete_aio_write(struct AioCompletionImpl *c);
   void flush_aio_writes();
+
+  int get_id() {
+    return poolid;
+  }
 };
 
 
@@ -2671,6 +2675,12 @@ locator_set_key(const string& key)
   io_ctx_impl->oloc.key = key;
 }
 
+int librados::IoCtx::
+get_id()
+{
+  return io_ctx_impl->get_id();
+}
+
 librados::IoCtx::
 IoCtx(IoCtxImpl *io_ctx_impl_)
   : io_ctx_impl(io_ctx_impl_)
@@ -3211,6 +3221,12 @@ extern "C" void rados_ioctx_locator_set_key(rados_ioctx_t io, const char *key)
   else
     ctx->oloc.key = "";
 }
+
+extern "C" int rados_ioctx_get_id(rados_ioctx_t io)
+{
+  librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
+  return ctx->get_id();
+}
 // snaps
 
 extern "C" int rados_ioctx_snap_create(rados_ioctx_t io, const char *snapname)