]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add optional_yield to rgw_get_system_obj in rgw_tools
authorAli Maredia <amaredia@redhat.com>
Tue, 30 Apr 2019 22:26:45 +0000 (18:26 -0400)
committerAli Maredia <amaredia@redhat.com>
Fri, 17 May 2019 20:11:29 +0000 (16:11 -0400)
Signed-off-by: Ali Maredia <amaredia@redhat.com>
src/rgw/rgw_metadata.cc
src/rgw/rgw_pubsub.h
src/rgw/rgw_rados.cc
src/rgw/rgw_role.cc
src/rgw/rgw_tools.cc
src/rgw/rgw_tools.h
src/rgw/rgw_user.cc

index aafc43d6cfa6f4d39f560d96dabf8aa0758af419..30968be3020c2a3d66bffb98b14238497d2b242c 100644 (file)
@@ -364,7 +364,7 @@ int read_history(RGWRados *store, RGWMetadataLogHistory *state,
   auto& pool = store->svc.zone->get_zone_params().log_pool;
   const auto& oid = RGWMetadataLogHistory::oid;
   bufferlist bl;
-  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, objv_tracker, nullptr);
+  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, objv_tracker, nullptr, null_yield);
   if (ret < 0) {
     return ret;
   }
@@ -806,7 +806,7 @@ int RGWMetadataManager::prepare_mutate(RGWRados *store,
   auto obj_ctx = store->svc.sysobj->init_obj_ctx();
   int ret = rgw_get_system_obj(store, obj_ctx, pool, oid,
                                bl, objv_tracker, &orig_mtime,
-                               nullptr, nullptr);
+                               null_yield, nullptr, nullptr);
   if (ret < 0 && ret != -ENOENT) {
     return ret;
   }
index 3fd7e91b7e75f1ed95c3868e1746f1927e7a6777..14eb51ee2a3e68e29f5e7f1ca362ec5dd1b4a4c4 100644 (file)
@@ -600,7 +600,7 @@ int RGWUserPubSub::read(const rgw_raw_obj& obj, T *result, RGWObjVersionTracker
                                obj.pool, obj.oid,
                                bl,
                                objv_tracker,
-                               nullptr, nullptr, nullptr);
+                               nullptr, null_yield, nullptr, nullptr);
   if (ret < 0) {
     return ret;
   }
