return 0;
}
+map<string, bufferlist>* no_change_attrs() {
+ static map<string, bufferlist> no_change;
+ return &no_change;
+}
+
int rgw_put_system_obj(const DoutPrefixProvider *dpp,
RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive,
RGWObjVersionTracker *objv_tracker, real_time set_mtime, optional_yield y, map<string, bufferlist> *pattrs)
rgw_raw_obj obj(pool, oid);
auto sysobj = obj_ctx.get_obj(obj);
- int ret = sysobj.wop()
- .set_objv_tracker(objv_tracker)
- .set_exclusive(exclusive)
- .set_mtime(set_mtime)
- .set_attrs(*pattrs)
- .write(dpp, data, y);
+ int ret;
+
+ if (pattrs != no_change_attrs()) {
+ ret = sysobj.wop()
+ .set_objv_tracker(objv_tracker)
+ .set_exclusive(exclusive)
+ .set_mtime(set_mtime)
+ .set_attrs(*pattrs)
+ .write(dpp, data, y);
+ } else {
+ ret = sysobj.wop()
+ .set_objv_tracker(objv_tracker)
+ .set_exclusive(exclusive)
+ .set_mtime(set_mtime)
+ .write_data(dpp, data, y);
+ }
return ret;
}
/// calls and error handling.
void rgw_complete_aio_completion(librados::AioCompletion* c, int r);
+/// This returns a static, non-NULL pointer, recognized only by
+/// rgw_put_system_obj(). When supplied instead of the attributes, the
+/// attributes will be unmodified.
+///
+// (Currently providing nullptr will wipe all attributes.)
+
+std::map<std::string, ceph::buffer::list>* no_change_attrs();
#endif
yield call(new RGWPutBucketInstanceInfoCR(
store->svc()->rados->get_async_processor(),
store, clean_info->first, false, {},
- nullptr, dpp));
+ no_change_attrs(), dpp));
// Raced, try again.
if (retcode == -ECANCELED) {