int RGWRados::set_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* rctx, RGWBucketInfo& bucket_info, const rgw_obj& src_obj,
map<string, bufferlist>& attrs,
map<string, bufferlist>* rmattrs,
- optional_yield y)
+ optional_yield y,
+ ceph::real_time set_mtime /* = zero() */)
{
rgw_obj obj = src_obj;
if (obj.key.instance == "null") {
* set the metadata.
* Hence do not update mtime for any other attr changes */
real_time mtime = state->mtime;
+ if (set_mtime != ceph::real_clock::zero()) {
+ mtime = set_mtime;
+ }
struct timespec mtime_ts = real_clock::to_timespec(mtime);
op.mtime2(&mtime_ts);
auto& ioctx = ref.pool.ioctx();
if (iter != state->attrset.end()) {
iter->second = state->obj_tag;
}
+
+ state->mtime = mtime;
}
return 0;
int set_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* ctx, RGWBucketInfo& bucket_info, const rgw_obj& obj,
std::map<std::string, bufferlist>& attrs,
std::map<std::string, bufferlist>* rmattrs,
- optional_yield y);
+ optional_yield y,
+ ceph::real_time set_mtime = ceph::real_clock::zero());
int get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWObjState **state, RGWObjManifest** manifest,
bool follow_olh, optional_yield y, bool assume_noent = false);