From: Ali Maredia Date: Tue, 30 Apr 2019 22:26:45 +0000 (-0400) Subject: rgw: add optional_yield to rgw_get_system_obj in rgw_tools X-Git-Tag: v15.1.0~2602^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8ae3704710b01fce45f99fbcd47995f2e4c752d;p=ceph.git rgw: add optional_yield to rgw_get_system_obj in rgw_tools Signed-off-by: Ali Maredia --- diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index aafc43d6cfa6..30968be3020c 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -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; } diff --git a/src/rgw/rgw_pubsub.h b/src/rgw/rgw_pubsub.h index 3fd7e91b7e75..14eb51ee2a3e 100644 --- a/src/rgw/rgw_pubsub.h +++ b/src/rgw/rgw_pubsub.h @@ -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; } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 59a862790450..2b4fc9275072 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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; diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index 6e6b137a71f6..63422a1562cc 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -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; diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index 52dc10fad44b..eb9760512bea 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -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 *pattrs, + RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, map *pattrs, rgw_cache_entry_info *cache_info, boost::optional 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()) { diff --git a/src/rgw/rgw_tools.h b/src/rgw/rgw_tools.h index 927915e9ef0c..b0c7d40ab6aa 100644 --- a/src/rgw/rgw_tools.h +++ b/src/rgw/rgw_tools.h @@ -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 *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 *pattrs = NULL, + RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, map *pattrs = NULL, rgw_cache_entry_info *cache_info = NULL, boost::optional refresh_version = boost::none); int rgw_delete_system_obj(RGWRados *rgwstore, const rgw_pool& pool, const string& oid, diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 7847f60eea5d..d46143982521 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -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; }