diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-06-17 17:41:41 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-06-17 17:41:41 -0700 |
commit | f5f8314841a717bc087bf266d05921cb6435d90e (patch) | |
tree | b10f5e57999863b79d061c5bac903a8697f97b99 | |
parent | 7f63baa68c2334d9e47f1393ff868a90979f0bc2 (diff) | |
download | ceph-f5f8314841a717bc087bf266d05921cb6435d90e.tar.gz |
rgw: object mtime the same for both object and bucket index
Make sure object mtime that's passed to bucket index is the
same as the one set on the object.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_rados.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 1b3db4b2cce..e65f8831c99 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2004,8 +2004,13 @@ int RGWRados::put_obj_meta_impl(void *ctx, rgw_obj& obj, uint64_t size, objv_tracker->prepare_op_for_write(&op); } - if (!set_mtime) - time(&set_mtime); + utime_t ut; + if (set_mtime) { + ut = utime_t(set_mtime, 0); + } else { + ut = ceph_clock_now(0); + set_mtime = ut.sec(); + } op.mtime(&set_mtime); @@ -2062,7 +2067,6 @@ int RGWRados::put_obj_meta_impl(void *ctx, rgw_obj& obj, uint64_t size, string index_tag; uint64_t epoch; int64_t poolid; - utime_t ut; if (state) { index_tag = state->write_tag; @@ -2088,7 +2092,6 @@ int RGWRados::put_obj_meta_impl(void *ctx, rgw_obj& obj, uint64_t size, ldout(cct, 0) << "ERROR: complete_atomic_overwrite returned r=" << r << dendl; } - ut = ceph_clock_now(cct); r = complete_update_index(bucket, obj.object, index_tag, poolid, epoch, size, ut, etag, content_type, &acl_bl, category, remove_objs); if (r < 0) |