]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: more fixes following rebase
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 18 Feb 2017 00:37:08 +0000 (16:37 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 9 Mar 2017 17:18:56 +0000 (09:18 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_lc.cc
src/rgw/rgw_op.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_tools.cc
src/rgw/rgw_tools.h

index 2be2d86b824feba9a6dd0e6d03ff34b34e045f0c..0e673f0b477b8bb03ea7aba0d23378f6c02ba6ba 100644 (file)
@@ -423,7 +423,7 @@ int RGWLC::bucket_lc_process(string& shard_id)
               RGWObjectCtx rctx(store);
               rgw_obj obj(bucket_info.bucket, obj_iter->key);
               RGWObjState *state;
-              int ret = store->get_obj_state(&rctx, obj, &state, false);
+              int ret = store->get_obj_state(&rctx, bucket_info, obj, &state, false);
               if (ret < 0) {
                 return ret;
               }
index 66520db7732869600a1ed663168da8b2cc9fdf56..50e35c846a914718525c98136d8d016990f71406 100644 (file)
@@ -5503,8 +5503,7 @@ void RGWSetAttrs::execute()
   if (op_ret < 0)
     return;
 
-  rgw_obj obj(s->bucket, s->object.name);
-  obj.set_instance(s->object.instance);
+  rgw_obj obj(s->bucket, s->object);
 
   store->set_atomic(s->obj_ctx, obj);
 
index 499141f6f764dcceda15d43376b3d925274a2dc2..af00d1980ce9653c1ed1625ac7b33dbb30b8b64f 100644 (file)
@@ -186,6 +186,36 @@ int rgw_init_ioctx(librados::Rados *rados, const rgw_pool& pool, IoCtx& ioctx, b
   return 0;
 }
 
+template<>
+void RGWObjectCtxImpl<rgw_obj, RGWObjState>::invalidate(rgw_obj& obj) {
+  RWLock::WLocker wl(lock);
+  auto iter = objs_state.find(obj);
+  if (iter == objs_state.end()) {
+    return;
+  }
+  bool is_atomic = iter->second.is_atomic;
+  bool prefetch_data = iter->second.prefetch_data;
+
+  objs_state.erase(iter);
+
+  if (is_atomic || prefetch_data) {
+    auto& s = objs_state[obj];
+    s.is_atomic = is_atomic;
+    s.prefetch_data = prefetch_data;
+  }
+}
+
+template<>
+void RGWObjectCtxImpl<rgw_raw_obj, RGWRawObjState>::invalidate(rgw_raw_obj& obj) {
+  RWLock::WLocker wl(lock);
+  auto iter = objs_state.find(obj);
+  if (iter == objs_state.end()) {
+    return;
+  }
+
+  objs_state.erase(iter);
+}
+
 void RGWDefaultZoneGroupInfo::dump(Formatter *f) const {
   encode_json("default_zonegroup", default_zonegroup, f);
 }
@@ -5062,7 +5092,7 @@ int RGWRados::Bucket::List::list_objects(int max, vector<rgw_bucket_dir_entry> *
   rgw_obj_index_key cur_end_marker;
   if (!params.ns.empty()) {
     end_marker_obj = rgw_obj_key(params.end_marker.name, params.end_marker.instance, params.ns);
-    end_marker_obj.set_ns(params.ns);
+    end_marker_obj.ns = params.ns;
     end_marker_obj.get_index_key(&cur_end_marker);
   }
   rgw_obj_index_key cur_marker;
@@ -8337,7 +8367,7 @@ int RGWRados::delete_raw_obj(const rgw_raw_obj& obj)
 
 int RGWRados::delete_system_obj(rgw_raw_obj& obj, RGWObjVersionTracker *objv_tracker)
 {
-  if (obj.get_object().empty()) {
+  if (obj.empty()) {
     ldout(cct, 1) << "delete_system_obj got empty object name "
         << obj << ", returning EINVAL" << dendl;
     return -EINVAL;
index 833f15c554e6113f62029c92e6aa94deeeac1047..24dbffff425c545bac5cc425d1f45b0d2fd8cc29 100644 (file)
@@ -2104,6 +2104,12 @@ public:
   }
 };
 
+template<>
+void RGWObjectCtxImpl<rgw_obj, RGWObjState>::invalidate(rgw_obj& obj);
+
+template<>
+void RGWObjectCtxImpl<rgw_raw_obj, RGWRawObjState>::invalidate(rgw_raw_obj& obj);
+
 struct RGWObjectCtx {
   RGWRados *store;
   void *user_ctx;
@@ -3135,7 +3141,7 @@ public:
 
   int get_system_obj_state(RGWObjectCtx *rctx, rgw_raw_obj& obj, RGWRawObjState **state, RGWObjVersionTracker *objv_tracker);
   int get_obj_state(RGWObjectCtx *rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWObjState **state,
-                    bool follow_olh, assume_noent = false);
+                    bool follow_olh, bool assume_noent = false);
   int get_obj_state(RGWObjectCtx *rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWObjState **state) {
     return get_obj_state(rctx, bucket_info, obj, state, true);
   }
index 6a607f69cb69e7411edf4a2cefc7e7f925617d85..e58182bddab0952dab7c79eea6fd9b4ebc0e957e 100644 (file)
@@ -91,10 +91,10 @@ int rgw_get_system_obj(RGWRados *rgwstore, RGWObjectCtx& obj_ctx, rgw_pool& pool
   return 0;
 }
 
-int rgw_delete_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, const string& oid,
+int rgw_delete_system_obj(RGWRados *rgwstore, rgw_pool& pool, const string& oid,
                           RGWObjVersionTracker *objv_tracker)
 {
-  rgw_obj obj(bucket, oid);
+  rgw_raw_obj obj(pool, oid);
   return rgwstore->delete_system_obj(obj, objv_tracker);
 }
 
index bec35ed71a16d9aff60e34307ffd78a20444eeb9..97df2021d8dd73326f4c7910e529e043978e8738 100644 (file)
@@ -21,7 +21,7 @@ int rgw_put_system_obj(RGWRados *rgwstore, rgw_pool& pool, const string& oid, co
 int rgw_get_system_obj(RGWRados *rgwstore, RGWObjectCtx& obj_ctx, rgw_pool& pool, const string& key, bufferlist& bl,
                        RGWObjVersionTracker *objv_tracker, real_time *pmtime, map<string, bufferlist> *pattrs = NULL,
                        rgw_cache_entry_info *cache_info = NULL);
-int rgw_delete_system_obj(RGWRados *rgwstore, rgw_bucket& bucket, const string& oid,
+int rgw_delete_system_obj(RGWRados *rgwstore, rgw_pool& pool, const string& oid,
                           RGWObjVersionTracker *objv_tracker);
 
 int rgw_tools_init(CephContext *cct);