]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: pass set_mtime to copy_obj_data()
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 12 Aug 2014 23:33:57 +0000 (16:33 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 14 Aug 2014 18:38:13 +0000 (11:38 -0700)
Sometimes we need to set the mtime when copying object data (e.g., when
we rewrite the obj).

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 19b2ca9fb6804f3edc89e6c6ccce19d09cf34895..8ad03916732cb3c6f0f4f6130d5434d1ca3b8516 100644 (file)
@@ -3131,7 +3131,7 @@ int RGWRados::rewrite_obj(const string& bucket_owner, rgw_obj& obj)
     return ret;
   }
 
-  return copy_obj_data((void *)&rctx, bucket_owner, &handle, end, obj, obj, max_chunk_size, &mtime, attrset, RGW_OBJ_CATEGORY_MAIN, NULL, NULL);
+  return copy_obj_data((void *)&rctx, bucket_owner, &handle, end, obj, obj, max_chunk_size, NULL, mtime, attrset, RGW_OBJ_CATEGORY_MAIN, NULL, NULL);
 }
 
 /**
@@ -3351,7 +3351,7 @@ set_err_state:
   }
 
   if (copy_data) { /* refcounting tail wouldn't work here, just copy the data */
-    return copy_obj_data(ctx, dest_bucket_info.owner, &handle, end, dest_obj, src_obj, max_chunk_size, mtime, src_attrs, category, ptag, err);
+    return copy_obj_data(ctx, dest_bucket_info.owner, &handle, end, dest_obj, src_obj, max_chunk_size, mtime, 0, src_attrs, category, ptag, err);
   }
 
   RGWObjManifest::obj_iterator miter = astate->manifest.obj_begin();
@@ -3463,6 +3463,7 @@ int RGWRados::copy_obj_data(void *ctx,
                rgw_obj& src_obj,
                uint64_t max_chunk_size,
               time_t *mtime,
+              time_t set_mtime,
                map<string, bufferlist>& attrs,
                RGWObjCategory category,
                string *ptag,
@@ -3514,10 +3515,7 @@ int RGWRados::copy_obj_data(void *ctx,
     etag = string(bl.c_str(), bl.length());
   }
 
-  ret = processor.complete(etag, NULL, 0, attrs);
-
-  if (mtime)
-    obj_stat(ctx, dest_obj, NULL, mtime, NULL, NULL, NULL, NULL);
+  ret = processor.complete(etag, mtime, set_mtime, attrs);
 
   return ret;
 }
index 2792352b8e80e88f3ce2aa870819a15a09abbe8d..410fd1a7012cf2048fcf6f1353c4e200884ebaa4 100644 (file)
@@ -1615,6 +1615,7 @@ public:
                rgw_obj& src_obj,
                uint64_t max_chunk_size,
               time_t *mtime,
+              time_t set_mtime,
                map<string, bufferlist>& attrs,
                RGWObjCategory category,
                string *ptag,