index 59a86279045014aae29861a8eb93217192583b38..2b4fc927507280e0d58fbd2dd3e37d557cc23c1b 100644 (file)
@@ -8151,7 +8151,7 @@ int RGWRados::get_bucket_instance_from_oid(RGWSysObjectCtx& obj_ctx, const strin
   bufferlist epbl;
 
   int ret = rgw_get_system_obj(this, obj_ctx, domain_root,
-                              oid, epbl, &info.objv_tracker, pmtime, pattrs,
+                              oid, epbl, &info.objv_tracker, pmtime, y, pattrs,
                               cache_info, refresh_version);
   if (ret < 0) {
     return ret;
@@ -8183,7 +8183,7 @@ int RGWRados::get_bucket_entrypoint_info(RGWSysObjectCtx& obj_ctx,
 
   rgw_make_bucket_entry_name(tenant_name, bucket_name, bucket_entry);
   int ret = rgw_get_system_obj(this, obj_ctx, svc.zone->get_zone_params().domain_root,
-                              bucket_entry, bl, objv_tracker, pmtime, pattrs,
+                              bucket_entry, bl, objv_tracker, pmtime, null_yield, pattrs,
                               cache_info, refresh_version);
   if (ret < 0) {
     return ret;
index 6e6b137a71f61f6063b1248e8707fcc0b0144de0..63422a1562cc818cb16e17a4c146c751c0649055 100644 (file)
@@ -305,7 +305,7 @@ int RGWRole::read_id(const string& role_name, const string& tenant, string& role
   bufferlist bl;
   auto obj_ctx = store->svc.sysobj->init_obj_ctx();
 
-  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
+  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL, null_yield);
   if (ret < 0) {
     return ret;
   }
@@ -331,7 +331,7 @@ int RGWRole::read_info()
   bufferlist bl;
   auto obj_ctx = store->svc.sysobj->init_obj_ctx();
 
-  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
+  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL, null_yield);
   if (ret < 0) {
     ldout(cct, 0) << "ERROR: failed reading role info from pool: " << pool.name <<
                   ": " << id << ": " << cpp_strerror(-ret) << dendl;
@@ -358,7 +358,7 @@ int RGWRole::read_name()
   bufferlist bl;
   auto obj_ctx = store->svc.sysobj->init_obj_ctx();
 
-  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL);
+  int ret = rgw_get_system_obj(store, obj_ctx, pool, oid, bl, NULL, NULL, null_yield);
   if (ret < 0) {
     ldout(cct, 0) << "ERROR: failed reading role name from pool: " << pool.name << ": "
                   << name << ": " << cpp_strerror(-ret) << dendl;
index 52dc10fad44b2d8992eb944b5576a74f19e56059..eb9760512beab258554c5d428ed6b3eabc77459c 100644 (file)
@@ -130,7 +130,7 @@ int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& o
 }
 
 int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl,
-                       RGWObjVersionTracker *objv_tracker, real_time *pmtime, map<string, bufferlist> *pattrs,
+                       RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, map<string, bufferlist> *pattrs,
                        rgw_cache_entry_info *cache_info, boost::optional<obj_version> refresh_version)
 {
   bufferlist::iterator iter;
@@ -149,13 +149,13 @@ int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_p
     int ret = rop.set_attrs(pattrs)
                  .set_last_mod(pmtime)
                  .set_objv_tracker(objv_tracker)
-                 .stat(null_yield);
+                 .stat(y);
     if (ret < 0)
       return ret;
 
     ret = rop.set_cache_info(cache_info)
              .set_refresh_version(refresh_version)
-             .read(&bl, null_yield);
+             .read(&bl, y);
     if (ret == -ECANCELED) {
       /* raced, restart */
       if (!original_readv.empty()) {
index 927915e9ef0cd5c02ffc2590080b13960b2131e2..b0c7d40ab6aa39952f5e92bde3d179edd329bfa0 100644 (file)
@@ -25,7 +25,7 @@ int rgw_init_ioctx(librados::Rados *rados, const rgw_pool& pool,
 int rgw_put_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid, bufferlist& data, bool exclusive,
                        RGWObjVersionTracker *objv_tracker, real_time set_mtime, map<string, bufferlist> *pattrs = NULL);
 int rgw_get_system_obj(RGWRados *rgwstore, RGWSysObjectCtx& obj_ctx, const rgw_pool& pool, const string& key, bufferlist& bl,
-                       RGWObjVersionTracker *objv_tracker, real_time *pmtime, map<string, bufferlist> *pattrs = NULL,
+                       RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, map<string, bufferlist> *pattrs = NULL,
                        rgw_cache_entry_info *cache_info = NULL,
                       boost::optional<obj_version> refresh_version = boost::none);
 int rgw_delete_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid,
index 7847f60eea5d2cca77f4aec20d69f9a146762bc1..d4614398252162fe60c279622b145e4cf2180dea 100644 (file)
@@ -280,7 +280,7 @@ int rgw_get_user_info_from_index(RGWRados * const store,
   RGWUID uid;
   auto obj_ctx = store->svc.sysobj->init_obj_ctx();
 
-  int ret = rgw_get_system_obj(store, obj_ctx, pool, key, bl, NULL, &e.mtime);
+  int ret = rgw_get_system_obj(store, obj_ctx, pool, key, bl, NULL, &e.mtime, null_yield);
   if (ret < 0)
     return ret;
 
@@ -326,7 +326,7 @@ int rgw_get_user_info_by_uid(RGWRados *store,
 
   auto obj_ctx = store->svc.sysobj->init_obj_ctx();
   string oid = uid.to_str();
-  int ret = rgw_get_system_obj(store, obj_ctx, store->svc.zone->get_zone_params().user_uid_pool, oid, bl, objv_tracker, pmtime, pattrs, cache_info);
+  int ret = rgw_get_system_obj(store, obj_ctx, store->svc.zone->get_zone_params().user_uid_pool, oid, bl, objv_tracker, pmtime, null_yield, pattrs, cache_info);
   if (ret < 0) {
     return ret;
   }