]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move RGWRadosCtx into RGWRados
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 3 Oct 2014 16:41:53 +0000 (09:41 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 16 Jan 2015 22:41:44 +0000 (14:41 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_main.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 2fd2a23943040899237ee250ea5558681251e2f5..818704a0ef988fcd7dc4bfbcdd1f83ac068985f4 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)
 {
-  RGWRadosCtx rctx(store);
+  RGWRados::RGWRadosCtx rctx(store);
 
   rgw_obj obj(bucket, key);
 
index 2f2b755a762e2fb2d0a1a4fb54c917ca8a47103d..443a72b12d97e79adde48874f463a72d6f361760 100644 (file)
@@ -524,7 +524,7 @@ static int process_request(RGWRados *store, RGWREST *rest, RGWRequest *req, RGWC
 
   struct req_state *s = &rstate;
 
-  RGWRadosCtx rados_ctx(store, s);
+  RGWRados::RGWRadosCtx rados_ctx(store, s);
   s->obj_ctx = &rados_ctx;
   store->set_intent_cb(s->obj_ctx, call_log_intent);
 
index 2dc5919f336aff566dbffbfe6ed8a6ed4e7c411d..605d71049f02e871997309b62ca1987ee6f77dd6 100644 (file)
@@ -1219,7 +1219,7 @@ int RGWPutObjProcessor_Atomic::do_complete(string& etag, time_t *mtime, time_t s
   extra_params.set_mtime = set_mtime;
   extra_params.owner = bucket_owner;
 
-  RGWRadosCtx *rctx = static_cast<RGWRadosCtx *>(obj_ctx);
+  RGWRados::RGWRadosCtx *rctx = static_cast<RGWRados::RGWRadosCtx *>(obj_ctx);
 
   bool is_olh = false;
   if (head_obj.get_instance().empty()) {
@@ -1257,7 +1257,7 @@ public:
   }
 };
 
-RGWObjState *RGWRadosCtx::get_state(rgw_obj& obj) {
+RGWObjState *RGWRados::RGWRadosCtx::get_state(rgw_obj& obj) {
   if (!obj.get_object().empty()) {
     return &objs_state[obj];
   } else {
@@ -1266,12 +1266,12 @@ RGWObjState *RGWRadosCtx::get_state(rgw_obj& obj) {
   }
 }
 
-void RGWRadosCtx::invalidate(rgw_obj& obj)
+void RGWRados::RGWRadosCtx::invalidate(rgw_obj& obj)
 {
   objs_state.erase(obj);
 }
 
-void RGWRadosCtx::set_atomic(rgw_obj& obj) {
+void RGWRados::RGWRadosCtx::set_atomic(rgw_obj& obj) {
   if (!obj.get_object().empty()) {
     objs_state[obj].is_atomic = true;
   } else {
@@ -1280,7 +1280,7 @@ void RGWRadosCtx::set_atomic(rgw_obj& obj) {
   }
 }
 
-void RGWRadosCtx::set_prefetch_data(rgw_obj& obj) {
+void RGWRados::RGWRadosCtx::set_prefetch_data(rgw_obj& obj) {
   if (!obj.get_object().empty()) {
     objs_state[obj].prefetch_data = true;
   } else {
index bc52a438995673320455274595178b047149167a..e47af402a9150ad7bed281df878ed69b1a8279a7 100644 (file)
@@ -800,33 +800,6 @@ struct RGWObjState {
   }
 };
 
-struct RGWRadosCtx {
-  RGWRados *store;
-  map<rgw_obj, RGWObjState> objs_state;
-  int (*intent_cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent);
-  void *user_ctx;
-
-  RGWRadosCtx(RGWRados *_store) : store(_store), intent_cb(NULL), user_ctx(NULL) { }
-  RGWRadosCtx(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);
-
-  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;
-  }
-
-  void invalidate(rgw_obj& obj);
-};
-
 struct RGWPoolIterCtx {
   librados::IoCtx io_ctx;
   librados::NObjectIterator iter;
@@ -1291,6 +1264,35 @@ class RGWRados
   friend class RGWStateLog;
   friend class RGWReplicaLogger;
 
+public:
+  struct RGWRadosCtx {
+    RGWRados *store;
+    map<rgw_obj, RGWObjState> objs_state;
+    int (*intent_cb)(RGWRados *store, void *user_ctx, rgw_obj& obj, RGWIntentEvent intent);
+    void *user_ctx;
+
+    RGWRadosCtx(RGWRados *_store) : store(_store), intent_cb(NULL), user_ctx(NULL) { }
+    RGWRadosCtx(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);
+
+    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;
+    }
+
+    void invalidate(rgw_obj& obj);
+  };
+
+private:
   /** Open the pool used as root for this gateway */
   int open_root_pool_ctx();
   int open_gc_pool_ctx();