]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: make optional_yield explicit in RGWUserCtl interfaces
authorCasey Bodley <cbodley@redhat.com>
Thu, 18 Jul 2019 19:11:53 +0000 (15:11 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 29 Jul 2019 19:20:50 +0000 (15:20 -0400)
the purpose of null_yield is to highlight synchronous function calls so
they can be found with grep. having optional_yield parameters or member
variables that default to null_yield obscures these synchronous calls,
so optional_yield arguments should be an explicit part of interfaces

moved optional_yield out of RGWUserCtl's various Param types, and
updated all callers to pass in null_yield (except for a few cases where
the caller had access to a valid one)

Signed-off-by: Casey Bodley <cbodley@redhat.com>
15 files changed:
src/rgw/librgw.cc
src/rgw/rgw_acl_s3.cc
src/rgw/rgw_acl_swift.cc
src/rgw/rgw_auth.cc
src/rgw/rgw_auth_filters.h
src/rgw/rgw_bucket.cc
src/rgw/rgw_cr_tools.cc
src/rgw/rgw_file.h
src/rgw/rgw_frontend.h
src/rgw/rgw_op.cc
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_rest_user_policy.cc
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_user.cc
src/rgw/rgw_user.h

index 155ff857eaa624df13f236303cd7cfb46ca62e15..6aeda771a89f829f347a36307bbfd36c28e1cc91 100644 (file)
@@ -627,7 +627,7 @@ namespace rgw {
 
   int RGWLibIO::set_uid(RGWRados *store, const rgw_user& uid)
   {
-    int ret = store->ctl.user->get_info_by_uid(uid, &user_info);
+    int ret = store->ctl.user->get_info_by_uid(uid, &user_info, null_yield);
     if (ret < 0) {
       derr << "ERROR: failed reading user info: uid=" << uid << " ret="
           << ret << dendl;
index f196b5f7ead597f12d4274fc3e5cea776b2497db..41e4d839a7a2128d89ad1838924ee682024a5acf 100644 (file)
@@ -306,14 +306,14 @@ static int parse_grantee_str(RGWUserCtl *user_ctl, string& grantee_str,
   string id_val = rgw_trim_quotes(id_val_quoted);
 
   if (strcasecmp(id_type.c_str(), "emailAddress") == 0) {
-    ret = user_ctl->get_info_by_email(id_val, &info);
+    ret = user_ctl->get_info_by_email(id_val, &info, null_yield);
     if (ret < 0)
       return ret;
 
     grant.set_canon(info.user_id, info.display_name, rgw_perm);
   } else if (strcasecmp(id_type.c_str(), "id") == 0) {
     rgw_user user(id_val);
-    ret = user_ctl->get_info_by_uid(user, &info);
+    ret = user_ctl->get_info_by_uid(user, &info, null_yield);
     if (ret < 0)
       return ret;
 
@@ -487,7 +487,7 @@ int RGWAccessControlPolicy_S3::rebuild(RGWUserCtl *user_ctl, ACLOwner *owner, RG
   }
 
   RGWUserInfo owner_info;
-  if (user_ctl->get_info_by_uid(owner->get_id(), &owner_info) < 0) {
+  if (user_ctl->get_info_by_uid(owner->get_id(), &owner_info, null_yield) < 0) {
     ldout(cct, 10) << "owner info does not exist" << dendl;
     return -EINVAL;
   }
@@ -520,7 +520,7 @@ int RGWAccessControlPolicy_S3::rebuild(RGWUserCtl *user_ctl, ACLOwner *owner, RG
         }
         email = u.id;
         ldout(cct, 10) << "grant user email=" << email << dendl;
-        if (user_ctl->get_info_by_email(email, &grant_user) < 0) {
+        if (user_ctl->get_info_by_email(email, &grant_user, null_yield) < 0) {
           ldout(cct, 10) << "grant user email not found or other error" << dendl;
           return -ERR_UNRESOLVABLE_EMAIL;
         }
@@ -535,7 +535,7 @@ int RGWAccessControlPolicy_S3::rebuild(RGWUserCtl *user_ctl, ACLOwner *owner, RG
           }
         }
     
-        if (grant_user.user_id.empty() && user_ctl->get_info_by_uid(uid, &grant_user) < 0) {
+        if (grant_user.user_id.empty() && user_ctl->get_info_by_uid(uid, &grant_user, null_yield) < 0) {
           ldout(cct, 10) << "grant user does not exist:" << uid << dendl;
           return -EINVAL;
         } else {
index 3053e3256b220ef633b02fc46415feb071088689..c1a20c8ed26cd63eef68fcabb254c54895ceeaad 100644 (file)
@@ -120,7 +120,7 @@ static ACLGrant user_to_grant(CephContext* const cct,
   RGWUserInfo grant_user;
   ACLGrant grant;
 
-  if (user_ctl->get_info_by_uid(user, &grant_user) < 0) {
+  if (user_ctl->get_info_by_uid(user, &grant_user, null_yield) < 0) {
     ldout(cct, 10) << "grant user does not exist: " << uid << dendl;
     /* skipping silently */
     grant.set_canon(user, std::string(), perm);
@@ -311,7 +311,7 @@ void RGWAccessControlPolicy_SWIFTAcct::add_grants(RGWUserCtl * const user_ctl,
     } else  {
       rgw_user user(uid);
 
-      if (user_ctl->get_info_by_uid(user, &grant_user) < 0) {
+      if (user_ctl->get_info_by_uid(user, &grant_user, null_yield) < 0) {
         ldout(cct, 10) << "grant user does not exist:" << uid << dendl;
         /* skipping silently */
         grant.set_canon(user, std::string(), perm);
index 90545cfbbce5ac5ab154b0259b8af79dda913885..447ffd5d3b22fa04ff9bd665417b5439f2f51dcd 100644 (file)
@@ -470,8 +470,8 @@ void rgw::auth::RemoteApplier::create_account(const DoutPrefixProvider* dpp,
   rgw_apply_default_bucket_quota(user_info.bucket_quota, cct->_conf);
   rgw_apply_default_user_quota(user_info.user_quota, cct->_conf);
 
-  int ret = ctl->user->store_info(user_info, RGWUserCtl::PutParams()
-                                                   .set_exclusive(true));
+  int ret = ctl->user->store_info(user_info, null_yield,
+                                  RGWUserCtl::PutParams().set_exclusive(true));
   if (ret < 0) {
     ldpp_dout(dpp, 0) << "ERROR: failed to store new user info: user="
                   << user_info.user_id << " ret=" << ret << dendl;
@@ -501,13 +501,13 @@ void rgw::auth::RemoteApplier::load_acct_info(const DoutPrefixProvider* dpp, RGW
   if (acct_user.tenant.empty()) {
     const rgw_user tenanted_uid(acct_user.id, acct_user.id);
 
-    if (ctl->user->get_info_by_uid( tenanted_uid, &user_info) >= 0) {
+    if (ctl->user->get_info_by_uid(tenanted_uid, &user_info, null_yield) >= 0) {
       /* Succeeded. */
       return;
     }
   }
 
-  if (ctl->user->get_info_by_uid( acct_user, &user_info) < 0) {
+  if (ctl->user->get_info_by_uid(acct_user, &user_info, null_yield) < 0) {
     ldpp_dout(dpp, 0) << "NOTICE: couldn't map swift user " << acct_user << dendl;
     create_account(dpp, acct_user, user_info);
   }
index 7c3a1a6dca396105a12b16e8aa2f8afdf8c98c67..7a6f4b8a17f6f2ce3b22def0074017e6e1df7c56 100644 (file)
@@ -161,13 +161,13 @@ void ThirdPartyAccountApplier<T>::load_acct_info(const DoutPrefixProvider* dpp,
     if (acct_user_override.tenant.empty()) {
       const rgw_user tenanted_uid(acct_user_override.id, acct_user_override.id);
 
-      if (ctl->user->get_info_by_uid(tenanted_uid, &user_info) >= 0) {
+      if (ctl->user->get_info_by_uid(tenanted_uid, &user_info, null_yield) >= 0) {
         /* Succeeded. */
         return;
       }
     }
 
-    const int ret = ctl->user->get_info_by_uid(acct_user_override, &user_info);
+    const int ret = ctl->user->get_info_by_uid(acct_user_override, &user_info, null_yield);
     if (ret < 0) {
       /* We aren't trying to recover from ENOENT here. It's supposed that creating
        * someone else's account isn't a thing we want to support in this filter. */
@@ -237,7 +237,7 @@ void SysReqApplier<T>::load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo
        * reasons. rgw_get_user_info_by_uid doesn't trigger the operator=() but
        * calls ::decode instead. */
       RGWUserInfo euser_info;
-      if (ctl->user->get_info_by_uid(effective_uid, &euser_info) < 0) {
+      if (ctl->user->get_info_by_uid(effective_uid, &euser_info, null_yield) < 0) {
         //ldpp_dout(dpp, 0) << "User lookup failed!" << dendl;
         throw -EACCES;
       }
index 898d922b1dd5edb760c988ff914afe922b59c379..08cc385a78f5d62b646c4285558e13c209c95ff5 100644 (file)
@@ -599,7 +599,7 @@ int RGWBucket::init(RGWRados *storage, RGWBucketAdminOpState& op_state)
   }
 
   if (!user_id.empty()) {
-    int r = store->ctl.user->get_info_by_uid(user_id, &user_info);
+    int r = store->ctl.user->get_info_by_uid(user_id, &user_info, null_yield);
     if (r < 0)
       return r;
 
index dc1abd813bb6b1e064082c6bfbbefcf7c1cf240a..090418bbaa4fa1acdec8ce4e56a01ab254b86313 100644 (file)
@@ -89,7 +89,7 @@ int RGWUserCreateCR::Request::_send_request()
 template<>
 int RGWGetUserInfoCR::Request::_send_request()
 {
-  return store->ctl.user->get_info_by_uid(params.user, result.get(), nullopt);
+  return store->ctl.user->get_info_by_uid(params.user, result.get(), null_yield);
 }
 
 template<>
index bdd8042974159b53fd0404821213f7b6fe9115a0..c4ce9412a732a1491c2b2576a9000aa6d6fe0ae6 100644 (file)
@@ -973,7 +973,7 @@ namespace rgw {
     }
 
     int authorize(RGWRados* store) {
-      int ret = store->ctl.user->get_info_by_access_key(key.id, &user);
+      int ret = store->ctl.user->get_info_by_access_key(key.id, &user, null_yield);
       if (ret == 0) {
        RGWAccessKey* k = user.get_key(key.id);
        if (!k || (k->key != key.key))
@@ -992,9 +992,10 @@ namespace rgw {
        }
        if (token.valid() && (ldh->auth(token.id, token.key) == 0)) {
          /* try to store user if it doesn't already exist */
-         if (store->ctl.user->get_info_by_uid(token.id, &user) < 0) {
-           int ret = rgw_store_user_info(store->ctl.user, user, NULL, NULL, real_time(),
-                                         true);
+         if (store->ctl.user->get_info_by_uid(token.id, &user, null_yield) < 0) {
+           int ret = store->ctl.user->store_info(user, null_yield,
+                                                  RGWUserCtl::PutParams()
+                                                  .set_exclusive(true));
            if (ret < 0) {
              lsubdout(get_context(), rgw, 10)
                << "NOTICE: failed to store new user's info: ret=" << ret
@@ -1277,7 +1278,7 @@ namespace rgw {
     void update_user() {
       RGWUserInfo _user = user;
       auto user_ctl = rgwlib.get_store()->ctl.user;
-      int ret = user_ctl->get_info_by_access_key(key.id, &user);
+      int ret = user_ctl->get_info_by_access_key(key.id, &user, null_yield);
       if (ret != 0)
         user = _user;
     }
index 3775be7b1b38aefd16afc4d25ca6a3d22ab62286..24d443de7dd490b57624b57400097a29e6326ae2 100644 (file)
@@ -229,7 +229,7 @@ public:
     rgw_user uid(uid_str);
 
     RGWUserInfo user_info;
-    int ret = env.store->ctl.user->get_info_by_uid(uid, &user_info);
+    int ret = env.store->ctl.user->get_info_by_uid(uid, &user_info, null_yield);
     if (ret < 0) {
       derr << "ERROR: failed reading user info: uid=" << uid << " ret="
           << ret << dendl;
index 8ccc7392c5ae09999a95e8e5c9dff4148b855774..7bb57c037832fd04423d52b62f66b73001a0ec24 100644 (file)
@@ -220,7 +220,7 @@ static int get_bucket_instance_policy_from_attr(CephContext *cct,
     ldout(cct, 0) << "WARNING: couldn't find acl header for bucket, generating default" << dendl;
     RGWUserInfo uinfo;
     /* object exists, but policy is broken */
-    int r = rgw_get_user_info_by_uid(user_ctl, bucket_info.owner, uinfo);
+    int r = user_ctl->get_info_by_uid(bucket_info.owner, &uinfo, null_yield);
     if (r < 0)
       return r;
 
@@ -245,7 +245,7 @@ static int get_obj_policy_from_attr(CephContext *cct,
   RGWRados::Object op_target(store, bucket_info, obj_ctx, obj);
   RGWRados::Object::Read rop(&op_target);
 
-  ret = rop.get_attr(RGW_ATTR_ACL, bl, null_yield);
+  ret = rop.get_attr(RGW_ATTR_ACL, bl, y);
   if (ret >= 0) {
     ret = decode_policy(cct, bl, policy);
     if (ret < 0)
@@ -254,7 +254,7 @@ static int get_obj_policy_from_attr(CephContext *cct,
     /* object exists, but policy is broken */
     ldout(cct, 0) << "WARNING: couldn't find acl header for object, generating default" << dendl;
     RGWUserInfo uinfo;
-    ret = store->ctl.user->get_info_by_uid(bucket_info.owner, &uinfo);
+    ret = store->ctl.user->get_info_by_uid(bucket_info.owner, &uinfo, y);
     if (ret < 0)
       return ret;
 
@@ -1279,7 +1279,7 @@ int RGWOp::init_quota()
   if (s->user->user_id == s->bucket_owner.get_id()) {
     uinfo = s->user;
   } else {
-    int r = store->ctl.user->get_info_by_uid(s->bucket_info.owner, &owner_info);
+    int r = store->ctl.user->get_info_by_uid(s->bucket_info.owner, &owner_info, s->yield);
     if (r < 0)
       return r;
     uinfo = &owner_info;
@@ -4388,7 +4388,7 @@ void RGWPutMetadataAccount::execute()
 {
   /* Params have been extracted earlier. See init_processing(). */
   RGWUserInfo new_uinfo;
-  op_ret = store->ctl.user->get_info_by_uid(s->user->user_id, &new_uinfo,
+  op_ret = store->ctl.user->get_info_by_uid(s->user->user_id, &new_uinfo, s->yield,
                                             RGWUserCtl::GetParams()
                                             .set_objv_tracker(&acct_op_tracker));
   if (op_ret < 0) {
@@ -4409,10 +4409,11 @@ void RGWPutMetadataAccount::execute()
 
   /* We are passing here the current (old) user info to allow the function
    * optimize-out some operations. */
-  op_ret = store->ctl.user->store_info(new_uinfo, RGWUserCtl::PutParams()
-                                                  .set_old_info(s->user)
-                                                  .set_objv_tracker(&acct_op_tracker)
-                                                  .set_attrs(&attrs));
+  op_ret = store->ctl.user->store_info(new_uinfo, s->yield,
+                                       RGWUserCtl::PutParams()
+                                       .set_old_info(s->user)
+                                       .set_objv_tracker(&acct_op_tracker)
+                                       .set_attrs(&attrs));
 }
 
 int RGWPutMetadataBucket::verify_permission()
index 19406c8fcf18acbc3d4f28104215670187d4d8e5..c1f6ad7f30ca67b512034947e0932705f815224a 100644 (file)
@@ -2094,14 +2094,14 @@ void RGWFormPost::get_owner_info(const req_state* const s,
     if (uid.tenant.empty()) {
       const rgw_user tenanted_uid(uid.id, uid.id);
 
-      if (user_ctl->get_info_by_uid(tenanted_uid, &uinfo) >= 0) {
+      if (user_ctl->get_info_by_uid(tenanted_uid, &uinfo, s->yield) >= 0) {
         /* Succeeded. */
         bucket_tenant = uinfo.user_id.tenant;
         found = true;
       }
     }
 
-    if (!found && user_ctl->get_info_by_uid(uid, &uinfo) < 0) {
+    if (!found && user_ctl->get_info_by_uid(uid, &uinfo, s->yield) < 0) {
       throw -EPERM;
     } else {
       bucket_tenant = uinfo.user_id.tenant;
@@ -2120,7 +2120,7 @@ void RGWFormPost::get_owner_info(const req_state* const s,
   ldpp_dout(this, 20) << "temp url user (bucket owner): " << bucket_info.owner
                  << dendl;
 
-  if (user_ctl->get_info_by_uid(bucket_info.owner, &owner_info) < 0) {
+  if (user_ctl->get_info_by_uid(bucket_info.owner, &owner_info, s->yield) < 0) {
     throw -EPERM;
   }
 }
index 34b521b00a1124101b7beb0e93f4fd6bcc661d81..5d553454033201b0942ac805cc62cf680e4e5ed7 100644 (file)
@@ -118,7 +118,7 @@ void RGWPutUserPolicy::execute()
 
   RGWUserInfo info;
   rgw_user user_id(user_name);
-  op_ret = rgw_get_user_info_by_uid(store->ctl.user, user_id, info);
+  op_ret = store->ctl.user->get_info_by_uid(user_id, &info, s->yield);
   if (op_ret < 0) {
     op_ret = -ERR_NO_SUCH_ENTITY;
     return;
@@ -144,7 +144,10 @@ void RGWPutUserPolicy::execute()
     uattrs[RGW_ATTR_USER_POLICY] = in_bl;
 
     RGWObjVersionTracker objv_tracker;
-    op_ret = rgw_store_user_info(store->ctl.user, info, &info, &objv_tracker, real_time(), false, &uattrs);
+    op_ret = store->ctl.user->store_info(info, s->yield,
+                                         RGWUserCtl::PutParams()
+                                         .set_objv_tracker(&objv_tracker)
+                                         .set_attrs(&uattrs));
     if (op_ret < 0) {
       op_ret = -ERR_INTERNAL_ERROR;
     }
@@ -315,20 +318,16 @@ void RGWDeleteUserPolicy::execute()
   }
 
   RGWUserInfo info;
+  map<string, bufferlist> uattrs;
   rgw_user user_id(user_name);
-  op_ret = store->ctl.user->get_info_by_uid(user_id, &info);
+  op_ret = store->ctl.user->get_info_by_uid(user_id, &info, s->yield,
+                                            RGWUserCtl::GetParams()
+                                            .set_attrs(&uattrs));
   if (op_ret < 0) {
     op_ret = -ERR_NO_SUCH_ENTITY;
     return;
   }
 
-  map<string, bufferlist> uattrs;
-  op_ret = store->ctl.user->get_attrs_by_uid(user_id, &uattrs, s->yield);
-  if (op_ret == -ENOENT) {
-    op_ret = -ERR_NO_SUCH_ENTITY;
-    return;
-  }
-
   map<string, string> policies;
   if (auto it = uattrs.find(RGW_ATTR_USER_POLICY); it != uattrs.end()) {
     bufferlist out_bl = uattrs[RGW_ATTR_USER_POLICY];
@@ -341,10 +340,11 @@ void RGWDeleteUserPolicy::execute()
       uattrs[RGW_ATTR_USER_POLICY] = in_bl;
 
       RGWObjVersionTracker objv_tracker;
-      op_ret = store->ctl.user->store_info(info, RGWUserCtl::PutParams()
-                                                .set_old_info(&info)
-                                                .set_objv_tracker(&objv_tracker)
-                                                .set_attrs(&uattrs));
+      op_ret = store->ctl.user->store_info(info, s->yield,
+                                           RGWUserCtl::PutParams()
+                                           .set_old_info(&info)
+                                           .set_objv_tracker(&objv_tracker)
+                                           .set_attrs(&uattrs));
       if (op_ret < 0) {
         op_ret = -ERR_INTERNAL_ERROR;
       }
index 3878d0616cab1e64fa97ff22b64d2c0f0505112f..02d1a513026634f91d8eacbc2c485d3c9adfb37e 100644 (file)
@@ -91,14 +91,14 @@ void TempURLEngine::get_owner_info(const DoutPrefixProvider* dpp, const req_stat
     if (uid.tenant.empty()) {
       const rgw_user tenanted_uid(uid.id, uid.id);
 
-      if (ctl->user->get_info_by_uid(tenanted_uid, &uinfo) >= 0) {
+      if (ctl->user->get_info_by_uid(tenanted_uid, &uinfo, s->yield) >= 0) {
         /* Succeeded. */
         bucket_tenant = uinfo.user_id.tenant;
         found = true;
       }
     }
 
-    if (!found && ctl->user->get_info_by_uid(uid, &uinfo) < 0) {
+    if (!found && ctl->user->get_info_by_uid(uid, &uinfo, s->yield) < 0) {
       throw -EPERM;
     } else {
       bucket_tenant = uinfo.user_id.tenant;
@@ -121,7 +121,7 @@ void TempURLEngine::get_owner_info(const DoutPrefixProvider* dpp, const req_stat
   ldpp_dout(dpp, 20) << "temp url user (bucket owner): " << bucket_info.owner
                  << dendl;
 
-  if (ctl->user->get_info_by_uid(bucket_info.owner, &owner_info) < 0) {
+  if (ctl->user->get_info_by_uid(bucket_info.owner, &owner_info, s->yield) < 0) {
     throw -EPERM;
   }
 }
@@ -449,7 +449,7 @@ ExternalTokenEngine::authenticate(const DoutPrefixProvider* dpp,
   ldpp_dout(dpp, 10) << "swift user=" << swift_user << dendl;
 
   RGWUserInfo tmp_uinfo;
-  ret = ctl->user->get_info_by_swift(swift_user, &tmp_uinfo);
+  ret = ctl->user->get_info_by_swift(swift_user, &tmp_uinfo, s->yield);
   if (ret < 0) {
     ldpp_dout(dpp, 0) << "NOTICE: couldn't map swift user" << dendl;
     throw ret;
@@ -567,7 +567,7 @@ SignedTokenEngine::authenticate(const DoutPrefixProvider* dpp,
   }
 
   RGWUserInfo user_info;
-  ret = ctl->user->get_info_by_swift(swift_user, &user_info);
+  ret = ctl->user->get_info_by_swift(swift_user, &user_info, s->yield);
   if (ret < 0) {
     throw ret;
   }
@@ -684,7 +684,7 @@ void RGW_SWIFT_Auth_Get::execute()
 
   user_str = user;
 
-  if ((ret = store->ctl.user->get_info_by_swift(user_str, &info)) < 0)
+  if ((ret = store->ctl.user->get_info_by_swift(user_str, &info, s->yield)) < 0)
   {
     ret = -EACCES;
     goto done;
index 95c609d966771dd47a3bdfc6398c48860f1573c9..9da0785bf5072a3a2e316ab0f761b8d5b3e7ed59 100644 (file)
@@ -159,13 +159,13 @@ int rgw_store_user_info(RGWUserCtl *user_ctl,
                         bool exclusive,
                         map<string, bufferlist> *pattrs)
 {
-  return user_ctl->store_info(info, RGWUserCtl::PutParams()
-                                    .set_old_info(old_info)
-                                    .set_objv_tracker(objv_tracker)
-                                    .set_mtime(mtime)
-                                    .set_exclusive(exclusive)
-                                    .set_attrs(pattrs)
-                                    .set_yield(null_yield));
+  return user_ctl->store_info(info, null_yield,
+                              RGWUserCtl::PutParams()
+                              .set_old_info(old_info)
+                              .set_objv_tracker(objv_tracker)
+                              .set_mtime(mtime)
+                              .set_exclusive(exclusive)
+                              .set_attrs(pattrs));
 }
 
 /**
@@ -180,12 +180,12 @@ int rgw_get_user_info_by_uid(RGWUserCtl *user_ctl,
                              rgw_cache_entry_info * const cache_info,
                              map<string, bufferlist> * const pattrs)
 {
-  return user_ctl->get_info_by_uid(uid, &info, RGWUserCtl::GetParams()
-                                        .set_objv_tracker(objv_tracker)
-                                        .set_mtime(pmtime)
-                                        .set_cache_info(cache_info)
-                                        .set_attrs(pattrs)
-                                        .set_yield(null_yield));
+  return user_ctl->get_info_by_uid(uid, &info, null_yield,
+                                   RGWUserCtl::GetParams()
+                                   .set_objv_tracker(objv_tracker)
+                                   .set_mtime(pmtime)
+                                   .set_cache_info(cache_info)
+                                   .set_attrs(pattrs));
 }
 
 /**
@@ -195,10 +195,10 @@ int rgw_get_user_info_by_uid(RGWUserCtl *user_ctl,
 int rgw_get_user_info_by_email(RGWUserCtl *user_ctl, string& email, RGWUserInfo& info,
                                RGWObjVersionTracker *objv_tracker, real_time *pmtime)
 {
-  return user_ctl->get_info_by_email(email, &info, RGWUserCtl::GetParams()
-                                            .set_objv_tracker(objv_tracker)
-                                            .set_mtime(pmtime)
-                                            .set_yield(null_yield));
+  return user_ctl->get_info_by_email(email, &info, null_yield,
+                                     RGWUserCtl::GetParams()
+                                     .set_objv_tracker(objv_tracker)
+                                     .set_mtime(pmtime));
 }
 
 /**
@@ -211,10 +211,10 @@ extern int rgw_get_user_info_by_swift(RGWUserCtl *user_ctl,
                                       RGWObjVersionTracker * const objv_tracker,
                                       real_time * const pmtime)
 {
-  return user_ctl->get_info_by_swift(swift_name, &info, RGWUserCtl::GetParams()
-                                                 .set_objv_tracker(objv_tracker)
-                                                 .set_mtime(pmtime)
-                                                 .set_yield(null_yield));
+  return user_ctl->get_info_by_swift(swift_name, &info, null_yield,
+                                     RGWUserCtl::GetParams()
+                                     .set_objv_tracker(objv_tracker)
+                                     .set_mtime(pmtime));
 }
 
 /**
@@ -227,10 +227,10 @@ extern int rgw_get_user_info_by_access_key(RGWUserCtl *user_ctl,
                                            RGWObjVersionTracker* objv_tracker,
                                            real_time *pmtime)
 {
-  return user_ctl->get_info_by_access_key(access_key, &info, RGWUserCtl::GetParams()
-                                                      .set_objv_tracker(objv_tracker)
-                                                      .set_mtime(pmtime)
-                                                      .set_yield(null_yield));
+  return user_ctl->get_info_by_access_key(access_key, &info, null_yield,
+                                          RGWUserCtl::GetParams()
+                                          .set_objv_tracker(objv_tracker)
+                                          .set_mtime(pmtime));
 }
 
 static bool char_is_unreserved_url(char c)
@@ -1771,8 +1771,8 @@ int RGWUser::execute_remove(RGWUserAdminOpState& op_state, std::string *err_msg,
 
   } while (is_truncated);
 
-  ret = user_ctl->remove_info(user_info, RGWUserCtl::RemoveParams()
-                                         .set_objv_tracker(&op_state.objv));
+  ret = user_ctl->remove_info(user_info, y, RGWUserCtl::RemoveParams()
+                                            .set_objv_tracker(&op_state.objv));
   if (ret < 0) {
     set_err_msg(err_msg, "unable to remove user from RADOS");
     return ret;
@@ -2558,6 +2558,7 @@ public:
 
 int RGWUserCtl::get_info_by_uid(const rgw_user& uid,
                                 RGWUserInfo *info,
+                                optional_yield y,
                                 ceph::optional_ref_default<GetParams> params)
 
 {
@@ -2569,11 +2570,13 @@ int RGWUserCtl::get_info_by_uid(const rgw_user& uid,
                                     params->mtime,
                                     params->cache_info,
                                     params->attrs,
-                                    params->y);
+                                    y);
   });
 }
 
-int RGWUserCtl::get_info_by_email(const string& email, RGWUserInfo *info,
+int RGWUserCtl::get_info_by_email(const string& email,
+                                  RGWUserInfo *info,
+                                  optional_yield y,
                                   ceph::optional_ref_default<GetParams> params)
 {
   return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
@@ -2581,12 +2584,13 @@ int RGWUserCtl::get_info_by_email(const string& email, RGWUserInfo *info,
                                             info,
                                             params->objv_tracker,
                                             params->mtime,
-                                            params->y);
+                                            y);
   });
 }
 
 int RGWUserCtl::get_info_by_swift(const string& swift_name,
                                   RGWUserInfo *info,
+                                  optional_yield y,
                                   ceph::optional_ref_default<GetParams> params)
 {
   return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
@@ -2594,12 +2598,13 @@ int RGWUserCtl::get_info_by_swift(const string& swift_name,
                                             info,
                                             params->objv_tracker,
                                             params->mtime,
-                                            params->y);
+                                            y);
   });
 }
 
 int RGWUserCtl::get_info_by_access_key(const string& access_key,
                                        RGWUserInfo *info,
+                                       optional_yield y,
                                        ceph::optional_ref_default<GetParams> params)
 {
   return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
@@ -2607,7 +2612,7 @@ int RGWUserCtl::get_info_by_access_key(const string& access_key,
                                                  info,
                                                  params->objv_tracker,
                                                  params->mtime,
-                                                 params->y);
+                                                 y);
   });
 }
 
@@ -2618,13 +2623,13 @@ int RGWUserCtl::get_attrs_by_uid(const rgw_user& user_id,
 {
   RGWUserInfo user_info;
 
-  return get_info_by_uid(user_id, &user_info, RGWUserCtl::GetParams()
+  return get_info_by_uid(user_id, &user_info, y, RGWUserCtl::GetParams()
                          .set_attrs(pattrs)
-                         .set_yield(y)
                          .set_objv_tracker(objv_tracker));
 }
 
-int RGWUserCtl::store_info(const RGWUserInfo& info, ceph::optional_ref_default<PutParams> params)
+int RGWUserCtl::store_info(const RGWUserInfo& info, optional_yield y,
+                           ceph::optional_ref_default<PutParams> params)
 {
   string key = RGWSI_User::get_meta_key(info.user_id);
 
@@ -2635,11 +2640,12 @@ int RGWUserCtl::store_info(const RGWUserInfo& info, ceph::optional_ref_default<P
                                      params->mtime,
                                      params->exclusive,
                                      params->attrs,
-                                     params->y);
+                                     y);
   });
 }
 
-int RGWUserCtl::remove_info(const RGWUserInfo& info, ceph::optional_ref_default<RemoveParams> params)
+int RGWUserCtl::remove_info(const RGWUserInfo& info, optional_yield y,
+                            ceph::optional_ref_default<RemoveParams> params)
 
 {
   string key = RGWSI_User::get_meta_key(info.user_id);
@@ -2647,7 +2653,7 @@ int RGWUserCtl::remove_info(const RGWUserInfo& info, ceph::optional_ref_default<
   return be_handler->call([&](RGWSI_MetaBackend_Handler::Op *op) {
     return svc.user->remove_user_info(op->ctx(), info,
                                       params->objv_tracker,
-                                      params->y);
+                                      y);
   });
 }
 
index 086475105408d877a9502cfef3393cb1c57b4f05..6f5a6823a5e3524f98a87acb13d3d5ff3eaed1ad 100644 (file)
@@ -826,7 +826,6 @@ public:
     ceph::real_time *mtime{nullptr};
     rgw_cache_entry_info *cache_info{nullptr};
     map<string, bufferlist> *attrs{nullptr};
-    optional_yield y{null_yield};
 
     GetParams& set_objv_tracker(RGWObjVersionTracker *_objv_tracker) {
       objv_tracker = _objv_tracker;
@@ -847,11 +846,6 @@ public:
       attrs = _attrs;
       return *this;
     }
-
-    GetParams& set_yield(optional_yield _y) {
-      y = _y;
-      return *this;
-    }
   };
 
   struct PutParams {
@@ -860,7 +854,6 @@ public:
     ceph::real_time mtime;
     bool exclusive{false};
     map<string, bufferlist> *attrs;
-    optional_yield y{null_yield};
 
     PutParams& set_old_info(RGWUserInfo *_info) {
       old_info = _info;
@@ -886,39 +879,35 @@ public:
       attrs = _attrs;
       return *this;
     }
-
-    PutParams& set_yield(optional_yield _y) {
-      y = _y;
-      return *this;
-    }
   };
 
   struct RemoveParams {
     RGWObjVersionTracker *objv_tracker{nullptr};
-    optional_yield y{null_yield};
 
     RemoveParams& set_objv_tracker(RGWObjVersionTracker *_objv_tracker) {
       objv_tracker = _objv_tracker;
       return *this;
     }
-    RemoveParams& set_yield(optional_yield _y) {
-      y = _y;
-      return *this;
-    }
   };
 
-  int get_info_by_uid(const rgw_user& uid, RGWUserInfo *info, ceph::optional_ref_default<GetParams> params = std::nullopt);
-  int get_info_by_email(const string& email, RGWUserInfo *info, ceph::optional_ref_default<GetParams> params = std::nullopt);
-  int get_info_by_swift(const string& swift_name, RGWUserInfo *info, ceph::optional_ref_default<GetParams> params = std::nullopt);
-  int get_info_by_access_key(const string& access_key, RGWUserInfo *info, ceph::optional_ref_default<GetParams> params = std::nullopt);
+  int get_info_by_uid(const rgw_user& uid, RGWUserInfo *info, optional_yield y,
+                      ceph::optional_ref_default<GetParams> params = std::nullopt);
+  int get_info_by_email(const string& email, RGWUserInfo *info, optional_yield y,
+                        ceph::optional_ref_default<GetParams> params = std::nullopt);
+  int get_info_by_swift(const string& swift_name, RGWUserInfo *info, optional_yield y,
+                        ceph::optional_ref_default<GetParams> params = std::nullopt);
+  int get_info_by_access_key(const string& access_key, RGWUserInfo *info, optional_yield y,
+                             ceph::optional_ref_default<GetParams> params = std::nullopt);
 
   int get_attrs_by_uid(const rgw_user& user_id,
                        map<string, bufferlist> *attrs,
                        optional_yield y,
                        RGWObjVersionTracker *objv_tracker = nullptr);
 
-  int store_info(const RGWUserInfo& info, ceph::optional_ref_default<PutParams> params);
-  int remove_info(const RGWUserInfo& info, ceph::optional_ref_default<RemoveParams> params);
+  int store_info(const RGWUserInfo& info, optional_yield y,
+                 ceph::optional_ref_default<PutParams> params);
+  int remove_info(const RGWUserInfo& info, optional_yield y,
+                  ceph::optional_ref_default<RemoveParams> params);
 
   int add_bucket(const rgw_user& user,
                  const rgw_bucket& bucket,