]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: s/RGWRados::ObjectCtx/RGWObjectCtx
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 9 Oct 2014 03:20:43 +0000 (20:20 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 19 Jan 2015 23:57:40 +0000 (15:57 -0800)
Can't forward declare nested class.

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

index 41ab5a3418e701940e555824575b39c708d65941..8b82f4aeab62d4106d983f6f9d5c037a1b25a860 100644 (file)
@@ -522,7 +522,7 @@ int bucket_stats(rgw_bucket& bucket, Formatter *formatter)
 {
   RGWBucketInfo bucket_info;
   time_t mtime;
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   int r = store->get_bucket_info(obj_ctx, bucket.name, bucket_info, &mtime);
   if (r < 0)
     return r;
@@ -565,7 +565,7 @@ public:
 static int init_bucket(string& bucket_name, RGWBucketInfo& bucket_info, rgw_bucket& bucket)
 {
   if (!bucket_name.empty()) {
-    RGWRados::ObjectCtx obj_ctx(store);
+    RGWObjectCtx obj_ctx(store);
     int r = store->get_bucket_info(obj_ctx, bucket_name, bucket_info, NULL);
     if (r < 0) {
       cerr << "could not get bucket info for bucket=" << bucket_name << std::endl;
@@ -716,7 +716,7 @@ int set_bucket_quota(RGWRados *store, int opt_cmd, string& bucket_name, int64_t
 {
   RGWBucketInfo bucket_info;
   map<string, bufferlist> attrs;
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   int r = store->get_bucket_info(obj_ctx, bucket_name, bucket_info, NULL, &attrs);
   if (r < 0) {
     cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl;
@@ -782,7 +782,7 @@ int check_min_obj_stripe_size(RGWRados *store, rgw_obj& obj, uint64_t min_stripe
   map<string, bufferlist> attrs;
   uint64_t obj_size;
 
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   RGWRados::Object op_target(store, obj_ctx, obj);
   RGWRados::Object::Read read_op(&op_target);
 
@@ -2134,7 +2134,7 @@ next:
 
     uint64_t obj_size;
     map<string, bufferlist> attrs;
-    RGWRados::ObjectCtx obj_ctx(store);
+    RGWObjectCtx obj_ctx(store);
     RGWRados::Object op_target(store, obj_ctx, obj);
     RGWRados::Object::Read read_op(&op_target);
 
index 35cf7847601279b79149eb6956550161b694599b..f50b68ce64808c22efd86a483e417d8ac69aca3c 100644 (file)
@@ -339,7 +339,7 @@ static bool bucket_object_check_filter(const string& name)
 
 int rgw_remove_object(RGWRados *store, const string& bucket_owner, rgw_bucket& bucket, rgw_obj_key& key, bool use_versioning)
 {
-  RGWRados::ObjectCtx rctx(store);
+  RGWObjectCtx rctx(store);
 
   rgw_obj obj(bucket, key);
 
@@ -802,7 +802,7 @@ int RGWBucket::get_policy(RGWBucketAdminOpState& op_state, ostream& o)
   if (!object_name.empty()) {
     bufferlist bl;
     rgw_obj obj(bucket, object_name);
-    RGWRados::ObjectCtx obj_ctx(store);
+    RGWObjectCtx obj_ctx(store);
     int ret = store->get_attr(obj_ctx, obj, RGW_ATTR_ACL, bl);
     if (ret < 0)
       return ret;
index 0ff4f5bb8ae8dfb49dbfbd0a728ff001c435a600..9ed0e636ec2db38ae262e11c553d0a1797a5e7bf 100644 (file)
@@ -524,7 +524,7 @@ static int process_request(RGWRados *store, RGWREST *rest, RGWRequest *req, RGWC
 
   struct req_state *s = &rstate;
 
-  RGWRados::ObjectCtx rados_ctx(store, s);
+  RGWObjectCtx rados_ctx(store, s);
   s->obj_ctx = &rados_ctx;
   store->set_intent_cb(s->obj_ctx, call_log_intent);
 
index c16830e50dd23a9fbf30d312e41f66153b209806..823c6e09eda0308c6ecc04a00f6fe9fa4ce9b5a5 100644 (file)
@@ -203,7 +203,7 @@ static int get_bucket_policy_from_attr(CephContext *cct, RGWRados *store, void *
   return 0;
 }
 
-static int get_obj_policy_from_attr(CephContext *cct, RGWRados *store, RGWRados::ObjectCtx& obj_ctx,
+static int get_obj_policy_from_attr(CephContext *cct, RGWRados *store, RGWObjectCtx& obj_ctx,
                                     RGWBucketInfo& bucket_info, map<string, bufferlist>& bucket_attrs,
                                     RGWAccessControlPolicy *policy, rgw_obj& obj)
 {
@@ -250,13 +250,13 @@ static int get_policy_from_attr(CephContext *cct, RGWRados *store, void *ctx,
     return get_bucket_policy_from_attr(cct, store, ctx, bucket_info, bucket_attrs,
                                        policy, instance_obj);
   }
-  return get_obj_policy_from_attr(cct, store, *(RGWRados::ObjectCtx *)ctx, bucket_info, bucket_attrs,
+  return get_obj_policy_from_attr(cct, store, *(RGWObjectCtx *)ctx, bucket_info, bucket_attrs,
                                   policy, obj);
 }
 
 static int get_obj_attrs(RGWRados *store, struct req_state *s, rgw_obj& obj, map<string, bufferlist>& attrs)
 {
-  RGWRados::Object op_target(store, *(RGWRados::ObjectCtx *)s->obj_ctx, obj);
+  RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, obj);
   RGWRados::Object::Read read_op(&op_target);
 
   read_op.params.attrs = &attrs;
@@ -268,7 +268,7 @@ static int get_obj_attrs(RGWRados *store, struct req_state *s, rgw_obj& obj, map
 static int get_system_obj_attrs(RGWRados *store, struct req_state *s, rgw_obj& obj, map<string, bufferlist>& attrs,
                          uint64_t *obj_size, RGWObjVersionTracker *objv_tracker)
 {
-  RGWRados::SystemObject src(store, *(RGWRados::ObjectCtx *)s->obj_ctx, obj);
+  RGWRados::SystemObject src(store, *(RGWObjectCtx *)s->obj_ctx, obj);
   RGWRados::SystemObject::Read rop(&src);
 
   rop.stat_params.attrs = &attrs;
@@ -335,7 +335,7 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu
   int ret = 0;
   rgw_obj_key obj;
   RGWUserInfo bucket_owner_info;
-  RGWRados::ObjectCtx& obj_ctx = *(RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx& obj_ctx = *(RGWObjectCtx *)s->obj_ctx;
 
   s->bucket_instance_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "bucket-instance");
 
@@ -645,7 +645,7 @@ int RGWGetObj::read_user_manifest_part(rgw_bucket& bucket, RGWObjEnt& ent, RGWAc
   map<string, bufferlist> attrs;
 
   uint64_t obj_size;
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   RGWAccessControlPolicy obj_policy(s->cct);
 
   ldout(s->cct, 20) << "reading obj=" << part << " ofs=" << cur_ofs << " end=" << cur_end << dendl;
@@ -796,7 +796,7 @@ int RGWGetObj::handle_user_manifest(const char *prefix)
   if (bucket_name.compare(s->bucket.name) != 0) {
     RGWBucketInfo bucket_info;
     map<string, bufferlist> bucket_attrs;
-    RGWRados::ObjectCtx obj_ctx(store);
+    RGWObjectCtx obj_ctx(store);
     int r = store->get_bucket_info(obj_ctx, bucket_name, bucket_info, NULL, &bucket_attrs);
     if (r < 0) {
       ldout(s->cct, 0) << "could not get bucket info for bucket=" << bucket_name << dendl;
@@ -875,7 +875,7 @@ void RGWGetObj::execute()
   perfcounter->inc(l_rgw_get);
   int64_t new_ofs, new_end;
 
-  RGWRados::Object op_target(store, *(RGWRados::ObjectCtx *)s->obj_ctx, obj);
+  RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, obj);
   RGWRados::Object::Read read_op(&op_target);
 
   ret = get_params();
@@ -1282,7 +1282,7 @@ void RGWCreateBucket::execute()
   }
 
   /* we need to make sure we read bucket info, it's not read before for this specific request */
-  RGWRados::ObjectCtx& obj_ctx = *(RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx& obj_ctx = *(RGWObjectCtx *)s->obj_ctx;
   ret = store->get_bucket_info(obj_ctx, s->bucket_name_str, s->bucket_info, NULL, &s->bucket_attrs);
   if (ret < 0 && ret != -ENOENT)
     return;
@@ -1481,7 +1481,7 @@ protected:
 
 public:
   bool immutable_head() { return true; }
-  RGWPutObjProcessor_Multipart(RGWRados::ObjectCtx& obj_ctx, const string& bucket_owner, uint64_t _p, req_state *_s) :
+  RGWPutObjProcessor_Multipart(RGWObjectCtx& obj_ctx, const string& bucket_owner, uint64_t _p, req_state *_s) :
                    RGWPutObjProcessor_Atomic(obj_ctx, bucket_owner, _s->bucket, _s->object.name, _p, _s->req_id, false), s(_s) {}
 };
 
@@ -1601,7 +1601,7 @@ int RGWPutObjProcessor_Multipart::do_complete(string& etag, time_t *mtime, time_
 }
 
 
-RGWPutObjProcessor *RGWPutObj::select_processor(RGWRados::ObjectCtx& obj_ctx, bool *is_multipart)
+RGWPutObjProcessor *RGWPutObj::select_processor(RGWObjectCtx& obj_ctx, bool *is_multipart)
 {
   RGWPutObjProcessor *processor;
 
@@ -1714,7 +1714,7 @@ void RGWPutObj::execute()
     supplied_md5[sizeof(supplied_md5) - 1] = '\0';
   }
 
-  processor = select_processor(*(RGWRados::ObjectCtx *)s->obj_ctx, &multipart);
+  processor = select_processor(*(RGWObjectCtx *)s->obj_ctx, &multipart);
 
   ret = processor->prepare(store, NULL);
   if (ret < 0)
@@ -1747,7 +1747,7 @@ void RGWPutObj::execute()
       /* restart processing with different oid suffix */
 
       dispose_processor(processor);
-      processor = select_processor(*(RGWRados::ObjectCtx *)s->obj_ctx, &multipart);
+      processor = select_processor(*(RGWObjectCtx *)s->obj_ctx, &multipart);
 
       string oid_rand;
       char buf[33];
@@ -1853,7 +1853,7 @@ int RGWPostObj::verify_permission()
   return 0;
 }
 
-RGWPutObjProcessor *RGWPostObj::select_processor(RGWRados::ObjectCtx& obj_ctx)
+RGWPutObjProcessor *RGWPostObj::select_processor(RGWObjectCtx& obj_ctx)
 {
   RGWPutObjProcessor *processor;
 
@@ -1897,7 +1897,7 @@ void RGWPostObj::execute()
     goto done;
   }
 
-  processor = select_processor(*(RGWRados::ObjectCtx *)s->obj_ctx);
+  processor = select_processor(*(RGWObjectCtx *)s->obj_ctx);
 
   ret = processor->prepare(store, NULL);
   if (ret < 0)
@@ -2098,7 +2098,7 @@ void RGWDeleteObj::execute()
   ret = -EINVAL;
   rgw_obj obj(s->bucket, s->object);
   if (!s->object.empty()) {
-    RGWRados::ObjectCtx *obj_ctx = (RGWRados::ObjectCtx *)s->obj_ctx;
+    RGWObjectCtx *obj_ctx = (RGWObjectCtx *)s->obj_ctx;
 
     obj_ctx->set_atomic(obj);
 
@@ -2142,7 +2142,7 @@ int RGWCopyObj::verify_permission()
 
   map<string, bufferlist> src_attrs;
 
-  RGWRados::ObjectCtx& obj_ctx = *(RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx& obj_ctx = *(RGWObjectCtx *)s->obj_ctx;
 
   ret = store->get_bucket_info(obj_ctx, src_bucket_name, src_bucket_info, NULL, &src_attrs);
   if (ret < 0)
@@ -2266,7 +2266,7 @@ void RGWCopyObj::execute()
   rgw_obj src_obj(src_bucket, src_object);
   rgw_obj dst_obj(dest_bucket, dest_object);
 
-  RGWRados::ObjectCtx& obj_ctx = *(RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx& obj_ctx = *(RGWObjectCtx *)s->obj_ctx;
   obj_ctx.set_atomic(src_obj);
   obj_ctx.set_atomic(dst_obj);
 
@@ -2635,7 +2635,7 @@ void RGWInitMultipart::execute()
     // the meta object will be indexed with 0 size, we c
     obj.set_in_extra_data(true);
 
-    RGWRados::Object op_target(store, *(RGWRados::ObjectCtx *)s->obj_ctx, obj);
+    RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, obj);
     RGWRados::Object::Write obj_op(&op_target);
 
     obj_op.meta.owner = s->owner.get_id();
@@ -2937,11 +2937,11 @@ void RGWCompleteMultipart::execute()
     store->gen_rand_obj_instance_name(&target_obj);
   }
 
-  RGWRados::ObjectCtx& obj_ctx = *(RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx& obj_ctx = *(RGWObjectCtx *)s->obj_ctx;
 
   obj_ctx.set_atomic(target_obj);
 
-  RGWRados::Object op_target(store, *(RGWRados::ObjectCtx *)s->obj_ctx, target_obj);
+  RGWRados::Object op_target(store, *(RGWObjectCtx *)s->obj_ctx, target_obj);
   RGWRados::Object::Write obj_op(&op_target);
 
   obj_op.meta.manifest = &manifest;
@@ -2963,7 +2963,7 @@ void RGWCompleteMultipart::execute()
   }
 
   // remove the upload obj
-  int r = store->delete_obj(*(RGWRados::ObjectCtx *)s->obj_ctx, s->bucket_owner.get_id(), meta_obj, false);
+  int r = store->delete_obj(*(RGWObjectCtx *)s->obj_ctx, s->bucket_owner.get_id(), meta_obj, false);
   if (r < 0) {
     ldout(store->ctx(), 0) << "WARNING: failed to remove object " << meta_obj << dendl;
   }
@@ -3009,7 +3009,7 @@ void RGWAbortMultipart::execute()
   int marker = 0;
   int max_parts = 1000;
 
-  RGWRados::ObjectCtx *obj_ctx = (RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx *obj_ctx = (RGWObjectCtx *)s->obj_ctx;
 
   do {
     ret = list_multipart_parts(store, s, upload_id, meta_oid, max_parts, marker, obj_parts, &marker, &truncated);
@@ -3152,7 +3152,7 @@ void RGWDeleteMultiObj::execute()
   RGWMultiDelXMLParser parser;
   pair<string,int> result;
   int num_processed = 0;
-  RGWRados::ObjectCtx *obj_ctx = (RGWRados::ObjectCtx *)s->obj_ctx;
+  RGWObjectCtx *obj_ctx = (RGWObjectCtx *)s->obj_ctx;
 
   ret = get_params();
   if (ret < 0) {
index cf3aaeee14b4a57288713e38454af3b2434e8507..7b8ccd7fa93c91bd204decb5849c9b464bcbe37e 100644 (file)
@@ -432,7 +432,7 @@ public:
     policy.set_ctx(s->cct);
   }
 
-  RGWPutObjProcessor *select_processor(RGWRados::ObjectCtx& obj_ctx, bool *is_multipart);
+  RGWPutObjProcessor *select_processor(RGWObjectCtx& obj_ctx, bool *is_multipart);
   void dispose_processor(RGWPutObjProcessor *processor);
 
   int verify_permission();
@@ -480,7 +480,7 @@ public:
   void pre_exec();
   void execute();
 
-  RGWPutObjProcessor *select_processor(RGWRados::ObjectCtx& obj_ctx);
+  RGWPutObjProcessor *select_processor(RGWObjectCtx& obj_ctx);
   void dispose_processor(RGWPutObjProcessor *processor);
 
   virtual int get_params() = 0;
index 9e19cede26670f318c5576884e95ca2a3467d81f..dec7733451958d66adae8de8d39eb567a07f5a9c 100644 (file)
@@ -116,7 +116,7 @@ int RGWRegion::read_default(RGWDefaultRegionInfo& default_info)
 
   rgw_bucket pool(pool_name.c_str());
   bufferlist bl;
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
   if (ret < 0)
     return ret;
@@ -215,7 +215,7 @@ int RGWRegion::read_info(const string& region_name)
 
   string oid = region_info_oid_prefix + name;
 
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
   if (ret < 0) {
     lderr(cct) << "failed reading region info from " << pool << ":" << oid << ": " << cpp_strerror(-ret) << dendl;
@@ -359,7 +359,7 @@ int RGWZoneParams::init(CephContext *cct, RGWRados *store, RGWRegion& region)
   bufferlist bl;
 
   string oid = zone_info_oid_prefix + name;
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
   if (ret < 0)
     return ret;
@@ -447,7 +447,7 @@ int RGWRegionMap::read(CephContext *cct, RGWRados *store)
   rgw_bucket pool(pool_name.c_str());
 
   bufferlist bl;
-  RGWRados::ObjectCtx obj_ctx(store);
+  RGWObjectCtx obj_ctx(store);
   int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
   if (ret < 0)
     return ret;
@@ -1218,7 +1218,7 @@ public:
   }
 };
 
-RGWObjState *RGWRados::ObjectCtx::get_state(rgw_obj& obj) {
+RGWObjState *RGWObjectCtx::get_state(rgw_obj& obj) {
   if (!obj.get_object().empty()) {
     return &objs_state[obj];
   } else {
@@ -1227,12 +1227,12 @@ RGWObjState *RGWRados::ObjectCtx::get_state(rgw_obj& obj) {
   }
 }
 
-void RGWRados::ObjectCtx::invalidate(rgw_obj& obj)
+void RGWObjectCtx::invalidate(rgw_obj& obj)
 {
   objs_state.erase(obj);
 }
 
-void RGWRados::ObjectCtx::set_atomic(rgw_obj& obj) {
+void RGWObjectCtx::set_atomic(rgw_obj& obj) {
   if (!obj.get_object().empty()) {
     objs_state[obj].is_atomic = true;
   } else {
@@ -1241,7 +1241,7 @@ void RGWRados::ObjectCtx::set_atomic(rgw_obj& obj) {
   }
 }
 
-void RGWRados::ObjectCtx::set_prefetch_data(rgw_obj& obj) {
+void RGWObjectCtx::set_prefetch_data(rgw_obj& obj) {
   if (!obj.get_object().empty()) {
     objs_state[obj].prefetch_data = true;
   } else {
@@ -2451,7 +2451,7 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
     if (ret == -EEXIST) {
        /* we need to reread the info and return it, caller will have a use for it */
       info.objv_tracker.clear();
-      ObjectCtx obj_ctx(this);
+      RGWObjectCtx obj_ctx(this);
       r = get_bucket_info(obj_ctx, bucket.name, info, NULL, NULL);
       if (r < 0) {
         if (r == -ENOENT) {
@@ -2595,7 +2595,7 @@ int RGWRados::select_legacy_bucket_placement(const string& bucket_name, rgw_buck
 
   rgw_obj obj(zone.domain_root, avail_pools);
 
-  RGWRados::ObjectCtx obj_ctx(this);
+  RGWObjectCtx obj_ctx(this);
   int ret = rgw_get_system_obj(this, obj_ctx, zone.domain_root, avail_pools, map_bl, NULL, NULL);
   if (ret < 0) {
     goto read_omap;
@@ -3213,7 +3213,7 @@ int RGWRados::rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw_obj& obj)
   time_t mtime;
   uint64_t total_len;
   uint64_t obj_size;
-  ObjectCtx rctx(this);
+  RGWObjectCtx rctx(this);
 
   RGWRados::Object op_target(this, rctx, obj);
   RGWRados::Object::Read read_op(&op_target);
@@ -3248,7 +3248,7 @@ int RGWRados::rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw_obj& obj)
  * err: stores any errors resulting from the get of the original object
  * Returns: 0 on success, -ERR# otherwise.
  */
-int RGWRados::copy_obj(ObjectCtx& obj_ctx,
+int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
                const string& user_id,
                const string& client_id,
                const string& op_id,
@@ -3590,7 +3590,7 @@ done_ret:
 }
 
 
-int RGWRados::copy_obj_data(ObjectCtx& obj_ctx,
+int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx,
                RGWBucketInfo& dest_bucket_info,
               RGWRados::Object::Read& read_op, off_t end,
                rgw_obj& dest_obj,
@@ -3705,7 +3705,7 @@ int RGWRados::set_bucket_owner(rgw_bucket& bucket, ACLOwner& owner)
 {
   RGWBucketInfo info;
   map<string, bufferlist> attrs;
-  ObjectCtx obj_ctx(this);
+  RGWObjectCtx obj_ctx(this);
   int r = get_bucket_info(obj_ctx, bucket.name, info, NULL, &attrs);
   if (r < 0) {
     ldout(cct, 0) << "NOTICE: get_bucket_info on bucket=" << bucket.name << " returned err=" << r << dendl;
@@ -3739,7 +3739,7 @@ int RGWRados::set_buckets_enabled(vector<rgw_bucket>& buckets, bool enabled)
 
     RGWBucketInfo info;
     map<string, bufferlist> attrs;
-    ObjectCtx obj_ctx(this);
+    RGWObjectCtx obj_ctx(this);
     int r = get_bucket_info(obj_ctx, bucket.name, info, NULL, &attrs);
     if (r < 0) {
       ldout(cct, 0) << "NOTICE: get_bucket_info on bucket=" << bucket.name << " returned err=" << r << ", skipping bucket" << dendl;
@@ -3765,7 +3765,7 @@ int RGWRados::set_buckets_enabled(vector<rgw_bucket>& buckets, bool enabled)
 int RGWRados::bucket_suspended(rgw_bucket& bucket, bool *suspended)
 {
   RGWBucketInfo bucket_info;
-  ObjectCtx obj_ctx(this);
+  RGWObjectCtx obj_ctx(this);
   int ret = get_bucket_info(obj_ctx, bucket.name, bucket_info, NULL);
   if (ret < 0) {
     return ret;
@@ -3872,7 +3872,7 @@ int RGWRados::bucket_rebuild_index(rgw_bucket& bucket)
 
 int RGWRados::defer_gc(void *ctx, rgw_obj& obj)
 {
-  ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+  RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
   rgw_bucket bucket;
   std::string oid, key;
   get_obj_bucket_and_oid_loc(obj, bucket, oid, key);
@@ -4000,7 +4000,7 @@ int RGWRados::Object::Delete::delete_obj()
   return 0;
 }
 
-int RGWRados::delete_obj(RGWRados::ObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& obj, bool use_versioning)
+int RGWRados::delete_obj(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& obj, bool use_versioning)
 {
   RGWRados::Object del_target(this, obj_ctx, obj);
   RGWRados::Object::Delete del_op(&del_target);
@@ -4087,7 +4087,7 @@ static bool is_olh(map<string, bufferlist>& attrs)
   return (iter != attrs.end());
 }
 
-int RGWRados::get_olh_target_state(ObjectCtx& obj_ctx, rgw_obj& obj, RGWObjState *olh_state,
+int RGWRados::get_olh_target_state(RGWObjectCtx& obj_ctx, rgw_obj& obj, RGWObjState *olh_state,
                                    RGWObjState **target_state, RGWObjVersionTracker *objv_tracker)
 {
   assert(olh_state->is_olh);
@@ -4105,7 +4105,7 @@ int RGWRados::get_olh_target_state(ObjectCtx& obj_ctx, rgw_obj& obj, RGWObjState
   return 0;
 }
 
-int RGWRados::get_obj_state_impl(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh)
+int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh)
 #warning FIXME: get rid objv_tracker for non system objects
 {
   RGWObjState *s = rctx->get_state(obj);
@@ -4186,7 +4186,7 @@ int RGWRados::get_obj_state_impl(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **st
   return 0;
 }
 
-int RGWRados::get_obj_state(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh)
+int RGWRados::get_obj_state(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh)
 {
   int ret;
 
@@ -4205,7 +4205,7 @@ int RGWRados::get_obj_state(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **state,
  * dest: bufferlist to store the result in
  * Returns: 0 on success, -ERR# otherwise.
  */
-int RGWRados::get_attr(ObjectCtx& obj_ctx, rgw_obj& obj, const char *name, bufferlist& dest)
+int RGWRados::get_attr(RGWObjectCtx& obj_ctx, rgw_obj& obj, const char *name, bufferlist& dest)
 {
   rgw_rados_ref ref;
   rgw_bucket bucket;
@@ -4236,7 +4236,7 @@ int RGWRados::get_attr(ObjectCtx& obj_ctx, rgw_obj& obj, const char *name, buffe
   return 0;
 }
 
-int RGWRados::append_atomic_test(ObjectCtx *rctx, rgw_obj& obj,
+int RGWRados::append_atomic_test(RGWObjectCtx *rctx, rgw_obj& obj,
                             ObjectOperation& op, RGWObjState **pstate)
 {
   if (!rctx)
@@ -4378,7 +4378,7 @@ int RGWRados::set_attrs(void *ctx, rgw_obj& obj,
   if (r < 0) {
     return r;
   }
-  ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+  RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
 
   ObjectWriteOperation op;
   RGWObjState *state = NULL;
@@ -4600,7 +4600,7 @@ int RGWRados::SystemObject::get_state(RGWObjState **pstate, RGWObjVersionTracker
   return store->get_obj_state(&ctx, obj, pstate, objv_tracker, false);
 }
 
-int RGWRados::stat_system_obj(RGWRados::ObjectCtx& obj_ctx,
+int RGWRados::stat_system_obj(RGWObjectCtx& obj_ctx,
                               RGWRados::SystemObject::Read::GetObjState& state,
                               rgw_obj& obj,
                               map<string, bufferlist> *attrs,
@@ -4822,7 +4822,7 @@ int RGWRados::SystemObject::Read::GetObjState::get_ioctx(RGWRados *store, rgw_ob
 
 }
 
-int RGWRados::get_system_obj(ObjectCtx& obj_ctx, RGWRados::SystemObject::Read::GetObjState& read_state,
+int RGWRados::get_system_obj(RGWObjectCtx& obj_ctx, RGWRados::SystemObject::Read::GetObjState& read_state,
                              RGWObjVersionTracker *objv_tracker, rgw_obj& obj,
                              bufferlist& bl, off_t ofs, off_t end,
                              rgw_cache_entry_info *cache_info)
@@ -5158,7 +5158,7 @@ int RGWRados::get_obj_iterate_cb(void *ctx, RGWObjState *astate,
                          off_t read_ofs, off_t len,
                          bool is_head_obj, void *arg)
 {
-  ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+  RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
   ObjectReadOperation op;
   struct get_obj_data *d = (struct get_obj_data *)arg;
   string oid, key;
@@ -5281,13 +5281,13 @@ int RGWRados::iterate_obj(void *ctx, rgw_obj& obj,
   rgw_obj read_obj = obj;
   uint64_t read_ofs = ofs;
   uint64_t len;
-  ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
-  ObjectCtx *new_ctx = NULL;
+  RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
+  RGWObjectCtx *new_ctx = NULL;
   bool reading_from_head = true;
   RGWObjState *astate = NULL;
 
   if (!rctx) {
-    new_ctx = new ObjectCtx(this);
+    new_ctx = new RGWObjectCtx(this);
     rctx = new_ctx;
   }
 
@@ -5357,7 +5357,7 @@ int RGWRados::read(void *ctx, rgw_obj& obj, off_t ofs, size_t size, bufferlist&
   if (r < 0) {
     return r;
   }
-  ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+  RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
   RGWObjState *astate = NULL;
 
   ObjectReadOperation op;
@@ -5563,7 +5563,7 @@ static void op_setxattr(librados::ObjectWriteOperation& op, const char *name, co
   op.setxattr(name, bl);
 }
 
-int RGWRados::apply_olh_log(ObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& obj,
+int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& obj,
                             bufferlist& obj_tag, map<uint64_t, rgw_bucket_olh_log_entry>& log,
                             uint64_t *plast_ver)
 {
@@ -5655,7 +5655,7 @@ int RGWRados::apply_olh_log(ObjectCtx& obj_ctx, const string& bucket_owner, rgw_
 /*
  * read olh log and apply it
  */
-int RGWRados::update_olh(ObjectCtx& obj_ctx, RGWObjState *state, const string& bucket_owner, rgw_obj& obj)
+int RGWRados::update_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, const string& bucket_owner, rgw_obj& obj)
 {
   map<uint64_t, rgw_bucket_olh_log_entry> log;
   bool is_truncated;
@@ -5675,7 +5675,7 @@ int RGWRados::update_olh(ObjectCtx& obj_ctx, RGWObjState *state, const string& b
   return 0;
 }
 
-int RGWRados::set_olh(ObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj, bool delete_marker)
+int RGWRados::set_olh(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj, bool delete_marker)
 {
   string op_tag;
   string obj_tag;
@@ -5774,7 +5774,7 @@ int RGWRados::get_olh(rgw_obj& obj, RGWOLHInfo *olh)
   return 0;
 }
 
-int RGWRados::follow_olh(ObjectCtx& obj_ctx, RGWObjState *state, rgw_obj& olh_obj, rgw_obj *target)
+int RGWRados::follow_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, rgw_obj& olh_obj, rgw_obj *target)
 {
   map<string, bufferlist> pending_entries;
   filter_attrset(state->attrset, RGW_ATTR_OLH_PENDING_PREFIX, &pending_entries);
@@ -5985,7 +5985,7 @@ void RGWRados::get_bucket_instance_obj(rgw_bucket& bucket, rgw_obj& obj)
   }
 }
 
-int RGWRados::get_bucket_instance_info(ObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info,
+int RGWRados::get_bucket_instance_info(RGWObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info,
                                        time_t *pmtime, map<string, bufferlist> *pattrs)
 {
   int pos = meta_key.find(':');
@@ -5997,7 +5997,7 @@ int RGWRados::get_bucket_instance_info(ObjectCtx& obj_ctx, const string& meta_ke
   return get_bucket_instance_from_oid(obj_ctx, oid, info, pmtime, pattrs);
 }
 
-int RGWRados::get_bucket_instance_info(ObjectCtx& obj_ctx, rgw_bucket& bucket, RGWBucketInfo& info,
+int RGWRados::get_bucket_instance_info(RGWObjectCtx& obj_ctx, rgw_bucket& bucket, RGWBucketInfo& info,
                                        time_t *pmtime, map<string, bufferlist> *pattrs)
 {
   string oid;
@@ -6010,7 +6010,7 @@ int RGWRados::get_bucket_instance_info(ObjectCtx& obj_ctx, rgw_bucket& bucket, R
   return get_bucket_instance_from_oid(obj_ctx, oid, info, pmtime, pattrs);
 }
 
-int RGWRados::get_bucket_instance_from_oid(ObjectCtx& obj_ctx, string& oid, RGWBucketInfo& info,
+int RGWRados::get_bucket_instance_from_oid(RGWObjectCtx& obj_ctx, string& oid, RGWBucketInfo& info,
                                            time_t *pmtime, map<string, bufferlist> *pattrs,
                                            rgw_cache_entry_info *cache_info)
 {
@@ -6034,7 +6034,7 @@ int RGWRados::get_bucket_instance_from_oid(ObjectCtx& obj_ctx, string& oid, RGWB
   return 0;
 }
 
-int RGWRados::get_bucket_entrypoint_info(ObjectCtx& obj_ctx, const string& bucket_name,
+int RGWRados::get_bucket_entrypoint_info(RGWObjectCtx& obj_ctx, const string& bucket_name,
                                          RGWBucketEntryPoint& entry_point,
                                          RGWObjVersionTracker *objv_tracker,
                                          time_t *pmtime,
@@ -6058,7 +6058,7 @@ int RGWRados::get_bucket_entrypoint_info(ObjectCtx& obj_ctx, const string& bucke
   return 0;
 }
 
-int RGWRados::convert_old_bucket_info(ObjectCtx& obj_ctx, string& bucket_name)
+int RGWRados::convert_old_bucket_info(RGWObjectCtx& obj_ctx, string& bucket_name)
 {
   RGWBucketEntryPoint entry_point;
   time_t ep_mtime;
@@ -6101,7 +6101,7 @@ struct bucket_info_entry {
 
 static RGWChainedCacheImpl<bucket_info_entry> binfo_cache;
 
-int RGWRados::get_bucket_info(ObjectCtx& obj_ctx, const string& bucket_name, RGWBucketInfo& info,
+int RGWRados::get_bucket_info(RGWObjectCtx& obj_ctx, const string& bucket_name, RGWBucketInfo& info,
                               time_t *pmtime, map<string, bufferlist> *pattrs)
 {
   bucket_info_entry e;
@@ -6822,7 +6822,7 @@ int RGWRados::check_disk_state(librados::IoCtx io_ctx,
   io_ctx.locator_set_key(loc);
 
   RGWObjState *astate = NULL;
-  ObjectCtx rctx(this);
+  RGWObjectCtx rctx(this);
   int r = get_obj_state(&rctx, obj, &astate, NULL);
   if (r < 0)
     return r;
@@ -7258,7 +7258,7 @@ int RGWRados::process_intent_log(rgw_bucket& bucket, string& oid,
     }
     
     struct rgw_intent_log_entry entry;
-    RGWRados::ObjectCtx obj_ctx(this);
+    RGWObjectCtx obj_ctx(this);
     try {
       ::decode(entry, iter);
     } catch (buffer::error& err) {
index 5973bb924bf7622eafd6b5fbbc68069b7b916d58..b90b167ffeaf8a40866b0e4e40c38439660a8bb5 100644 (file)
@@ -1108,41 +1108,39 @@ public:
 };
 
 
-class RGWRados
-{
-  friend class RGWGC;
-  friend class RGWStateLog;
-  friend class RGWReplicaLogger;
+struct RGWObjectCtx {
+  RGWRados *store;
+  map<rgw_obj, RGWObjState> objs_state;
+  int (*intent_cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent);
+  void *user_ctx;
 
-public:
-  struct ObjectCtx {
-    RGWRados *store;
-    map<rgw_obj, RGWObjState> objs_state;
-    int (*intent_cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent);
-    void *user_ctx;
+  RGWObjectCtx(RGWRados *_store) : store(_store), intent_cb(NULL), user_ctx(NULL) { }
+  RGWObjectCtx(RGWRados *_store, void *_user_ctx) : store(_store), intent_cb(NULL), user_ctx(_user_ctx) { }
 
-    ObjectCtx(RGWRados *_store) : store(_store), intent_cb(NULL), user_ctx(NULL) { }
-    ObjectCtx(RGWRados *_store, void *_user_ctx) : store(_store), intent_cb(NULL), user_ctx(_user_ctx) { }
+  RGWObjState *get_state(rgw_obj& obj);
+  void set_atomic(rgw_obj& obj);
+  void set_prefetch_data(rgw_obj& obj);
 
-    RGWObjState *get_state(rgw_obj& obj);
-    void set_atomic(rgw_obj& obj);
-    void set_prefetch_data(rgw_obj& obj);
+  void set_intent_cb(int (*cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent)) {
+    intent_cb = cb;
+  }
 
-    void set_intent_cb(int (*cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent)) {
-      intent_cb = cb;
+  int notify_intent(RGWRados *store, rgw_obj& obj, RGWIntentEvent intent) {
+    if (intent_cb) {
+      return intent_cb(store, user_ctx, obj, intent);
     }
+    return 0;
+  }
 
-    int notify_intent(RGWRados *store, rgw_obj& obj, RGWIntentEvent intent) {
-      if (intent_cb) {
-        return intent_cb(store, user_ctx, obj, intent);
-      }
-      return 0;
-    }
+  void invalidate(rgw_obj& obj);
+};
 
-    void invalidate(rgw_obj& obj);
-  };
+class RGWRados
+{
+  friend class RGWGC;
+  friend class RGWStateLog;
+  friend class RGWReplicaLogger;
 
-private:
   /** Open the pool used as root for this gateway */
   int open_root_pool_ctx();
   int open_gc_pool_ctx();
@@ -1182,10 +1180,10 @@ private:
   int get_obj_ref(const rgw_obj& obj, rgw_rados_ref *ref, rgw_bucket *bucket, bool ref_system_obj = false);
   uint64_t max_bucket_id;
 
-  int get_olh_target_state(ObjectCtx& rctx, rgw_obj& obj, RGWObjState *olh_state,
+  int get_olh_target_state(RGWObjectCtx& rctx, rgw_obj& obj, RGWObjState *olh_state,
                            RGWObjState **target_state, RGWObjVersionTracker *objv_tracker);
-  int get_obj_state_impl(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh);
-  int append_atomic_test(ObjectCtx *rctx, rgw_obj& obj,
+  int get_obj_state_impl(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh);
+  int append_atomic_test(RGWObjectCtx *rctx, rgw_obj& obj,
                          librados::ObjectOperation& op, RGWObjState **state);
 
   int update_placement_map();
@@ -1348,7 +1346,7 @@ public:
 
   class SystemObject {
     RGWRados *store;
-    RGWRados::ObjectCtx& ctx;
+    RGWObjectCtx& ctx;
     rgw_obj obj;
 
     RGWObjState *state;
@@ -1357,11 +1355,11 @@ public:
     int get_state(RGWObjState **pstate, RGWObjVersionTracker *objv_tracker);
 
   public:
-    SystemObject(RGWRados *_store, RGWRados::ObjectCtx& _ctx, rgw_obj& _obj) : store(_store), ctx(_ctx), obj(_obj), state(NULL) {}
+    SystemObject(RGWRados *_store, RGWObjectCtx& _ctx, rgw_obj& _obj) : store(_store), ctx(_ctx), obj(_obj), state(NULL) {}
 
     RGWRados *get_store() { return store; }
     rgw_obj& get_obj() { return obj; }
-    RGWRados::ObjectCtx& get_ctx() { return ctx; }
+    RGWObjectCtx& get_ctx() { return ctx; }
 
     struct Read {
       RGWRados::SystemObject *source;
@@ -1398,7 +1396,7 @@ public:
 
   class Object {
     RGWRados *store;
-    RGWRados::ObjectCtx& ctx;
+    RGWObjectCtx& ctx;
     rgw_obj obj;
 
     RGWObjState *state;
@@ -1411,11 +1409,11 @@ public:
     int complete_atomic_modification();
 
   public:
-    Object(RGWRados *_store, RGWRados::ObjectCtx& _ctx, rgw_obj& _obj) : store(_store), ctx(_ctx), obj(_obj), state(NULL) {}
+    Object(RGWRados *_store, RGWObjectCtx& _ctx, rgw_obj& _obj) : store(_store), ctx(_ctx), obj(_obj), state(NULL) {}
 
     RGWRados *get_store() { return store; }
     rgw_obj& get_obj() { return obj; }
-    RGWRados::ObjectCtx& get_ctx() { return ctx; }
+    RGWObjectCtx& get_ctx() { return ctx; }
 
     struct Read {
       RGWRados::Object *source;
@@ -1561,7 +1559,7 @@ public:
    * err: stores any errors resulting from the get of the original object
    * Returns: 0 on success, -ERR# otherwise.
    */
-  virtual int copy_obj(ObjectCtx& obj_ctx,
+  virtual int copy_obj(RGWObjectCtx& obj_ctx,
                const string& user_id,
                const string& client_id,
                const string& op_id,
@@ -1585,7 +1583,7 @@ public:
                void (*progress_cb)(off_t, void *),
                void *progress_data);
 
-  int copy_obj_data(ObjectCtx& obj_ctx,
+  int copy_obj_data(RGWObjectCtx& obj_ctx,
                RGWBucketInfo& dest_bucket_info,
               RGWRados::Object::Read& read_op, off_t end,
                rgw_obj& dest_obj,
@@ -1611,7 +1609,7 @@ public:
   int bucket_suspended(rgw_bucket& bucket, bool *suspended);
 
   /** Delete an object.*/
-  virtual int delete_obj(RGWRados::ObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& src_obj, bool use_versioning);
+  virtual int delete_obj(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& src_obj, bool use_versioning);
 
   /* Delete a system object */
   virtual int delete_system_obj(rgw_obj& src_obj, RGWObjVersionTracker *objv_tracker = NULL);
@@ -1627,7 +1625,7 @@ public:
    * dest: bufferlist to store the result in
    * Returns: 0 on success, -ERR# otherwise.
    */
-  virtual int get_attr(RGWRados::ObjectCtx& obj_ctx, rgw_obj& obj, const char *name, bufferlist& dest);
+  virtual int get_attr(RGWObjectCtx& obj_ctx, rgw_obj& obj, const char *name, bufferlist& dest);
 
   /**
    * Set an attr on an object.
@@ -1645,12 +1643,12 @@ public:
                         map<string, bufferlist>* rmattrs,
                         RGWObjVersionTracker *objv_tracker);
 
-  int get_obj_state(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh);
-  int get_obj_state(ObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker) {
+  int get_obj_state(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker, bool follow_olh);
+  int get_obj_state(RGWObjectCtx *rctx, rgw_obj& obj, RGWObjState **state, RGWObjVersionTracker *objv_tracker) {
     return get_obj_state(rctx, obj, state, objv_tracker, true);
   }
 
-  virtual int stat_system_obj(RGWRados::ObjectCtx& obj_ctx,
+  virtual int stat_system_obj(RGWObjectCtx& obj_ctx,
                               RGWRados::SystemObject::Read::GetObjState& state,
                               rgw_obj& obj,
                               map<string, bufferlist> *attrs,
@@ -1658,7 +1656,7 @@ public:
                               uint64_t *obj_size,
                               RGWObjVersionTracker *objv_tracker);
 
-  virtual int get_system_obj(ObjectCtx& obj_ctx, RGWRados::SystemObject::Read::GetObjState& read_state,
+  virtual int get_system_obj(RGWObjectCtx& obj_ctx, RGWRados::SystemObject::Read::GetObjState& read_state,
                              RGWObjVersionTracker *objv_tracker, rgw_obj& obj,
                              bufferlist& bl, off_t ofs, off_t end,
                              rgw_cache_entry_info *cache_info);
@@ -1702,13 +1700,13 @@ public:
   int bucket_index_read_olh_log(RGWObjState *state, rgw_obj& obj_instance, uint64_t ver_marker,
                                 map<uint64_t, rgw_bucket_olh_log_entry> *log, bool *is_truncated);
   int bucket_index_trim_olh_log(rgw_obj& obj_instance, uint64_t ver);
-  int apply_olh_log(ObjectCtx& ctx, const string& bucket_owner, rgw_obj& obj,
+  int apply_olh_log(RGWObjectCtx& ctx, const string& bucket_owner, rgw_obj& obj,
                     bufferlist& obj_tag, map<uint64_t, rgw_bucket_olh_log_entry>& log,
                     uint64_t *plast_ver);
-  int update_olh(ObjectCtx& obj_ctx, RGWObjState *state, const string& bucket_owner, rgw_obj& obj);
-  int set_olh(ObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj, bool delete_marker);
+  int update_olh(RGWObjectCtx& obj_ctx, RGWObjState *state, const string& bucket_owner, rgw_obj& obj);
+  int set_olh(RGWObjectCtx& obj_ctx, const string& bucket_owner, rgw_obj& target_obj, bool delete_marker);
 
-  int follow_olh(ObjectCtx& ctx, RGWObjState *state, rgw_obj& olh_obj, rgw_obj *target);
+  int follow_olh(RGWObjectCtx& ctx, RGWObjState *state, rgw_obj& olh_obj, rgw_obj *target);
   int get_olh(rgw_obj& obj, RGWOLHInfo *olh);
 
   void gen_rand_obj_instance_name(rgw_obj *target);
@@ -1730,25 +1728,25 @@ public:
   void pick_control_oid(const string& key, string& notify_oid);
 
   void *create_context(void *user_ctx) {
-    ObjectCtx *rctx = new ObjectCtx(this);
+    RGWObjectCtx *rctx = new RGWObjectCtx(this);
     rctx->user_ctx = user_ctx;
     return rctx;
   }
   void destroy_context(void *ctx) {
-    delete static_cast<ObjectCtx *>(ctx);
+    delete static_cast<RGWObjectCtx *>(ctx);
   }
   void set_atomic(void *ctx, rgw_obj& obj) {
-    ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+    RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
     rctx->set_atomic(obj);
   }
   void set_prefetch_data(void *ctx, rgw_obj& obj) {
-    ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+    RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
     rctx->set_prefetch_data(obj);
   }
   // to notify upper layer that we need to do some operation on an object, and it's up to
   // the upper layer to schedule this operation.. e.g., log intent in intent log
   void set_intent_cb(void *ctx, int (*cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent)) {
-    ObjectCtx *rctx = static_cast<ObjectCtx *>(ctx);
+    RGWObjectCtx *rctx = static_cast<RGWObjectCtx *>(ctx);
     rctx->set_intent_cb(cb);
   }
 
@@ -1765,15 +1763,15 @@ public:
   int put_bucket_entrypoint_info(const string& bucket_name, RGWBucketEntryPoint& entry_point, bool exclusive, RGWObjVersionTracker& objv_tracker, time_t mtime,
                                  map<string, bufferlist> *pattrs);
   int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, time_t mtime, map<string, bufferlist> *pattrs);
-  int get_bucket_entrypoint_info(ObjectCtx& obj_ctx, const string& bucket_name, RGWBucketEntryPoint& entry_point, RGWObjVersionTracker *objv_tracker, time_t *pmtime,
+  int get_bucket_entrypoint_info(RGWObjectCtx& obj_ctx, const string& bucket_name, RGWBucketEntryPoint& entry_point, RGWObjVersionTracker *objv_tracker, time_t *pmtime,
                                  map<string, bufferlist> *pattrs, rgw_cache_entry_info *cache_info = NULL);
-  int get_bucket_instance_info(ObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs);
-  int get_bucket_instance_info(ObjectCtx& obj_ctx, rgw_bucket& bucket, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs);
-  int get_bucket_instance_from_oid(ObjectCtx& obj_ctx, string& oid, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs,
+  int get_bucket_instance_info(RGWObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs);
+  int get_bucket_instance_info(RGWObjectCtx& obj_ctx, rgw_bucket& bucket, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs);
+  int get_bucket_instance_from_oid(RGWObjectCtx& obj_ctx, string& oid, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs,
                                    rgw_cache_entry_info *cache_info = NULL);
 
-  int convert_old_bucket_info(ObjectCtx& obj_ctx, string& bucket_name);
-  virtual int get_bucket_info(ObjectCtx& obj_ctx, const string& bucket_name, RGWBucketInfo& info,
+  int convert_old_bucket_info(RGWObjectCtx& obj_ctx, string& bucket_name);
+  virtual int get_bucket_info(RGWObjectCtx& obj_ctx, const string& bucket_name, RGWBucketInfo& info,
                               time_t *pmtime, map<string, bufferlist> *pattrs = NULL);
   virtual int put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, time_t mtime, obj_version *pep_objv,
                                      map<string, bufferlist> *pattrs, bool create_entry_point);
@@ -1979,7 +1977,7 @@ class RGWPutObjProcessor
 {
 protected:
   RGWRados *store;
-  RGWRados::ObjectCtx& obj_ctx;
+  RGWObjectCtx& obj_ctx;
   bool is_complete;
   string bucket_owner;
 
@@ -1988,7 +1986,7 @@ protected:
                           const char *if_match = NULL, const char *if_nomatch = NULL) = 0;
 
 public:
-  RGWPutObjProcessor(RGWRados::ObjectCtx& _obj_ctx, const string& _bo) : store(NULL), obj_ctx(_obj_ctx), is_complete(false), bucket_owner(_bo) {}
+  RGWPutObjProcessor(RGWObjectCtx& _obj_ctx, const string& _bo) : store(NULL), obj_ctx(_obj_ctx), is_complete(false), bucket_owner(_bo) {}
   virtual ~RGWPutObjProcessor() {}
   virtual int prepare(RGWRados *_store, string *oid_rand) {
     store = _store;
@@ -2036,7 +2034,7 @@ protected:
 public:
   int throttle_data(void *handle, bool need_to_wait);
 
-  RGWPutObjProcessor_Aio(RGWRados::ObjectCtx& obj_ctx, const string& bucket_owner) : RGWPutObjProcessor(obj_ctx, bucket_owner), max_chunks(RGW_MAX_PENDING_CHUNKS), obj_len(0) {}
+  RGWPutObjProcessor_Aio(RGWObjectCtx& obj_ctx, const string& bucket_owner) : RGWPutObjProcessor(obj_ctx, bucket_owner), max_chunks(RGW_MAX_PENDING_CHUNKS), obj_len(0) {}
   virtual ~RGWPutObjProcessor_Aio();
 };
 
@@ -2080,7 +2078,7 @@ protected:
 
 public:
   ~RGWPutObjProcessor_Atomic() {}
-  RGWPutObjProcessor_Atomic(RGWRados::ObjectCtx& obj_ctx, const string& bucket_owner,
+  RGWPutObjProcessor_Atomic(RGWObjectCtx& obj_ctx, const string& bucket_owner,
                             rgw_bucket& _b, const string& _o, uint64_t _p, const string& _t, bool versioned) :
                                 RGWPutObjProcessor_Aio(obj_ctx, bucket_owner),
                                 part_size(_p),
index 90c8a07a57e66b0f25cf644eaa655aa4f65e1596..6f198c9a8a8f03964c41f7b3027039df22103ca7 100644 (file)
@@ -37,7 +37,7 @@ int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, cons
   return ret;
 }
 
-int rgw_get_system_obj(RGWRados *rgwstore, RGWRados::ObjectCtx& obj_ctx, rgw_bucket& bucket, const string& key, bufferlist& bl,
+int rgw_get_system_obj(RGWRados *rgwstore, RGWObjectCtx& obj_ctx, rgw_bucket& bucket, const string& key, bufferlist& bl,
                        RGWObjVersionTracker *objv_tracker, time_t *pmtime, map<string, bufferlist> *pattrs,
                        rgw_cache_entry_info *cache_info)
 {
index aeb4cdb9693eec4dda17bf61c23504196d90e77e..daffabe933bd5f35f7285f3a77ad22a580e4c682 100644 (file)
 #include "rgw_common.h"
 
 class RGWRados;
+class RGWObjectCtx;
 struct RGWObjVersionTracker;
 
 struct obj_version;
 
 int rgw_put_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, string& oid, const char *data, size_t size, bool exclusive,
                        RGWObjVersionTracker *objv_tracker, time_t set_mtime, map<string, bufferlist> *pattrs = NULL);
-int rgw_get_system_obj(RGWRados *rgwstore, RGWRados::ObjectCtx& obj_ctx, rgw_bucket& bucket, const string& key, bufferlist& bl,
+int rgw_get_system_obj(RGWRados *rgwstore, RGWObjectCtx& obj_ctx, rgw_bucket& bucket, const string& key, bufferlist& bl,
                        RGWObjVersionTracker *objv_tracker, time_t *pmtime, map<string, bufferlist> *pattrs = NULL,
                        rgw_cache_entry_info *cache_info = NULL);