summaryrefslogtreecommitdiffstats
path: root/src/librados
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2018-11-08 23:00:51 +0100
committerGitHub <noreply@github.com>2018-11-08 23:00:51 +0100
commit8409a876ce460aba2f2e9cba9231a6693a29ccd0 (patch)
tree2a4272cfe0574730bff0886f0ee6ba4fd1e85d17 /src/librados
parentMerge PR #24995 into master (diff)
parentrgw: shutdown services only if initialized (diff)
downloadceph-8409a876ce460aba2f2e9cba9231a6693a29ccd0.tar.xz
ceph-8409a876ce460aba2f2e9cba9231a6693a29ccd0.zip
Merge pull request #24014 from yehudasa/wip-rgw-svc-2
rgw: initial RGWRados refactoring work Reviewed-by: Casey Bodley <cbodley@redhat.com> Reviewed-by: Matt Benjamin <mbenjami@redhat.com>
Diffstat (limited to 'src/librados')
-rw-r--r--src/librados/librados_cxx.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/librados/librados_cxx.cc b/src/librados/librados_cxx.cc
index efc320896dd..42deb1843e5 100644
--- a/src/librados/librados_cxx.cc
+++ b/src/librados/librados_cxx.cc
@@ -1038,6 +1038,19 @@ librados::IoCtx& librados::IoCtx::operator=(const IoCtx& rhs)
return *this;
}
+librados::IoCtx::IoCtx(IoCtx&& rhs) noexcept
+ : io_ctx_impl(std::exchange(rhs.io_ctx_impl, nullptr))
+{
+}
+
+librados::IoCtx& librados::IoCtx::operator=(IoCtx&& rhs) noexcept
+{
+ if (io_ctx_impl)
+ io_ctx_impl->put();
+ io_ctx_impl = std::exchange(rhs.io_ctx_impl, nullptr);
+ return *this;
+}
+
librados::IoCtx::~IoCtx()
{
close();