int ret = 0;
op.omap_get_header(&bl, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r == -ENOENT) { // doesn't exist yet
count = 0;
return 0;
librados::ObjectWriteOperation op;
::cls_user_set_buckets(op, entries, add);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int add(const DoutPrefixProvider* dpp, optional_yield y,
librados::ObjectWriteOperation op;
::cls_user_remove_bucket(op, clsbucket);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int list(const DoutPrefixProvider* dpp, optional_yield y,
entries, &marker, &truncated, &rc);
bufferlist bl;
- int r = ref.operate(dpp, &op, &bl, y);
+ int r = ref.operate(dpp, std::move(op), &bl, y);
if (r == -ENOENT) {
listing.next_marker.clear();
return 0;
::cls_user_get_header(op, &header, nullptr);
bufferlist bl;
- r = ref.operate(dpp, &op, &bl, y);
+ r = ref.operate(dpp, std::move(op), &bl, y);
if (r < 0 && r != -ENOENT) {
return r;
}
encode(call, in);
op.exec("user", "reset_user_stats2", in, &out, &rval);
- r = ref.operate(dpp, &op, y, librados::OPERATION_RETURNVEC);
+ r = ref.operate(dpp, std::move(op), y, librados::OPERATION_RETURNVEC);
if (r < 0) {
return r;
}
librados::ObjectWriteOperation op;
::cls_user_complete_stats_sync(op);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
} // namespace rgwrados::buckets
op.exec(fifo::op::CLASS, fifo::op::GET_META, in,
&bl, nullptr);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (r >= 0) try {
fifo::op::get_meta_reply reply;
auto iter = bl.cbegin();
encode(pp, in);
auto retval = 0;
op.exec(fifo::op::CLASS, fifo::op::PUSH_PART, in, nullptr, &retval);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y, lr::OPERATION_RETURNVEC);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y, lr::OPERATION_RETURNVEC);
if (r < 0) {
ldpp_dout(dpp, -1)
<< __PRETTY_FUNCTION__ << ":" << __LINE__
encode(lp, in);
cb::list bl;
op.exec(fifo::op::CLASS, fifo::op::LIST_PART, in, &bl, nullptr);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (r >= 0) try {
fifo::op::list_part_reply reply;
auto iter = bl.cbegin();
cb::list bl;
encode(gpi, in);
op.exec(fifo::op::CLASS, fifo::op::GET_PART_INFO, in, &bl, nullptr);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (r >= 0) try {
fifo::op::get_part_info_reply reply;
auto iter = bl.cbegin();
lr::ObjectWriteOperation op;
bool canceled = false;
update_meta(&op, version, update);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r >= 0 || r == -ECANCELED) {
canceled = (r == -ECANCELED);
if (!canceled) {
part_init(&op, info.params);
auto oid = info.part_oid(part_num);
l.unlock();
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__
<< " part_init failed: r=" << r << " tid="
std::unique_lock l(m);
auto oid = info.part_oid(part_num);
l.unlock();
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__
<< " remove failed: r=" << r << " tid="
const auto part_oid = info.part_oid(part_num);
l.unlock();
rgw::cls::fifo::trim_part(&op, ofs, exclusive);
- auto r = rgw_rados_operate(dpp, ioctx, part_oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, part_oid, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__
<< " trim_part failed: r=" << r << " tid=" << tid << dendl;
lr::ObjectWriteOperation op;
create_meta(&op, oid, objv, oid_prefix, exclusive, max_part_size,
max_entry_size);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__
<< " create_meta failed: r=" << r << dendl;
objv->prepare_op_for_read(&op);
}
op.read(0, 0, &bl, nullptr);
- return rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ return rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
}
int ConfigImpl::write(const DoutPrefixProvider* dpp, optional_yield y,
}
op.write_full(bl);
- r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r >= 0 && objv) {
objv->apply_write();
}
}
op.remove();
- r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r >= 0 && objv) {
objv->apply_write();
}
librados::ObjectWriteOperation op;
::cls_user_account_resource_add(op, resource, exclusive, limit);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int remove(const DoutPrefixProvider* dpp,
librados::ObjectWriteOperation op;
::cls_user_account_resource_rm(op, name);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int list(const DoutPrefixProvider* dpp,
::cls_user_account_resource_list(op, marker, path_prefix, max_items,
entries, &truncated, &next_marker, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r == -ENOENT) {
next_marker.clear();
return 0;
cls_rgw_bucket_list_op(op, marker, key.name, empty_delim, 1000,
true, &result);
bufferlist ibl;
- int r = bs.bucket_obj.operate(dpp, &op, &ibl, y);
+ int r = bs.bucket_obj.operate(dpp, std::move(op), &ibl, y);
if (r < 0) {
return r;
}
int push(const DoutPrefixProvider *dpp, int index, entries&& items, optional_yield y) override {
lr::ObjectWriteOperation op;
cls_log_add(op, std::get<centries>(items), true);
- auto r = rgw_rados_operate(dpp, ioctx, oids[index], &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oids[index], std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__
<< ": failed to push to " << oids[index] << cpp_strerror(-r)
optional_yield y) override {
lr::ObjectWriteOperation op;
cls_log_add(op, utime_t(now), {}, key, bl);
- auto r = rgw_rados_operate(dpp, ioctx, oids[index], &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oids[index], std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__
<< ": failed to push to " << oids[index]
lr::ObjectReadOperation op;
cls_log_list(op, {}, {}, std::string(marker.value_or("")),
max_entries, log_entries, out_marker, truncated);
- auto r = rgw_rados_operate(dpp, ioctx, oids[index], &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oids[index], std::move(op), nullptr, y);
if (r == -ENOENT) {
*truncated = false;
return 0;
cls_log_header header;
lr::ObjectReadOperation op;
cls_log_info(op, &header);
- auto r = rgw_rados_operate(dpp, ioctx, oids[index], &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oids[index], std::move(op), nullptr, y);
if (r == -ENOENT) r = 0;
if (r < 0) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__
optional_yield y) override {
lr::ObjectWriteOperation op;
cls_log_trim(op, {}, {}, {}, std::string(marker));
- auto r = rgw_rados_operate(dpp, ioctx, oids[index], &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oids[index], std::move(op), y);
if (r == -ENOENT) r = -ENODATA;
if (r < 0 && r != -ENODATA) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__
std::string out_marker;
bool truncated;
cls_log_list(op, {}, {}, {}, 1, log_entries, &out_marker, &truncated);
- auto r = rgw_rados_operate(dpp, ioctx, oids[shard], &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oids[shard], std::move(op), nullptr, y);
if (r == -ENOENT) {
continue;
}
op.create(false);
const uint64_t queue_size = cct->_conf->rgw_gc_max_queue_size, num_deferred_entries = cct->_conf->rgw_gc_max_deferred;
gc_log_init2(op, queue_size, num_deferred_entries);
- store->gc_operate(this, obj_names[i], &op, y);
+ store->gc_operate(this, obj_names[i], std::move(op), y);
}
}
ldpp_dout(this, 20) << "RGWGC::send_chain - on object name: " << obj_names[i] << "tag is: " << tag << dendl;
- auto ret = store->gc_operate(this, obj_names[i], &op, y);
+ auto ret = store->gc_operate(this, obj_names[i], std::move(op), y);
if (ret != -ECANCELED && ret != -EPERM) {
return ret;
}
ObjectWriteOperation set_entry_op;
cls_rgw_gc_set_entry(set_entry_op, cct->_conf->rgw_gc_obj_min_wait, info);
- return store->gc_operate(this, obj_names[i], &set_entry_op, y);
+ return store->gc_operate(this, obj_names[i], std::move(set_entry_op), y);
}
struct defer_chain_state {
ObjectWriteOperation op;
cls_rgw_gc_queue_remove_entries(op, num_entries);
- return store->gc_operate(this, obj_names[index], &op, y);
+ return store->gc_operate(this, obj_names[index], std::move(op), y);
}
static int gc_list(const DoutPrefixProvider* dpp, optional_yield y, librados::IoCtx& io_ctx,
librados::ObjectReadOperation op;
bufferlist bl;
cls_rgw_gc_list(op, marker, max, expired_only, bl);
- int ret = rgw_rados_operate(dpp, io_ctx, oid, &op, nullptr, y);
+ int ret = rgw_rados_operate(dpp, io_ctx, oid, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
}
librados::ObjectWriteOperation op;
op.remove();
auto part_oid = info.part_oid(j);
- auto subr = rgw_rados_operate(dpp, ioctx, part_oid, &op, y);
+ auto subr = rgw_rados_operate(dpp, ioctx, part_oid, std::move(op), y);
if (subr < 0 && subr != -ENOENT) {
if (!ec)
ec = bs::error_code(-subr, bs::system_category());
} else {
op.remove();
}
- r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r < 0 && r != -ENOENT) {
if (!ec)
ec = bs::error_code(-r, bs::system_category());
lock.unlock();
op.write_full(bl);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r < 0 && r != -EEXIST) {
ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__
<< ": failed writing oid=" << oid
cls_version_read(op, &v2);
cb::list bl;
op.read(0, 0, &bl, nullptr);
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (r < 0) {
if (r == -ENOENT) {
ldpp_dout(dpp, 5) << __PRETTY_FUNCTION__ << ":" << __LINE__
cls_version_inc(op);
auto oldv = version;
l.unlock();
- auto r = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ auto r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (r == 0) {
if (oldv != version) {
return { ECANCELED, bs::system_category() };
librados::ObjectReadOperation op;
queues_t queues_chunk;
op.omap_get_keys2(start_after, max_chunk, &queues_chunk, &more, &rval);
- const auto ret = rgw_rados_operate(this, rados_store.getRados()->get_notif_pool_ctx(), Q_LIST_OBJECT_NAME, &op, nullptr, y);
+ const auto ret = rgw_rados_operate(this, rados_store.getRados()->get_notif_pool_ctx(), Q_LIST_OBJECT_NAME, std::move(op), nullptr, y);
if (ret == -ENOENT) {
// queue list object was not created - nothing to do
return 0;
"" /*no tag*/);
cls_2pc_queue_expire_reservations(op, stale_time);
// check ownership and do reservation cleanup in one batch
- auto ret = rgw_rados_operate(this, rados_store.getRados()->get_notif_pool_ctx(), queue_name, &op, yield);
+ auto ret = rgw_rados_operate(this, rados_store.getRados()->get_notif_pool_ctx(), queue_name, std::move(op), yield);
if (ret == -ENOENT) {
// queue was deleted
ldpp_dout(this, 10) << "INFO: queue: " << queue_name
op.assert_exists();
rados::cls::lock::unlock(&op, queue_name+"_lock", lock_cookie);
auto& rados_ioctx = rados_store.getRados()->get_notif_pool_ctx();
- const auto ret = rgw_rados_operate(this, rados_ioctx, queue_name, &op, yield);
+ const auto ret = rgw_rados_operate(this, rados_ioctx, queue_name, std::move(op), yield);
if (ret == -ENOENT) {
ldpp_dout(this, 10) << "INFO: queue: " << queue_name
<< ". was removed. nothing to unlock" << dendl;
"" /*no tag*/);
cls_2pc_queue_list_entries(op, start_marker, max_elements, &obl, &rval);
// check ownership and list entries in one batch
- auto ret = rgw_rados_operate(this, rados_ioctx, queue_name, &op, nullptr, yield);
+ auto ret = rgw_rados_operate(this, rados_ioctx, queue_name, std::move(op), nullptr, yield);
if (ret == -ENOENT) {
// queue was deleted
topics_persistency_tracker.erase(queue_name);
"" /*no tag*/);
cls_2pc_queue_remove_entries(op, end_marker, entries_to_remove);
// check ownership and deleted entries in one batch
- auto ret = rgw_rados_operate(this, rados_ioctx, queue_name, &op, yield);
+ auto ret = rgw_rados_operate(this, rados_ioctx, queue_name, std::move(op), yield);
if (ret == -ENOENT) {
// queue was deleted
ldpp_dout(this, 10) << "INFO: queue: " << queue_name
cls_2pc_reservation::id_t reservation_id;
buffer::list obl;
int rval;
+ op = librados::ObjectWriteOperation();
cls_2pc_queue_reserve(op, size_to_migrate, migration_vector.size(), &obl, &rval);
- ret = rgw_rados_operate(this, rados_ioctx, queue_name, &op, yield, librados::OPERATION_RETURNVEC);
+ ret = rgw_rados_operate(this, rados_ioctx, queue_name, std::move(op), yield, librados::OPERATION_RETURNVEC);
if (ret < 0) {
ldpp_dout(this, 1) << "ERROR: failed to reserve migration space on queue: " << queue_name << ". error: " << ret << dendl;
return;
return;
}
+ op = librados::ObjectWriteOperation();
cls_2pc_queue_commit(op, migration_vector, reservation_id);
- ret = rgw_rados_operate(this, rados_ioctx, queue_name, &op, yield);
+ ret = rgw_rados_operate(this, rados_ioctx, queue_name, std::move(op), yield);
reservation_id = cls_2pc_reservation::NO_ID;
if (ret < 0) {
ldpp_dout(this, 1) << "ERROR: failed to commit reservation to queue: " << queue_name << ". error: " << ret << dendl;
failover_time,
LOCK_FLAG_MAY_RENEW);
- ret = rgw_rados_operate(this, rados_ioctx, queue_name, &op, yield);
+ ret = rgw_rados_operate(this, rados_ioctx, queue_name, std::move(op), yield);
if (ret == -EBUSY) {
// lock is already taken by another RGW
ldpp_dout(this, 20) << "INFO: queue: " << queue_name << " owned (locked) by another daemon" << dendl;
librados::ObjectWriteOperation op;
op.create(true);
cls_2pc_queue_init(op, topic_queue, MAX_QUEUE_SIZE);
- auto ret = rgw_rados_operate(dpp, rados_ioctx, topic_queue, &op, y);
+ auto ret = rgw_rados_operate(dpp, rados_ioctx, topic_queue, std::move(op), y);
if (ret == -EEXIST) {
// queue already exists - nothing to do
ldpp_dout(dpp, 20) << "INFO: queue for topic: " << topic_queue << " already exists. nothing to do" << dendl;
bufferlist empty_bl;
std::map<std::string, bufferlist> new_topic{{topic_queue, empty_bl}};
+ op = librados::ObjectWriteOperation();
op.omap_set(new_topic);
- ret = rgw_rados_operate(dpp, rados_ioctx, Q_LIST_OBJECT_NAME, &op, y);
+ ret = rgw_rados_operate(dpp, rados_ioctx, Q_LIST_OBJECT_NAME, std::move(op), y);
if (ret < 0) {
ldpp_dout(dpp, 1) << "ERROR: failed to add queue: " << topic_queue << " to queue list. error: " << ret << dendl;
return ret;
int remove_persistent_topic(const DoutPrefixProvider* dpp, librados::IoCtx& rados_ioctx, const std::string& topic_queue, optional_yield y) {
librados::ObjectWriteOperation op;
op.remove();
- auto ret = rgw_rados_operate(dpp, rados_ioctx, topic_queue, &op, y);
+ auto ret = rgw_rados_operate(dpp, rados_ioctx, topic_queue, std::move(op), y);
if (ret == -ENOENT) {
// queue already removed - nothing to do
ldpp_dout(dpp, 20) << "INFO: queue for topic: " << topic_queue << " already removed. nothing to do" << dendl;
}
std::set<std::string> topic_to_remove{{topic_queue}};
+ op = librados::ObjectWriteOperation();
op.omap_rm_keys(topic_to_remove);
- ret = rgw_rados_operate(dpp, rados_ioctx, Q_LIST_OBJECT_NAME, &op, y);
+ ret = rgw_rados_operate(dpp, rados_ioctx, Q_LIST_OBJECT_NAME, std::move(op), y);
if (ret < 0) {
ldpp_dout(dpp, 1) << "ERROR: failed to remove queue: " << topic_queue << " from queue list. error: " << ret << dendl;
return ret;
cls_2pc_queue_reserve(op, res.size, 1, &obl, &rval);
auto ret = rgw_rados_operate(
res.dpp, res.store->getRados()->get_notif_pool_ctx(), queue_name,
- &op, res.yield, librados::OPERATION_RETURNVEC);
+ std::move(op), res.yield, librados::OPERATION_RETURNVEC);
if (ret < 0) {
ldpp_dout(res.dpp, 1)
<< "ERROR: failed to reserve notification on queue: "
cls_2pc_queue_abort(op, topic.res_id);
auto ret = rgw_rados_operate(
dpp, res.store->getRados()->get_notif_pool_ctx(),
- queue_name, &op,
+ queue_name, std::move(op),
res.yield);
if (ret < 0) {
ldpp_dout(dpp, 1) << "ERROR: failed to abort reservation: "
// now try to make a bigger one
buffer::list obl;
int rval;
+ op = librados::ObjectWriteOperation();
cls_2pc_queue_reserve(op, bl.length(), 1, &obl, &rval);
ret = rgw_rados_operate(
dpp, res.store->getRados()->get_notif_pool_ctx(),
- queue_name, &op, res.yield, librados::OPERATION_RETURNVEC);
+ queue_name, std::move(op), res.yield, librados::OPERATION_RETURNVEC);
if (ret < 0) {
ldpp_dout(dpp, 1) << "ERROR: failed to reserve extra space on queue: "
<< queue_name
cls_2pc_queue_abort(op, topic.res_id);
const auto ret = rgw_rados_operate(
res.dpp, res.store->getRados()->get_notif_pool_ctx(),
- queue_name, &op, res.yield);
+ queue_name, std::move(op), res.yield);
if (ret < 0) {
ldpp_dout(res.dpp, 1) << "ERROR: failed to abort reservation: "
<< topic.res_id <<
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << "(): failed to open obj=" << obj << " (r=" << r << ")" << dendl;
return r;
}
- return obj.operate(dpp, &op, null_yield);
+ return obj.operate(dpp, std::move(op), null_yield);
}
int RGWObjExpStore::objexp_hint_list(const DoutPrefixProvider *dpp,
return r;
}
bufferlist obl;
- int ret = obj.operate(dpp, &op, &obl, null_yield);
+ int ret = obj.operate(dpp, std::move(op), &obl, null_yield);
if ((ret < 0 ) && (ret != -ENOENT)) {
return ret;
do {
librados::ObjectWriteOperation op;
cls_timeindex_trim(op, from_time, to_time, from_marker, to_marker);
- int r = rgw_rados_operate(dpp, ref.ioctx, oid, &op, null_yield);
+ int r = rgw_rados_operate(dpp, ref.ioctx, oid, std::move(op), null_yield);
if (r == -ENODATA)
done = true;
else if (r < 0)
op.assert_exists();
cls_rgw_mp_upload_part_info_update(op, p, info);
cls_version_inc(op);
- r = rgw_rados_operate(rctx.dpp, meta_obj_ref.ioctx, meta_obj_ref.obj.oid, &op, rctx.y);
+ r = rgw_rados_operate(rctx.dpp, meta_obj_ref.ioctx, meta_obj_ref.obj.oid, std::move(op), rctx.y);
ldpp_dout(rctx.dpp, 20) << "Update meta: " << meta_obj_ref.obj.oid << " part " << p << " prefix " << info.manifest.get_prefix() << " return " << r << dendl;
if (r == -EOPNOTSUPP) {
op.assert_exists(); // detect races with abort
op.omap_set(m);
cls_version_inc(op);
- r = rgw_rados_operate(rctx.dpp, meta_obj_ref.ioctx, meta_obj_ref.obj.oid, &op, rctx.y);
+ r = rgw_rados_operate(rctx.dpp, meta_obj_ref.ioctx, meta_obj_ref.obj.oid, std::move(op), rctx.y);
}
if (r < 0) {
cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
cls_rgw_bucket_complete_op(o, c->op, c->tag, c->ver, c->key, c->dir_meta, &c->remove_objs,
c->log_op, c->bilog_op, &c->zones_trace);
- int ret = bs->bucket_obj.operate(&dpp, &o, null_yield);
+ int ret = bs->bucket_obj.operate(&dpp, std::move(o), null_yield);
ldout_bitx(bitx, &dpp, 10) <<
"EXITING " << __func__ << ": ret=" << dendl_bitx;
return ret;
#define HEAD_SIZE 512 * 1024
op.read(0, HEAD_SIZE, &data, NULL);
- ret = rgw_rados_operate(dpp, ioctx, oid, &op, &data, y);
+ ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), &data, y);
if (ret < 0) {
ldpp_dout(dpp, -1) << "ERROR: rgw_rados_operate(oid=" << oid << ") returned ret=" << ret << dendl;
return ret;
wop.write(0, data);
ioctx.locator_set_key(locator);
- rgw_rados_operate(dpp, ioctx, oid, &wop, y);
+ rgw_rados_operate(dpp, ioctx, oid, std::move(wop), y);
}
if (remove_bad) {
mtime = real_clock::from_timespec(mtime_ts);
}
rop.read(ofs, chunk_size, &data, NULL);
- ret = rgw_rados_operate(dpp, src_ioctx, src_oid, &rop, &data, y);
+ ret = rgw_rados_operate(dpp, src_ioctx, src_oid, std::move(rop), &data, y);
if (ret < 0) {
goto done_err;
}
mtime = real_clock::from_timespec(mtime_ts);
}
wop.write(ofs, data);
- ret = rgw_rados_operate(dpp, dst_ioctx, dst_oid, &wop, y);
+ ret = rgw_rados_operate(dpp, dst_ioctx, dst_oid, std::move(wop), y);
if (ret < 0) {
goto done_err;
}
auto& ioctx = ref.ioctx;
tracepoint(rgw_rados, operate_enter, req_id.c_str());
- r = rgw_rados_operate(rctx.dpp, ref.ioctx, ref.obj.oid, &op, rctx.y, 0, &trace, &epoch);
+ r = rgw_rados_operate(rctx.dpp, ref.ioctx, ref.obj.oid, std::move(op), rctx.y, 0, &trace, &epoch);
tracepoint(rgw_rados, operate_exit, req_id.c_str());
if (r < 0) { /* we can expect to get -ECANCELED if object was replaced under,
or -ENOENT if was removed, or -EEXIST if it did not exist
auto& ioctx = ref.ioctx;
version_t epoch = 0;
- r = rgw_rados_operate(dpp, ioctx, ref.obj.oid, &op, y, 0, nullptr, &epoch);
+ r = rgw_rados_operate(dpp, ioctx, ref.obj.oid, std::move(op), y, 0, nullptr, &epoch);
/* raced with another operation, object state is indeterminate */
const bool need_invalidate = (r == -ECANCELED);
ObjectWriteOperation op;
op.remove();
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
if (r < 0)
return r;
op.mtime2(&mtime_ts);
auto& ioctx = ref.ioctx;
version_t epoch = 0;
- r = rgw_rados_operate(dpp, ioctx, ref.obj.oid, &op, y, 0, nullptr, &epoch);
+ r = rgw_rados_operate(dpp, ioctx, ref.obj.oid, std::move(op), y, 0, nullptr, &epoch);
if (state) {
if (r >= 0) {
ACLOwner owner;
state.cur_ioctx->locator_set_key(read_obj.loc);
- r = rgw_rados_operate(dpp, *state.cur_ioctx, read_obj.oid, &op, nullptr, y);
+ r = rgw_rados_operate(dpp, *state.cur_ioctx, read_obj.oid, std::move(op), nullptr, y);
ldpp_dout(dpp, 20) << "rados->read r=" << r << " bl.length=" << bl.length() << dendl;
if (r < 0) {
return 0;
}
-int RGWRados::obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, ObjectWriteOperation *op, optional_yield y)
+int RGWRados::obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, ObjectWriteOperation&& op, optional_yield y)
{
rgw_rados_ref ref;
int r = get_obj_head_ref(dpp, bucket_info, obj, &ref);
return r;
}
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, op, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
}
-int RGWRados::obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, ObjectReadOperation *op, optional_yield y)
+int RGWRados::obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, ObjectReadOperation&& op, optional_yield y)
{
rgw_rados_ref ref;
int r = get_obj_head_ref(dpp, bucket_info, obj, &ref);
bufferlist outbl;
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, op, &outbl, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), &outbl, y);
}
void RGWRados::olh_cancel_modification(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info,
ObjectWriteOperation op;
bucket_index_guard_olh_op(dpp, state, op);
op.rmxattr(attr_name.c_str());
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
if (r < 0) {
if (r != -ENOENT && r != -ECANCELED) {
ldpp_dout(dpp, 0) << __func__ << " target_obj=" << olh_obj << " rmxattr rgw_rados_operate() returned " << r << dendl;
rm_op.cmpxattr(RGW_ATTR_OLH_INFO, CEPH_OSD_CMPXATTR_OP_EQ, bufferlist());
cls_obj_check_prefix_exist(rm_op, RGW_ATTR_OLH_PENDING_PREFIX, true);
rm_op.remove();
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &rm_op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(rm_op), y);
}
if (r < 0 && (r != -ENOENT && r != -ECANCELED)) {
ldpp_dout(dpp, 0) << __func__ << " target_obj=" << olh_obj << " olh rm rgw_rados_operate() returned " << r << dendl;
op.setxattr(attr_name.c_str(), bl);
- int ret = obj_operate(dpp, bucket_info, olh_obj, &op, y);
+ int ret = obj_operate(dpp, bucket_info, olh_obj, std::move(op), y);
if (ret < 0) {
return ret;
}
delete_marker, op_tag, meta, olh_epoch,
unmod_since, high_precision_time,
log_data_change, zones_trace);
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
}, y);
if (r < 0) {
ldpp_dout(dpp, 20) << "rgw_rados_operate() after cls_rgw_bucket_link_olh() returned r=" << r << dendl;
cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
cls_rgw_bucket_unlink_instance(op, key, op_tag,
olh_tag, olh_epoch, log_op, bilog_flags, zones_trace);
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
}, y);
if (r < 0) {
ldpp_dout(dpp, 20) << "rgw_rados_operate() after cls_rgw_bucket_link_instance() returned r=" << r << dendl;
int op_ret = 0;
cls_rgw_get_olh_log(op, key, ver_marker, olh_tag, log_ret, op_ret);
bufferlist outbl;
- r = rgw_rados_operate(dpp, shard_ref.ioctx, shard_ref.obj.oid, &op, &outbl, y);
+ r = rgw_rados_operate(dpp, shard_ref.ioctx, shard_ref.obj.oid, std::move(op), &outbl, y);
if (r < 0) {
return r;
}
if (r < 0) {
return r;
}
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, 0) << "repair_olh failed to write olh attributes with "
<< cpp_strerror(r) << dendl;
op.assert_exists(); // bucket index shard must exist
cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
cls_rgw_trim_olh_log(op, key, ver, olh_tag);
- return pbs->bucket_obj.operate(dpp, &op, y);
+ return pbs->bucket_obj.operate(dpp, std::move(op), y);
}, y);
if (ret < 0) {
ldpp_dout(dpp, 20) << "cls_rgw_trim_olh_log() returned r=" << ret << dendl;
auto& ref = bs.bucket_obj;
cls_rgw_guard_bucket_resharding(op, -ERR_BUSY_RESHARDING);
cls_rgw_clear_olh(op, key, olh_tag);
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
}, y);
if (ret < 0) {
ldpp_dout(dpp, 5) << "rgw_rados_operate() after cls_rgw_clear_olh() returned ret=" << ret << dendl;
}
/* update olh object */
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << ": could not apply olh update to oid \"" << ref.obj.oid << "\", r=" << r << dendl;
return r;
cls_obj_check_prefix_exist(rm_op, RGW_ATTR_OLH_PENDING_PREFIX, true); /* fail if found one of these, pending modification */
rm_op.remove();
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &rm_op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(rm_op), y);
if (r == -ECANCELED) {
return r; /* someone else made a modification in the meantime */
}
ObjectReadOperation op;
op.getxattrs(&attrset, NULL);
- int r = obj_operate(dpp, bucket_info, obj, &op, y);
+ int r = obj_operate(dpp, bucket_info, obj, std::move(op), y);
if (r < 0) {
return r;
}
op.rmxattr(i->first.c_str());
}
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
if (r == -ENOENT || r == -ECANCELED) {
/* raced with some other change, shouldn't sweat about it */
return 0;
}
bufferlist outbl;
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, &outbl, y, 0, nullptr, epoch);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), &outbl, y, 0, nullptr, epoch);
if (r < 0)
return r;
return CLSRGWIssueReshardLogTrim(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
}
-int RGWRados::gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectWriteOperation *op, optional_yield y)
+int RGWRados::gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectWriteOperation&& op, optional_yield y)
{
- return rgw_rados_operate(dpp, gc_pool_ctx, oid, op, y);
+ return rgw_rados_operate(dpp, gc_pool_ctx, oid, std::move(op), y);
}
int RGWRados::gc_aio_operate(const string& oid, librados::AioCompletion *c,
return gc_pool_ctx.aio_operate(oid, c, op);
}
-int RGWRados::gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectReadOperation *op, bufferlist *pbl, optional_yield y)
+int RGWRados::gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectReadOperation&& op, bufferlist *pbl, optional_yield y)
{
- return rgw_rados_operate(dpp, gc_pool_ctx, oid, op, pbl, y);
+ return rgw_rados_operate(dpp, gc_pool_ctx, oid, std::move(op), pbl, y);
}
int RGWRados::list_gc_objs(int *index, string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated, bool& processing_queue)
cls_rgw_obj_key key(obj.key.get_index_key_name(), obj.key.instance);
cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
cls_rgw_bucket_prepare_op(o, op, tag, key, obj.key.get_loc(), log_op, bilog_flags, zones_trace);
- int ret = bs.bucket_obj.operate(dpp, &o, y);
+ int ret = bs.bucket_obj.operate(dpp, std::move(o), y);
ldout_bitx(bitx, dpp, 10) << "EXITING " << __func__ << ": ret=" << ret << dendl_bitx;
return ret;
}
cls_rgw_bucket_list_op(op, marker, prefix, empty_delimiter,
num_entries,
list_versions, &result);
- r = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y, 0, nullptr, &index_ver.epoch);
+ r = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y, 0, nullptr, &index_ver.epoch);
if (r < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ <<
": error in rgw_rados_operate (bucket list op), r=" << r << dendl;
ObjectWriteOperation op;
cls_rgw_usage_log_add(op, info);
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
return r;
}
do {
librados::ObjectWriteOperation op;
cls_rgw_usage_log_trim(op, user, bucket, start_epoch, end_epoch);
- int r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ int r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
if (r == -ENODATA)
done = true;
else if (r < 0)
}
librados::ObjectWriteOperation op;
cls_rgw_usage_log_clear(op);
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
return r;
}
std::map<std::string, bufferlist> *attrs, bufferlist *first_chunk,
RGWObjVersionTracker *objv_tracker, optional_yield y);
- int obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::ObjectWriteOperation *op, optional_yield y);
- int obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::ObjectReadOperation *op, optional_yield y);
+ int obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::ObjectWriteOperation&& op, optional_yield y);
+ int obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::ObjectReadOperation&& op, optional_yield y);
int guard_reshard(const DoutPrefixProvider *dpp,
BucketShard *bs,
std::tuple<int, std::optional<cls_rgw_obj_chain>> send_chain_to_gc(cls_rgw_obj_chain& chain, const std::string& tag, optional_yield y);
void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain,
const std::string& tag, optional_yield y);
- int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectWriteOperation *op, optional_yield y);
+ int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectWriteOperation&& op, optional_yield y);
int gc_aio_operate(const std::string& oid, librados::AioCompletion *c,
librados::ObjectWriteOperation *op);
- int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectReadOperation *op, bufferlist *pbl, optional_yield y);
+ int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectReadOperation&& op, bufferlist *pbl, optional_yield y);
int list_gc_objs(int *index, std::string& marker, uint32_t max, bool expired_only, std::list<cls_rgw_gc_obj_info>& result, bool *truncated, bool& processing_queue);
int process_gc(bool expired_only, optional_yield y);
cls_rgw_reshard_add(op, entry, create_only);
- int ret = rgw_rados_operate(dpp, store->getRados()->reshard_pool_ctx, logshard_oid, &op, y);
+ int ret = rgw_rados_operate(dpp, store->getRados()->reshard_pool_ctx, logshard_oid, std::move(op), y);
if (create_only && ret == -EEXIST) {
ldpp_dout(dpp, 20) <<
"INFO: did not write reshard queue entry for oid=" <<
librados::ObjectWriteOperation op;
cls_rgw_reshard_remove(op, entry);
- int ret = rgw_rados_operate(dpp, store->getRados()->reshard_pool_ctx, logshard_oid, &op, y);
+ int ret = rgw_rados_operate(dpp, store->getRados()->reshard_pool_ctx, logshard_oid, std::move(op), y);
if (ret < 0) {
ldpp_dout(dpp, -1) << "ERROR: failed to remove entry from reshard log, oid=" << logshard_oid << " tenant=" << entry.tenant << " bucket=" << entry.bucket_name << dendl;
return ret;
std::ignore = completion.release();
return 0;
}
- if (const auto ret = rgw_rados_operate(dpp, io_ctx, temp_obj_name, &op, y); ret < 0) {
+ if (const auto ret = rgw_rados_operate(dpp, io_ctx, temp_obj_name, std::move(op), y); ret < 0) {
ldpp_dout(dpp, 1) << "ERROR: failed to append to logging object '" << temp_obj_name <<
"'. ret = " << ret << dendl;
return ret;
librados::ObjectReadOperation op;
op.omap_get_vals_by_keys(keys, &result, nullptr);
- ret = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, nullptr, y);
+ ret = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
}
int MPRadosSerializer::try_lock(const DoutPrefixProvider *dpp, utime_t dur, optional_yield y)
{
+ librados::ObjectWriteOperation op;
op.assert_exists();
lock.set_duration(dur);
lock.lock_exclusive(&op);
- int ret = rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ int ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
if (! ret) {
locked = true;
}
cls_rgw_lc_get_entry(op, marker, bl);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- int ret = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ int ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
}
cls_rgw_lc_get_next_entry(op, marker, bl);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- int ret = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ int ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
}
cls_rgw_lc_set_entry(op, cls_entry);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- return rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ return rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
}
int RadosLifecycle::list_entries(const DoutPrefixProvider* dpp, optional_yield y,
cls_rgw_lc_list(op, marker, max_entries, bl);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- int ret = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ int ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
}
cls_rgw_lc_rm_entry(op, cls_entry);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- return rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ return rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
}
int RadosLifecycle::get_head(const DoutPrefixProvider* dpp, optional_yield y,
cls_rgw_lc_get_head(op, bl);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- int ret = rgw_rados_operate(dpp, ioctx, oid, &op, nullptr, y);
+ int ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
}
cls_rgw_lc_put_head(op, cls_head);
auto& ioctx = *store->getRados()->get_lc_pool_ctx();
- return rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ return rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
}
std::unique_ptr<LCSerializer> RadosLifecycle::get_serializer(const std::string& lock_name,
librados::ObjectWriteOperation op;
op.omap_set(new_package);
return rgw_rados_operate(dpp, ioctx,
- PACKAGE_LIST_OBJECT_NAME, &op, y);
+ PACKAGE_LIST_OBJECT_NAME, std::move(op), y);
}
int RadosLuaManager::remove_package(const DoutPrefixProvider *dpp, optional_yield y, const std::string& package_name)
// remove specific version of the the package
op.omap_rm_keys(std::set<std::string>({package_name}));
auto ret = rgw_rados_operate(dpp, ioctx,
- PACKAGE_LIST_OBJECT_NAME, &op, y);
+ PACKAGE_LIST_OBJECT_NAME, std::move(op), y);
if (ret < 0) {
return ret;
}
if (package_no_version.compare(package_name) == 0) {
op.omap_rm_keys(std::set<std::string>({package}));
ret = rgw_rados_operate(dpp, ioctx,
- PACKAGE_LIST_OBJECT_NAME, &op, y);
+ PACKAGE_LIST_OBJECT_NAME, std::move(op), y);
if (ret < 0) {
return ret;
}
rgw::lua::packages_t packages_chunk;
op.omap_get_keys2(start_after, max_chunk, &packages_chunk, &more, &rval);
const auto ret = rgw_rados_operate(dpp, ioctx,
- PACKAGE_LIST_OBJECT_NAME, &op, nullptr, y);
+ PACKAGE_LIST_OBJECT_NAME, std::move(op), nullptr, y);
if (ret < 0) {
return ret;
librados::ObjectWriteOperation op;
op.create(false);
auto r = rgw_rados_operate(dpp, ioctx,
- PACKAGE_LIST_OBJECT_NAME, &op, null_yield);
+ PACKAGE_LIST_OBJECT_NAME, std::move(op), null_yield);
if (r < 0) {
ldpp_dout(dpp, 1) << "ERROR: failed to watch " << PACKAGE_LIST_OBJECT_NAME
<< ". cannot create object. error: " << cpp_strerror(r) << dendl;
class MPRadosSerializer : public StoreMPSerializer {
librados::IoCtx ioctx;
::rados::cls::lock::Lock lock;
- librados::ObjectWriteOperation op;
public:
MPRadosSerializer(const DoutPrefixProvider *dpp, RadosStore* store, RadosObject* obj, const std::string& lock_name);
}
int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, const std::string& oid,
- librados::ObjectReadOperation *op, bufferlist* pbl,
+ librados::ObjectReadOperation&& op, bufferlist* pbl,
optional_yield y, int flags, const jspan_context* trace_info,
version_t* pver)
{
auto& yield = y.get_yield_context();
auto ex = yield.get_executor();
boost::system::error_code ec;
- auto [ver, bl] = librados::async_operate(ex, ioctx, oid, std::move(*op),
+ auto [ver, bl] = librados::async_operate(ex, ioctx, oid, std::move(op),
flags, trace_info, yield[ec]);
if (pbl) {
*pbl = std::move(bl);
return -ec.value();
}
maybe_warn_about_blocking(dpp);
- int r = ioctx.operate(oid, op, nullptr, flags);
+ int r = ioctx.operate(oid, &op, nullptr, flags);
if (pver) {
*pver = ioctx.get_last_version();
}
}
int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, const std::string& oid,
- librados::ObjectWriteOperation *op, optional_yield y,
+ librados::ObjectWriteOperation&& op, optional_yield y,
int flags, const jspan_context* trace_info, version_t* pver)
{
if (y) {
auto& yield = y.get_yield_context();
auto ex = yield.get_executor();
boost::system::error_code ec;
- version_t ver = librados::async_operate(ex, ioctx, oid, std::move(*op),
+ version_t ver = librados::async_operate(ex, ioctx, oid, std::move(op),
flags, trace_info, yield[ec]);
if (pver) {
*pver = ver;
return -ec.value();
}
maybe_warn_about_blocking(dpp);
- int r = ioctx.operate(oid, op, flags, trace_info);
+ int r = ioctx.operate(oid, &op, flags, trace_info);
if (pver) {
*pver = ioctx.get_last_version();
}
/// perform the rados operation, using the yield context when given
int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, const std::string& oid,
- librados::ObjectReadOperation *op, bufferlist* pbl,
+ librados::ObjectReadOperation&& op, bufferlist* pbl,
optional_yield y, int flags = 0, const jspan_context* trace_info = nullptr,
version_t* pver = nullptr);
int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, const std::string& oid,
- librados::ObjectWriteOperation *op, optional_yield y,
+ librados::ObjectWriteOperation&& op, optional_yield y,
int flags = 0, const jspan_context* trace_info = nullptr,
version_t* pver = nullptr);
int rgw_rados_notify(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, const std::string& oid,
rgw_raw_obj obj;
- int operate(const DoutPrefixProvider* dpp, librados::ObjectReadOperation* op,
+ int operate(const DoutPrefixProvider* dpp, librados::ObjectReadOperation&& op,
bufferlist* pbl, optional_yield y, int flags = 0) {
- return rgw_rados_operate(dpp, ioctx, obj.oid, op, pbl, y, flags);
+ return rgw_rados_operate(dpp, ioctx, obj.oid, std::move(op), pbl, y, flags);
}
- int operate(const DoutPrefixProvider* dpp, librados::ObjectWriteOperation* op,
+ int operate(const DoutPrefixProvider* dpp, librados::ObjectWriteOperation&& op,
optional_yield y, int flags = 0) {
- return rgw_rados_operate(dpp, ioctx, obj.oid, op, y, flags);
+ return rgw_rados_operate(dpp, ioctx, obj.oid, std::move(op), y, flags);
}
int aio_operate(librados::AioCompletion* c,
librados::ObjectWriteOperation op;
::cls_user_account_resource_add(op, resource, exclusive, limit);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int get(const DoutPrefixProvider* dpp,
int ret = 0;
::cls_user_account_resource_get(op, name, resource, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r < 0) {
return r;
}
librados::ObjectWriteOperation op;
::cls_user_account_resource_rm(op, name);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int list(const DoutPrefixProvider* dpp,
::cls_user_account_resource_list(op, marker, path_prefix, max_items,
entries, &truncated, &next_marker, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r == -ENOENT) {
next_marker.clear();
return 0;
librados::ObjectWriteOperation op;
op.omap_set({{bucket_key, bufferlist{}}});
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
}
int unlink_bucket(const DoutPrefixProvider* dpp, optional_yield y,
librados::ObjectWriteOperation op;
op.omap_rm_keys({{bucket_key}});
- return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, y);
+ return rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), y);
}
int list_buckets(const DoutPrefixProvider* dpp, optional_yield y,
bool more = false;
int rval = 0;
op.omap_get_keys2(marker, max_items, &keys, &more, &rval);
- r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, &op, nullptr, y);
+ r = rgw_rados_operate(dpp, ref.ioctx, ref.obj.oid, std::move(op), nullptr, y);
if (r == -ENOENT) {
return 0;
}
librados::ObjectWriteOperation op;
::cls_user_account_resource_add(op, resource, exclusive, limit);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int remove(const DoutPrefixProvider* dpp,
librados::ObjectWriteOperation op;
::cls_user_account_resource_rm(op, name);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int list(const DoutPrefixProvider* dpp,
::cls_user_account_resource_list(op, marker, path_prefix, max_items,
entries, &truncated, &next_marker, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r == -ENOENT) {
next_marker.clear();
return 0;
librados::ObjectWriteOperation op;
::cls_user_account_resource_add(op, resource, exclusive, limit);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int get(const DoutPrefixProvider* dpp,
int ret = 0;
::cls_user_account_resource_get(op, name, resource, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r < 0) {
return r;
}
librados::ObjectWriteOperation op;
::cls_user_account_resource_rm(op, name);
- return ref.operate(dpp, &op, y);
+ return ref.operate(dpp, std::move(op), y);
}
int list(const DoutPrefixProvider* dpp,
::cls_user_account_resource_list(op, marker, path_prefix, max_items,
entries, &truncated, &next_marker, &ret);
- r = ref.operate(dpp, &op, nullptr, y);
+ r = ref.operate(dpp, std::move(op), nullptr, y);
if (r == -ENOENT) {
next_marker.clear();
return 0;
for (map<string, bufferlist>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) {
ldpp_dout(dpp, 20) << " > " << iter->first << dendl;
}
- int ret = rgw_rados_operate(dpp, ioctx, oid, &op, null_yield);
+ int ret = rgw_rados_operate(dpp, ioctx, oid, std::move(op), null_yield);
if (ret < 0) {
ldpp_dout(dpp, -1) << "ERROR: " << __func__ << "(" << oid << ") returned ret=" << ret << dendl;
}
librados::ObjectWriteOperation op;
prepare_mfa_write(&op, objv_tracker, mtime);
rados::cls::otp::OTP::create(&op, config);
- r = obj.operate(dpp, &op, y);
+ r = obj.operate(dpp, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, 20) << "OTP create, otp_id=" << config.id << " result=" << (int)r << dendl;
return r;
librados::ObjectWriteOperation op;
prepare_mfa_write(&op, objv_tracker, mtime);
rados::cls::otp::OTP::remove(&op, id);
- r = obj.operate(dpp, &op, y);
+ r = obj.operate(dpp, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, 20) << "OTP remove, otp_id=" << id << " result=" << (int)r << dendl;
return r;
}
prepare_mfa_write(&op, objv_tracker, mtime);
rados::cls::otp::OTP::set(&op, entries);
- r = obj.operate(dpp, &op, y);
+ r = obj.operate(dpp, std::move(op), y);
if (r < 0) {
ldpp_dout(dpp, 20) << "OTP set entries.size()=" << entries.size() << " result=" << (int)r << dendl;
return r;
utime_t t(ut);
cls_log_add(op, t, section, key, bl);
- return obj.operate(dpp, &op, y);
+ return obj.operate(dpp, std::move(op), y);
}
int RGWSI_Cls::TimeLog::add(const DoutPrefixProvider *dpp,
cls_log_add(op, entries, monotonic_inc);
if (!completion) {
- r = obj.operate(dpp, &op, y);
+ r = obj.operate(dpp, std::move(op), y);
} else {
r = obj.aio_operate(completion, &op);
}
bufferlist obl;
- int ret = obj.operate(dpp, &op, &obl, y);
+ int ret = obj.operate(dpp, std::move(op), &obl, y);
if (ret < 0)
return ret;
bufferlist obl;
- int ret = obj.operate(dpp, &op, &obl, y);
+ int ret = obj.operate(dpp, std::move(op), &obl, y);
if (ret < 0)
return ret;
cls_log_trim(op, st, et, from_marker, to_marker);
if (!completion) {
- r = obj.operate(dpp, &op, y);
+ r = obj.operate(dpp, std::move(op), y);
} else {
r = obj.aio_operate(completion, &op);
}
librados::ObjectWriteOperation op;
op.create(false);
- r = notify_obj.operate(dpp, &op, y);
+ r = notify_obj.operate(dpp, std::move(op), y);
if (r < 0 && r != -EEXIST) {
ldpp_dout(dpp, 0) << "ERROR: notify_obj.operate() returned r=" << r << dendl;
return r;
op.stat2(&size, &mtime_ts, nullptr);
}
bufferlist outbl;
- r = rados_obj.operate(dpp, &op, &outbl, y);
+ r = rados_obj.operate(dpp, std::move(op), &outbl, y);
if (r < 0)
return r;
}
version_t op_ver = 0;
- r = rgw_rados_operate(dpp, ref.ioctx, obj.oid, &op, nullptr, y, 0, nullptr, &op_ver);
+ r = rgw_rados_operate(dpp, ref.ioctx, obj.oid, std::move(op), nullptr, y, 0, nullptr, &op_ver);
if (r < 0) {
ldpp_dout(dpp, 20) << "rados_obj.operate() r=" << r << " bl.length=" << bl->length() << dendl;
return r;
int rval;
op.getxattr(name, dest, &rval);
- r = rados_obj.operate(dpp, &op, nullptr, y);
+ r = rados_obj.operate(dpp, std::move(op), nullptr, y);
if (r < 0)
return r;
bufferlist bl;
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
if (r < 0)
return r;
int rval;
op.omap_get_vals2(start_after, count, &t, &more, &rval);
- r = rados_obj.operate(dpp, &op, nullptr, y);
+ r = rados_obj.operate(dpp, std::move(op), nullptr, y);
if (r < 0) {
return r;
}
int rval;
op.omap_get_vals2(start_after, count, &t, &more, &rval);
- r = rados_obj.operate(dpp, &op, nullptr, y);
+ r = rados_obj.operate(dpp, std::move(op), nullptr, y);
if (r < 0) {
return r;
}
if (must_exist)
op.assert_exists();
op.omap_set(m);
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
return r;
}
if (must_exist)
op.assert_exists();
op.omap_set(m);
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
return r;
}
op.omap_rm_keys(k);
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
return r;
}
}
op.remove();
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
if (r < 0)
return r;
op.setxattr(name.c_str(), bl);
}
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
if (r < 0) {
return r;
}
objv_tracker->prepare_op_for_write(&op);
}
op.write_full(bl);
- r = rados_obj.operate(dpp, &op, y);
+ r = rados_obj.operate(dpp, std::move(op), y);
if (r < 0)
return r;
R::ObjectWriteOperation op;
RCf::create_meta(&op, id, objv, oid_prefix, exclusive, max_part_size,
max_entry_size);
- return rgw_rados_operate(dpp, ioctx, oid, &op, y);
+ return rgw_rados_operate(dpp, ioctx, oid, std::move(op), y);
}
}
cb::list bl;
encode(i, bl);
cls_log_add(op, ceph_clock_now(), {}, "meow", bl);
- auto r = rgw_rados_operate(&dp, ioctx, get_oid(0, i), &op, null_yield);
+ auto r = rgw_rados_operate(&dp, ioctx, get_oid(0, i), std::move(op), null_yield);
ASSERT_GE(r, 0);
}
}
cb::list bl;
encode(i, bl);
cls_log_add(op, ceph_clock_now(), {}, "meow", bl);
- auto r = rgw_rados_operate(&dp, ioctx, get_oid(0, i), &op, null_yield);
+ auto r = rgw_rados_operate(&dp, ioctx, get_oid(0, i), std::move(op), null_yield);
ASSERT_GE(r, 0);
}
std::list<cls_log_entry> entries;
bool truncated = false;
cls_log_list(op, {}, {}, {}, 1, entries, &to_marker, &truncated);
- auto r = rgw_rados_operate(&dp, ioctx, oid, &op, nullptr, null_yield);
+ auto r = rgw_rados_operate(&dp, ioctx, oid, std::move(op), nullptr, null_yield);
ASSERT_GE(r, 0);
ASSERT_FALSE(entries.empty());
}
{
lr::ObjectWriteOperation op;
cls_log_trim(op, {}, {}, {}, to_marker);
- auto r = rgw_rados_operate(&dp, ioctx, oid, &op, null_yield);
+ auto r = rgw_rados_operate(&dp, ioctx, oid, std::move(op), null_yield);
ASSERT_GE(r, 0);
}
{
std::list<cls_log_entry> entries;
bool truncated = false;
cls_log_list(op, {}, {}, {}, 1, entries, &to_marker, &truncated);
- auto r = rgw_rados_operate(&dp, ioctx, oid, &op, nullptr, null_yield);
+ auto r = rgw_rados_operate(&dp, ioctx, oid, std::move(op), nullptr, null_yield);
ASSERT_GE(r, 0);
ASSERT_TRUE(entries.empty());
}