mirror of
https://github.com/ceph/ceph
synced 2025-01-30 06:53:38 +00:00
Merge pull request #20507 from trociny/wip-remote-rename
librbd: make rename request complete with filtered code Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
commit
698b6f8486
@ -64,7 +64,7 @@ bool RenameRequest<I>::should_complete(int r) {
|
||||
CephContext *cct = image_ctx.cct;
|
||||
ldout(cct, 5) << this << " " << __func__ << ": state=" << m_state << ", "
|
||||
<< "r=" << r << dendl;
|
||||
r = filter_state_return_code(r);
|
||||
r = filter_return_code(r);
|
||||
if (r < 0) {
|
||||
if (r == -EEXIST) {
|
||||
ldout(cct, 1) << "image already exists" << dendl;
|
||||
@ -100,7 +100,7 @@ bool RenameRequest<I>::should_complete(int r) {
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
int RenameRequest<I>::filter_state_return_code(int r) {
|
||||
int RenameRequest<I>::filter_return_code(int r) const {
|
||||
I &image_ctx = this->m_image_ctx;
|
||||
CephContext *cct = image_ctx.cct;
|
||||
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
protected:
|
||||
void send_op() override;
|
||||
bool should_complete(int r) override;
|
||||
int filter_return_code(int r) const override;
|
||||
|
||||
journal::Event create_event(uint64_t op_tid) const override {
|
||||
return journal::RenameEvent(op_tid, m_dest_name);
|
||||
@ -72,8 +73,6 @@ private:
|
||||
|
||||
bufferlist m_header_bl;
|
||||
|
||||
int filter_state_return_code(int r);
|
||||
|
||||
void send_read_source_header();
|
||||
void send_write_destination_header();
|
||||
void send_update_directory();
|
||||
|
@ -4555,7 +4555,7 @@ TEST_F(TestLibRBD, RebuildObjectMapViaLockOwner)
|
||||
|
||||
TEST_F(TestLibRBD, RenameViaLockOwner)
|
||||
{
|
||||
REQUIRE_FEATURE(RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK);
|
||||
REQUIRE_FEATURE(RBD_FEATURE_JOURNALING);
|
||||
|
||||
librados::IoCtx ioctx;
|
||||
ASSERT_EQ(0, _rados.ioctx_create(m_pool_name.c_str(), ioctx));
|
||||
@ -4587,7 +4587,7 @@ TEST_F(TestLibRBD, RenameViaLockOwner)
|
||||
|
||||
TEST_F(TestLibRBD, SnapCreateViaLockOwner)
|
||||
{
|
||||
REQUIRE_FEATURE(RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK);
|
||||
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);
|
||||
|
||||
librados::IoCtx ioctx;
|
||||
ASSERT_EQ(0, _rados.ioctx_create(m_pool_name.c_str(), ioctx));
|
||||
@ -4631,7 +4631,7 @@ TEST_F(TestLibRBD, SnapCreateViaLockOwner)
|
||||
|
||||
TEST_F(TestLibRBD, SnapRemoveViaLockOwner)
|
||||
{
|
||||
REQUIRE_FEATURE(RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK);
|
||||
REQUIRE_FEATURE(RBD_FEATURE_FAST_DIFF);
|
||||
|
||||
librados::IoCtx ioctx;
|
||||
ASSERT_EQ(0, _rados.ioctx_create(m_pool_name.c_str(), ioctx));
|
||||
|
Loading…
Reference in New Issue
Block a user