summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-10-11 15:44:00 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-10-11 15:44:00 -0700
commitfb96740651f99a83ccf229ed3256f6611a4811c6 (patch)
tree67d324ccc638f8fb724e3f2f173df2ef2e3497df
parent6ff9570726b8ba6a6d1434a40ae86ca9649b05e6 (diff)
parenta1825356ad7e0747bbef2faa3a085fab2d52db97 (diff)
downloadceph-fb96740651f99a83ccf229ed3256f6611a4811c6.tar.gz
Merge branch 'wip-6444' into next
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--src/include/rados/librados.hpp7
-rw-r--r--src/librados/PoolAsyncCompletionImpl.h5
2 files changed, 10 insertions, 2 deletions
diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp
index 3f6d025ff41..c8de9f9df33 100644
--- a/src/include/rados/librados.hpp
+++ b/src/include/rados/librados.hpp
@@ -789,7 +789,12 @@ namespace librados
int cluster_stat(cluster_stat_t& result);
int cluster_fsid(std::string *fsid);
- /* pool aio */
+ /*
+ * pool aio
+ *
+ * It is up to the caller to release the completion handler, even if the pool_create_async()
+ * and/or pool_delete_async() fails and does not send the async request
+ */
static PoolAsyncCompletion *pool_async_create_completion();
// -- aio --
diff --git a/src/librados/PoolAsyncCompletionImpl.h b/src/librados/PoolAsyncCompletionImpl.h
index efb89641466..443b2c23a17 100644
--- a/src/librados/PoolAsyncCompletionImpl.h
+++ b/src/librados/PoolAsyncCompletionImpl.h
@@ -94,6 +94,9 @@ namespace librados {
C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) {
c->get();
}
+ ~C_PoolAsync_Safe() {
+ c->put();
+ }
void finish(int r) {
c->lock.Lock();
@@ -109,7 +112,7 @@ namespace librados {
c->lock.Lock();
}
- c->put_unlock();
+ c->lock.Unlock();
}
};
}