]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
CephContext: drop obsolete ceph_destroy_context
authorSage Weil <sage@inktank.com>
Tue, 10 Jul 2012 04:32:15 +0000 (21:32 -0700)
committerSage Weil <sage@inktank.com>
Tue, 10 Jul 2012 04:32:15 +0000 (21:32 -0700)
Drop this useless helper and call cct->put() directly.  The comment that
this can't be used after global_init is no longer relevant as long as
nobody puts a reference they don't own... and nobody owns
g_ceph_context.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/common_init.cc
src/common/common_init.h
src/libcephfs.cc
src/librados/RadosClient.cc
src/rgw/librgw.cc

index 558d039b1dbc3dc614cc93b85185daef70bb5eab..76b50e714a560391ca9ae50f04015eb2abd35949 100644 (file)
@@ -119,7 +119,3 @@ void common_init_finish(CephContext *cct)
   }
 }
 
-void common_destroy_context(CephContext *cct)
-{
-  //delete cct;        // TODO: fix #845
-}
index 88ef485859a970657d16cd4aceade676c3f2a2ab..3dfd12915f4cbea858594be3fb5b554213370ed3 100644 (file)
@@ -74,10 +74,4 @@ void complain_about_parse_errors(CephContext *cct,
  */
 void common_init_finish(CephContext *cct);
 
-/* This function is called from library code to destroy a context created by
- * the library.
- * You should not call this function if you called global_init.
- */
-void common_destroy_context(CephContext *cct);
-
 #endif
index b83677551a15f2271b0c6ef3bb4675e2acdc2f46..a240cc3a2fbf5b3bb0ad9d0dc59c738e566e7f4a 100644 (file)
@@ -48,7 +48,7 @@ public:
     try {
       shutdown();
       if (cct) {
-       common_destroy_context(cct);
+       cct->put();
        cct = NULL;
       }
     }
index 5de2f4a59c30407d9b5fa81101fec5e1d86672f0..ecf923f751155f8b5764e0168ff51c30fe691350 100644 (file)
@@ -235,7 +235,6 @@ librados::RadosClient::~RadosClient()
     delete messenger;
   if (objecter)
     delete objecter;
-  common_destroy_context(cct);
   cct->put();
   cct = NULL;
 }
index b5db66a35583aa4e00e44609d8bed94670262de0..556f57f3ba0474927bedc9d42c4ac0362a638f92 100644 (file)
@@ -130,5 +130,5 @@ void librgw_free_bin(librgw_t rgw, char *bin)
 
 void librgw_shutdown(librgw_t rgw)
 {
-  common_destroy_context(rgw);
+  rgw->put();
 }