diff options
author | Yehuda Sadeh <yehuda@redhat.com> | 2018-11-08 23:00:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-08 23:00:51 +0100 |
commit | 8409a876ce460aba2f2e9cba9231a6693a29ccd0 (patch) | |
tree | 2a4272cfe0574730bff0886f0ee6ba4fd1e85d17 /src/librados | |
parent | Merge PR #24995 into master (diff) | |
parent | rgw: shutdown services only if initialized (diff) | |
download | ceph-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.cc | 13 |
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(); |