]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Rename radios_ioctx_{open,close} to create/destroy
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 1 Mar 2011 11:38:44 +0000 (03:38 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Fri, 4 Mar 2011 00:03:54 +0000 (16:03 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
12 files changed:
src/include/rados/librados.h
src/include/rados/librados.hpp
src/librados.cc
src/rados.cc
src/radosacl.cc
src/rbd.cc
src/rgw/rgw_rados.cc
src/test/osd/RadosModel.h
src/testlibrbd.c
src/testlibrbdpp.cc
src/testrados.c
src/testradospp.cc

index 297cf36ef0a536ef6abe661a1d2a47e047d73712..d7ff1a8a202791620a7ac3aa1e9156576ca62ace 100644 (file)
@@ -97,8 +97,8 @@ int rados_conf_get(rados_t cluster, const char *option, char *buf, int len);
  */
 int rados_pool_list(rados_t cluster, char *buf, int len);
 
-int rados_ioctx_open(rados_t cluster, const char *pool_name, rados_ioctx_t *ioctx);
-void rados_ioctx_close(rados_ioctx_t io);
+int rados_ioctx_create(rados_t cluster, const char *pool_name, rados_ioctx_t *ioctx);
+void rados_ioctx_destroy(rados_ioctx_t io);
 int rados_ioctx_lookup(rados_t cluster, const char *pool_name);
 
 int rados_ioctx_stat(rados_ioctx_t io, struct rados_ioctx_stat_t *stats);
index 931f67194c43183077cc743fbf3c7827a0532570..8a0a66077f7df078c0a77fcea17b196e1cce9827 100644 (file)
@@ -92,7 +92,7 @@ namespace librados
    * Typical use (error checking omitted):
    *
    * IoCtx *p;
-   * rados.ioctx_open("my_pool", &pool);
+   * rados.ioctx_create("my_pool", &pool);
    * p->stat(&stats);
    * ... etc ...
    * delete p; // close our pool handle
@@ -214,7 +214,7 @@ namespace librados
     int pool_delete(const char *name);
     int pool_lookup(const char *name);
 
-    int ioctx_open(const char *name, IoCtx &pool);
+    int ioctx_create(const char *name, IoCtx &pool);
 
     /* listing objects */
     int pool_list(std::list<std::string>& v);
index 724d5bdb10ea2f8767f37fab24fb9b624562c1d8..817cc233cc6f672b3fb0357ff9eeaf104414d016 100644 (file)
@@ -2404,10 +2404,10 @@ pool_lookup(const char *name)
 }
 
 int librados::Rados::
-ioctx_open(const char *name, IoCtx &io)
+ioctx_create(const char *name, IoCtx &io)
 {
   rados_ioctx_t p;
-  int ret = rados_ioctx_open((rados_t)client, name, &p);
+  int ret = rados_ioctx_create((rados_t)client, name, &p);
   if (ret)
     return ret;
   io.io_ctx_impl = (IoCtxImpl*)p;
@@ -2605,7 +2605,7 @@ extern "C" int rados_pool_list(rados_t cluster, char *buf, int len)
   return needed + 1;
 }
 
-extern "C" int rados_ioctx_open(rados_t cluster, const char *name, rados_ioctx_t *io)
+extern "C" int rados_ioctx_create(rados_t cluster, const char *name, rados_ioctx_t *io)
 {
   librados::RadosClient *radosp = (librados::RadosClient *)cluster;
   int poolid = radosp->lookup_pool(name);
@@ -2619,7 +2619,7 @@ extern "C" int rados_ioctx_open(rados_t cluster, const char *name, rados_ioctx_t
   return poolid;
 }
 
-extern "C" void rados_ioctx_close(rados_ioctx_t io)
+extern "C" void rados_ioctx_destroy(rados_ioctx_t io)
 {
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
   delete ctx;
index 3b7f9f62c704b862e06eea5e3f54fba7ecdd3f16..b50af0bcd942c4cdf956ea33a85284f40e78a7ac 100644 (file)
@@ -152,7 +152,7 @@ int main(int argc, const char **argv)
   // open io context.
   IoCtx io_ctx;
   if (pool_name) {
-    ret = rados.ioctx_open(pool_name, io_ctx);
+    ret = rados.ioctx_create(pool_name, io_ctx);
     if (ret < 0) {
       cerr << "error opening pool " << pool_name << ": "
           << strerror_r(-ret, buf, sizeof(buf)) << std::endl;
index be607778ddb24896006185c402a16c46c6dbff69..57d9267b2a4fae23e5eb7768a4dc468fd4d838ad 100644 (file)
@@ -144,7 +144,7 @@ int main(int argc, const char **argv)
   const char *oid = "bar";
 
   IoCtx io_ctx;
-  int r = rados.ioctx_open("data", io_ctx);
+  int r = rados.ioctx_create("data", io_ctx);
   cout << "open io_ctx result = " << r << " pool = " << io_ctx.get_pool_name() << std::endl;
 
   ACLID id;
index 839313d913102df6c5f11f8466ec7f6563de706e..1afa9c394e77abc02dc5ebfc3f950b922140ebb4 100644 (file)
@@ -698,7 +698,7 @@ int main(int argc, const char **argv)
   }
 
   // TODO: add conf
-  int r = rados.ioctx_open(poolname, io_ctx);
+  int r = rados.ioctx_create(poolname, io_ctx);
   if (r < 0) {
       cerr << "error opening pool " << poolname << " (err=" << r << ")" << std::endl;
       exit(1);
@@ -726,7 +726,7 @@ int main(int argc, const char **argv)
   }
 
   if (opt_cmd == OPT_COPY || opt_cmd == OPT_IMPORT) {
-    r = rados.ioctx_open(dest_poolname, dest_io_ctx);
+    r = rados.ioctx_create(dest_poolname, dest_io_ctx);
     if (r < 0) {
       cerr << "error opening pool " << dest_poolname << " (err=" << r << ")" << std::endl;
       exit(1);
index dfa4eae25f86904ec04b923d35270860239ac915..634113c0dd58d5aeef79cd3623e33fb51ba3b47d 100644 (file)
@@ -52,13 +52,13 @@ int RGWRados::initialize(int argc, char *argv[])
  */
 int RGWRados::open_root_pool_ctx()
 {
-  int r = rados->ioctx_open(root_bucket.c_str(), root_pool_ctx);
+  int r = rados->ioctx_create(root_bucket.c_str(), root_pool_ctx);
   if (r == -ENOENT) {
     r = rados->pool_create(root_bucket.c_str());
     if (r < 0)
       return r;
 
-    r = rados->ioctx_open(root_bucket.c_str(), root_pool_ctx);
+    r = rados->ioctx_create(root_bucket.c_str(), root_pool_ctx);
   }
 
   return r;
@@ -136,7 +136,7 @@ int RGWRados::list_objects(string& id, string& bucket, int max, string& prefix,
                           string& marker, vector<RGWObjEnt>& result, map<string, bool>& common_prefixes)
 {
   librados::IoCtx io_ctx;
-  int r = rados->ioctx_open(bucket.c_str(), io_ctx);
+  int r = rados->ioctx_create(bucket.c_str(), io_ctx);
   if (r < 0)
     return r;
 
@@ -239,7 +239,7 @@ int RGWRados::put_obj_meta(std::string& id, std::string& bucket, std::string& oi
 {
   librados::IoCtx io_ctx;
 
-  int r = rados->ioctx_open(bucket.c_str(), io_ctx);
+  int r = rados->ioctx_create(bucket.c_str(), io_ctx);
   if (r < 0)
     return r;
 
@@ -280,7 +280,7 @@ int RGWRados::put_obj_data(std::string& id, std::string& bucket, std::string& oi
 {
   librados::IoCtx io_ctx;
 
-  int r = rados->ioctx_open(bucket.c_str(), io_ctx);
+  int r = rados->ioctx_create(bucket.c_str(), io_ctx);
   if (r < 0)
     return r;
 
@@ -388,7 +388,7 @@ int RGWRados::delete_bucket(std::string& id, std::string& bucket)
 int RGWRados::delete_obj(std::string& id, std::string& bucket, std::string& oid)
 {
   librados::IoCtx io_ctx;
-  int r = rados->ioctx_open(bucket.c_str(), io_ctx);
+  int r = rados->ioctx_create(bucket.c_str(), io_ctx);
   if (r < 0)
     return r;
 
@@ -419,7 +419,7 @@ int RGWRados::get_attr(std::string& bucket, std::string& obj,
     actual_bucket = root_bucket;
   }
 
-  int r = rados->ioctx_open(actual_bucket.c_str(), io_ctx);
+  int r = rados->ioctx_create(actual_bucket.c_str(), io_ctx);
   if (r < 0)
     return r;
 
@@ -450,7 +450,7 @@ int RGWRados::set_attr(std::string& bucket, std::string& oid,
     actual_bucket = root_bucket;
   }
 
-  int r = rados->ioctx_open(actual_bucket.c_str(), io_ctx);
+  int r = rados->ioctx_create(actual_bucket.c_str(), io_ctx);
   if (r < 0)
     return r;
 
@@ -512,7 +512,7 @@ int RGWRados::prepare_get_obj(std::string& bucket, std::string& oid,
 
   *handle = state;
 
-  r = rados->ioctx_open(bucket.c_str(), state->io_ctx);
+  r = rados->ioctx_create(bucket.c_str(), state->io_ctx);
   if (r < 0)
     goto done_err;
 
index 5381ef83186e874671a6dc85a4666cb709ad5579..bfe8490b43fad7a6c366d64a836789cc0df25628 100644 (file)
@@ -81,7 +81,7 @@ struct RadosTestContext
   {
     rados.init(NULL);
     rados.connect();
-    rados.ioctx_open(pool_name.c_str(), io_ctx);
+    rados.ioctx_create(pool_name.c_str(), io_ctx);
     char hostname_cstr[100];
     gethostname(hostname_cstr, 100);
     stringstream hostpid;
index 6d079e67bdd6d76aa935f1819d21bac0f8a9249d..a267d38b2ee0236f5212116bb4ddcb67c52d04f4 100644 (file)
@@ -271,7 +271,7 @@ int main(int argc, const char **argv)
   }
   int r = rados_pool_create(cluster, TEST_POOL);
   printf("rados_pool_create returned %d\n", r);
-  assert(rados_ioctx_open(cluster, TEST_POOL, &io_ctx) == 0);
+  assert(rados_ioctx_create(cluster, TEST_POOL, &io_ctx) == 0);
   struct rados_ioctx_stat_t stats;
   rados_ioctx_stat(io_ctx, &stats);
   test_ls(io_ctx, 0);
@@ -297,7 +297,7 @@ int main(int argc, const char **argv)
   test_ls(io_ctx, 1, TEST_IMAGE "1");
   test_delete(io_ctx, TEST_IMAGE "1");
   test_ls(io_ctx, 0);
-  rados_ioctx_close(io_ctx);
+  rados_ioctx_destroy(io_ctx);
   rados_shutdown(cluster);
   return 0;
 }
index b06bdaa3cc236e9a35edf3f7ad1bb4f1426e9745..21b8111bd6c6930cb1a5de2b24e58c13e0dd521a 100644 (file)
@@ -254,7 +254,7 @@ int main(int argc, const char **argv)
   }
   int r = rados.pool_create(TEST_POOL);
   printf("rados.pool_create returned %d\n", r);
-  assert(rados.ioctx_open(TEST_POOL, io_ctx) == 0);
+  assert(rados.ioctx_create(TEST_POOL, io_ctx) == 0);
   test_ls(io_ctx, 0);
   test_create_and_stat(io_ctx, TEST_IMAGE, MB_BYTES(1));
   assert(rbd->open(io_ctx, image.get(), TEST_IMAGE, NULL) == 0);
index 7de3939cd691348f64b5d736ee26ac32bf630dfe..92054cd6616a7422dbd1a0310d46bb33f737355b 100644 (file)
@@ -72,8 +72,8 @@ int main(int argc, const char **argv)
   printf("rados_ioctx_create = %d\n", r);
 
   rados_ioctx_t io_ctx;
-  r = rados_ioctx_open(cl, "foo", &io_ctx);
-  printf("rados_ioctx_open = %d, io_ctx = %p\n", r, io_ctx);
+  r = rados_ioctx_create(cl, "foo", &io_ctx);
+  printf("rados_ioctx_create = %d, io_ctx = %p\n", r, io_ctx);
 
   /* list all pools */
   {
@@ -185,7 +185,7 @@ int main(int argc, const char **argv)
 
   /* delete a pool */
   printf("rados_delete_pool = %d\n", r);  
-  rados_ioctx_close(io_ctx);
+  rados_ioctx_destroy(io_ctx);
 
   r = rados_pool_delete(cl, "foo");
   printf("rados_ioctx_pool_delete = %d\n", r);
index 862a47abc9bf8fef22ff3048f837c0adaf2e14d4..b157e5639131df663287590d7becc63ff4e54a59 100644 (file)
@@ -97,8 +97,8 @@ int main(int argc, const char **argv)
   const char *oid = "bar";
 
   IoCtx io_ctx;
-  int r = rados.ioctx_open("data", io_ctx);
-  cout << "ioctx_open result = " << r << std::endl;
+  int r = rados.ioctx_create("data", io_ctx);
+  cout << "ioctx_create result = " << r << std::endl;
 
   r = io_ctx.write(oid, bl, bl.length(), 0);
   uint64_t objver = io_ctx.get_last_version();