int send() override {
I &image_ctx = this->m_image_ctx;
- ceph_assert(image_ctx.owner_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
CephContext *cct = image_ctx.cct;
if (image_ctx.exclusive_lock != nullptr &&
}
private:
- uint64_t m_object_size;
::SnapContext m_snapc;
uint64_t m_object_no;
void start_async_op() {
I &image_ctx = this->m_image_ctx;
- ceph_assert(image_ctx.owner_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
CephContext *cct = image_ctx.cct;
ldout(cct, 10) << dendl;
return;
}
- RWLock::RLocker owner_locker(image_ctx.owner_lock);
+ std::shared_lock owner_locker{image_ctx.owner_lock};
start_async_op();
}
bool is_within_overlap_bounds() {
I &image_ctx = this->m_image_ctx;
- RWLock::RLocker snap_locker(image_ctx.snap_lock);
+ std::shared_lock image_locker{image_ctx.image_lock};
auto overlap = std::min(image_ctx.size, image_ctx.migration_info.overlap);
return overlap > 0 &&
void migrate_object() {
I &image_ctx = this->m_image_ctx;
- ceph_assert(image_ctx.owner_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
CephContext *cct = image_ctx.cct;
auto ctx = create_context_callback<
if (is_within_overlap_bounds()) {
bufferlist bl;
- string oid = image_ctx.get_object_name(m_object_no);
- auto req = new io::ObjectWriteRequest<I>(&image_ctx, oid, m_object_no, 0,
+ auto req = new io::ObjectWriteRequest<I>(&image_ctx, m_object_no, 0,
std::move(bl), m_snapc, 0, {},
ctx);
ceph_assert(image_ctx.parent != nullptr);
auto req = deep_copy::ObjectCopyRequest<I>::create(
- image_ctx.parent, &image_ctx, image_ctx.migration_info.snap_map,
+ image_ctx.parent, &image_ctx, 0, 0, image_ctx.migration_info.snap_map,
m_object_no, image_ctx.migration_info.flatten, ctx);
ldout(cct, 20) << "deep copy object req " << req << ", object_no "
template <typename I>
void MigrateRequest<I>::send_op() {
I &image_ctx = this->m_image_ctx;
- ceph_assert(image_ctx.owner_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
CephContext *cct = image_ctx.cct;
ldout(cct, 10) << dendl;
void MigrateRequest<I>::migrate_objects() {
I &image_ctx = this->m_image_ctx;
CephContext *cct = image_ctx.cct;
- ceph_assert(image_ctx.owner_lock.is_locked());
+ ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock));
uint64_t overlap_objects = get_num_overlap_objects();
CephContext *cct = image_ctx.cct;
ldout(cct, 10) << dendl;
- RWLock::RLocker snap_locker(image_ctx.snap_lock);
- RWLock::RLocker parent_locker(image_ctx.parent_lock);
+ std::shared_lock image_locker{image_ctx.image_lock};
auto overlap = image_ctx.migration_info.overlap;