]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_op.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rgw / rgw_op.h
index 494e6c1611a084a5f45a7747880ebe3f33194b4c..33ed580782dff30d00f3b7a41f77a40c597463a2 100644 (file)
@@ -25,6 +25,7 @@
 #include <boost/optional.hpp>
 #include <boost/utility/in_place_factory.hpp>
 #include <boost/function.hpp>
+#include <boost/container/flat_map.hpp>
 
 #include "common/armor.h"
 #include "common/mime.h"
@@ -48,7 +49,6 @@
 #include "rgw_torrent.h"
 #include "rgw_tag.h"
 #include "rgw_object_lock.h"
-#include "cls/lock/cls_lock_client.h"
 #include "cls/rgw/cls_rgw_client.h"
 #include "rgw_public_access.h"
 
@@ -75,18 +75,19 @@ class StrategyRegistry;
 }
 
 int rgw_op_get_bucket_policy_from_attr(CephContext *cct,
-                                      rgw::sal::RGWRadosStore *store,
+                                      rgw::sal::RGWStore *store,
                                        RGWBucketInfo& bucket_info,
                                        map<string, bufferlist>& bucket_attrs,
-                                       RGWAccessControlPolicy *policy);
+                                       RGWAccessControlPolicy *policy,
+                                      optional_yield y);
 
 class RGWHandler {
 protected:
   rgw::sal::RGWRadosStore* store{nullptr};
   struct req_state *s{nullptr};
 
-  int do_init_permissions();
-  int do_read_permissions(RGWOp* op, bool only_bucket);
+  int do_init_permissions(optional_yield y);
+  int do_read_permissions(RGWOp* op, bool only_bucket, optional_yield y);
 
 public:
   RGWHandler() {}
@@ -96,19 +97,19 @@ public:
                    struct req_state* _s,
                    rgw::io::BasicClient* cio);
 
-  virtual int init_permissions(RGWOp*) {
+  virtual int init_permissions(RGWOp*, optional_yield y) {
     return 0;
   }
 
-  virtual int retarget(RGWOp* op, RGWOp** new_op) {
+  virtual int retarget(RGWOp* op, RGWOp** new_op, optional_yield) {
     *new_op = op;
     return 0;
   }
 
-  virtual int read_permissions(RGWOp* op) = 0;
-  virtual int authorize(const DoutPrefixProvider* dpp) = 0;
-  virtual int postauth_init() = 0;
-  virtual int error_handler(int err_no, std::string* error_content);
+  virtual int read_permissions(RGWOp* op, optional_yield y) = 0;
+  virtual int authorize(const DoutPrefixProvider* dpp, optional_yield y) = 0;
+  virtual int postauth_init(optional_yield y) = 0;
+  virtual int error_handler(int err_no, std::string* error_content, optional_yield y);
   virtual void dump(const string& code, const string& message) const {}
 
   virtual bool supports_quota() {
@@ -152,7 +153,7 @@ public:
 
   int get_ret() const { return op_ret; }
 
-  virtual int init_processing() {
+  virtual int init_processing(optional_yield y) {
     if (dialect_handler->supports_quota()) {
       op_ret = init_quota();
       if (op_ret < 0)
@@ -182,14 +183,14 @@ public:
    * authentication. The alternative is to duplicate parts of the method-
    * dispatch logic in RGWHandler::authorize() and pollute it with a lot
    * of special cases. */
-  virtual int verify_requester(const rgw::auth::StrategyRegistry& auth_registry) {
+  virtual int verify_requester(const rgw::auth::StrategyRegistry& auth_registry, optional_yield y) {
     /* TODO(rzarzynski): rename RGWHandler::authorize to generic_authenticate. */
-    return dialect_handler->authorize(this);
+    return dialect_handler->authorize(this, y);
   }
-  virtual int verify_permission() = 0;
+  virtual int verify_permission(optional_yield y) = 0;
   virtual int verify_op_mask();
   virtual void pre_exec() {}
-  virtual void execute() = 0;
+  virtual void execute(optional_yield y) = 0;
   virtual void send_response() {}
   virtual void complete() {
     send_response();
@@ -199,7 +200,7 @@ public:
 
   virtual uint32_t op_mask() { return 0; }
 
-  virtual int error_handler(int err_no, string *error_content);
+  virtual int error_handler(int err_no, string *error_content, optional_yield y);
 
   // implements DoutPrefixProvider
   std::ostream& gen_prefix(std::ostream& out) const override;
@@ -274,14 +275,13 @@ protected:
   ceph::real_time unmod_time;
   ceph::real_time *mod_ptr;
   ceph::real_time *unmod_ptr;
-  map<string, bufferlist> attrs;
+  rgw::sal::RGWAttrs attrs;
   bool get_data;
   bool partial_content;
   bool ignore_invalid_range;
   bool range_parsed;
   bool skip_manifest;
   bool skip_decrypt{false};
-  rgw_obj obj;
   utime_t gc_invalidate_time;
   bool is_slo;
   string lo_etag;
@@ -337,25 +337,25 @@ public:
     this->get_data = get_data;
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
   int parse_range();
   int read_user_manifest_part(
-    rgw_bucket& bucket,
+    rgw::sal::RGWBucket* bucket,
     const rgw_bucket_dir_entry& ent,
     RGWAccessControlPolicy * const bucket_acl,
     const boost::optional<rgw::IAM::Policy>& bucket_policy,
     const off_t start_ofs,
     const off_t end_ofs,
     bool swift_slo);
-  int handle_user_manifest(const char *prefix);
-  int handle_slo_manifest(bufferlist& bl);
+  int handle_user_manifest(const char *prefix, optional_yield y);
+  int handle_slo_manifest(bufferlist& bl, optional_yield y);
 
   int get_data_cb(bufferlist& bl, off_t ofs, off_t len);
 
-  virtual int get_params() = 0;
-  virtual int send_response_data_error() = 0;
+  virtual int get_params(optional_yield y) = 0;
+  virtual int send_response_data_error(optional_yield y) = 0;
   virtual int send_response_data(bufferlist& bl, off_t ofs, off_t len) = 0;
 
   const char* name() const override { return "get_obj"; }
@@ -389,8 +389,8 @@ class RGWGetObjTags : public RGWOp {
   bufferlist tags_bl;
   bool has_tags{false};
  public:
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
   void pre_exec() override;
 
   virtual void send_response_data(bufferlist& bl) = 0;
@@ -404,11 +404,11 @@ class RGWPutObjTags : public RGWOp {
  protected:
   bufferlist tags_bl;
  public:
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   virtual void send_response() override = 0;
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_obj_tags"; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
   RGWOpType get_type() override { return RGW_OP_PUT_OBJ_TAGGING; }
@@ -418,8 +418,8 @@ class RGWPutObjTags : public RGWOp {
 class RGWDeleteObjTags: public RGWOp {
  public:
   void pre_exec() override;
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "delete_obj_tags"; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; }
@@ -431,8 +431,8 @@ protected:
   bufferlist tags_bl;
   bool has_tags{false};
 public:
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
   void pre_exec() override;
 
   virtual void send_response_data(bufferlist& bl) = 0;
@@ -446,11 +446,11 @@ protected:
   bufferlist tags_bl;
   bufferlist in_data;
 public:
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   virtual void send_response() override = 0;
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_bucket_tags"; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
   RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_TAGGING; }
@@ -459,8 +459,8 @@ public:
 class RGWDeleteBucketTags : public RGWOp {
 public:
   void pre_exec() override;
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "delete_bucket_tags"; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; }
@@ -471,8 +471,8 @@ struct rgw_sync_policy_group;
 
 class RGWGetBucketReplication : public RGWOp {
 public:
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
   void pre_exec() override;
 
   virtual void send_response_data() = 0;
@@ -486,11 +486,11 @@ protected:
   bufferlist in_data;
   std::vector<rgw_sync_policy_group> sync_policy_groups;
 public:
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   virtual void send_response() override = 0;
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_bucket_replication"; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
   RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_REPLICATION; }
@@ -501,8 +501,8 @@ protected:
   virtual void update_sync_policy(rgw_sync_policy_info *policy) = 0;
 public:
   void pre_exec() override;
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "delete_bucket_replication"; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; }
@@ -554,9 +554,10 @@ public:
 
     bool verify_permission(RGWBucketInfo& binfo,
                            map<string, bufferlist>& battrs,
-                           ACLOwner& bucket_owner /* out */);
-    bool delete_single(const acct_path_t& path);
-    bool delete_chunk(const std::list<acct_path_t>& paths);
+                           ACLOwner& bucket_owner /* out */,
+                          optional_yield y);
+    bool delete_single(const acct_path_t& path, optional_yield y);
+    bool delete_chunk(const std::list<acct_path_t>& paths, optional_yield y);
   };
   /* End of Deleter subclass */
 
@@ -570,9 +571,9 @@ public:
     : deleter(nullptr) {
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   virtual int get_data(std::list<acct_path_t>& items,
                        bool * is_truncated) = 0;
@@ -620,7 +621,7 @@ protected:
   virtual void send_response() override = 0;
 
   boost::optional<std::pair<std::string, rgw_obj_key>>
-  parse_path(const boost::string_ref& path);
+  parse_path(const std::string_view& path);
   
   std::pair<std::string, std::string>
   handle_upload_path(struct req_state *s);
@@ -628,13 +629,15 @@ protected:
   bool handle_file_verify_permission(RGWBucketInfo& binfo,
                                     const rgw_obj& obj,
                                     std::map<std::string, ceph::bufferlist>& battrs,
-                                     ACLOwner& bucket_owner /* out */);
-  int handle_file(boost::string_ref path,
+                                     ACLOwner& bucket_owner /* out */,
+                                    optional_yield y);
+  int handle_file(std::string_view path,
                   size_t size,
-                  AlignedStreamGetter& body);
+                  AlignedStreamGetter& body,
+                 optional_yield y);
 
-  int handle_dir_verify_permission();
-  int handle_dir(boost::string_ref path);
+  int handle_dir_verify_permission(optional_yield y);
+  int handle_dir(std::string_view path, optional_yield y);
 
 public:
   RGWBulkUploadOp()
@@ -645,9 +648,9 @@ public:
             struct req_state* const s,
             RGWHandler* const h) override;
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "bulk_upload"; }
 
@@ -753,10 +756,10 @@ public:
       is_truncated(false) {
   }
 
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   virtual void handle_listing_chunk(rgw::sal::RGWBucketList&& buckets) {
     /* The default implementation, used by e.g. S3, just generates a new
      * part of listing and sends it client immediately. Swift can behave
@@ -794,10 +797,10 @@ public:
   RGWGetUsage() : sent_data(false), show_log_entries(true), show_log_sum(true){
   }
 
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override {}
 
   virtual bool should_get_stats() { return false; }
@@ -814,8 +817,8 @@ protected:
 public:
   RGWStatAccount() = default;
 
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "stat_account"; }
@@ -825,7 +828,6 @@ public:
 
 class RGWListBucket : public RGWOp {
 protected:
-  rgw::sal::RGWBucket* bucket;
   string prefix;
   rgw_obj_key marker; 
   rgw_obj_key next_marker; 
@@ -847,19 +849,17 @@ protected:
   int parse_max_keys();
 
 public:
-  RGWListBucket() : bucket(nullptr), list_versions(false), max(0),
+  RGWListBucket() : list_versions(false), max(0),
                     default_max(0), is_truncated(false),
                    allow_unordered(false), shard_id(-1) {}
-  ~RGWListBucket() { delete bucket; }
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void init(rgw::sal::RGWRadosStore *store, struct req_state *s, RGWHandler *h) override {
     RGWOp::init(store, s, h);
-    bucket = new rgw::sal::RGWRadosBucket(store, *s->user, s->bucket);
   }
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "list_bucket"; }
   RGWOpType get_type() override { return RGW_OP_LIST_BUCKET; }
@@ -870,8 +870,8 @@ public:
 class RGWGetBucketLogging : public RGWOp {
 public:
   RGWGetBucketLogging() {}
-  int verify_permission() override;
-  void execute() override { }
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield) override { }
 
   void send_response() override = 0;
   const char* name() const override { return "get_bucket_logging"; }
@@ -883,8 +883,8 @@ class RGWGetBucketLocation : public RGWOp {
 public:
   RGWGetBucketLocation() {}
   ~RGWGetBucketLocation() override {}
-  int verify_permission() override;
-  void execute() override { }
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield) override { }
 
   void send_response() override = 0;
   const char* name() const override { return "get_bucket_location"; }
@@ -900,9 +900,9 @@ protected:
 public:
   RGWGetBucketVersioning() = default;
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "get_bucket_versioning"; }
@@ -926,11 +926,11 @@ protected:
 public:
   RGWSetBucketVersioning() : versioning_status(VersioningNotChanged) {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() { return 0; }
+  virtual int get_params(optional_yield y) { return 0; }
 
   void send_response() override = 0;
   const char* name() const override { return "set_bucket_versioning"; }
@@ -942,9 +942,9 @@ class RGWGetBucketWebsite : public RGWOp {
 public:
   RGWGetBucketWebsite() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "get_bucket_website"; }
@@ -959,11 +959,11 @@ protected:
 public:
   RGWSetBucketWebsite() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() { return 0; }
+  virtual int get_params(optional_yield y) { return 0; }
 
   void send_response() override = 0;
   const char* name() const override { return "set_bucket_website"; }
@@ -975,9 +975,9 @@ class RGWDeleteBucketWebsite : public RGWOp {
 public:
   RGWDeleteBucketWebsite() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "delete_bucket_website"; }
@@ -987,15 +987,12 @@ public:
 
 class RGWStatBucket : public RGWOp {
 protected:
-  rgw::sal::RGWBucket* bucket;
+  std::unique_ptr<rgw::sal::RGWBucket> bucket;
 
 public:
-  RGWStatBucket() : bucket(nullptr) {}
-  ~RGWStatBucket() override { delete bucket; }
-
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "stat_bucket"; }
@@ -1029,16 +1026,16 @@ public:
     attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
   void init(rgw::sal::RGWRadosStore *store, struct req_state *s, RGWHandler *h) override {
     RGWOp::init(store, s, h);
     policy.set_ctx(s->cct);
     relaxed_region_enforcement =
        s->cct->_conf.get_val<bool>("rgw_relaxed_region_enforcement");
   }
-  virtual int get_params() { return 0; }
+  virtual int get_params(optional_yield y) { return 0; }
   void send_response() override = 0;
   const char* name() const override { return "create_bucket"; }
   RGWOpType get_type() override { return RGW_OP_CREATE_BUCKET; }
@@ -1052,9 +1049,9 @@ protected:
 public:
   RGWDeleteBucket() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "delete_bucket"; }
@@ -1138,7 +1135,7 @@ protected:
   std::unique_ptr <RGWObjTags> obj_tags;
   const char *dlo_manifest;
   RGWSLOInfo *slo_info;
-  map<string, bufferlist> attrs;
+  rgw::sal::RGWAttrs attrs;
   ceph::real_time mtime;
   uint64_t olh_epoch;
   string version_id;
@@ -1190,13 +1187,15 @@ public:
     policy.set_ctx(s->cct);
   }
 
+  virtual int init_processing(optional_yield y) override;
+
   void emplace_attr(std::string&& key, buffer::list&& bl) {
     attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   /* this is for cases when copying data from other object */
   virtual int get_decrypt_filter(std::unique_ptr<RGWGetObj_Filter>* filter,
@@ -1214,7 +1213,7 @@ public:
   int get_data_cb(bufferlist& bl, off_t bl_ofs, off_t bl_len);
   int get_data(const off_t fst, const off_t lst, bufferlist& bl);
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   virtual int get_data(bufferlist& bl) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_obj"; }
@@ -1260,15 +1259,15 @@ public:
     policy.set_ctx(s->cct);
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   virtual int get_encrypt_filter(std::unique_ptr<rgw::putobj::DataProcessor> *filter,
                                  rgw::putobj::DataProcessor *cb) {
     return 0;
   }
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   virtual int get_data(ceph::bufferlist& bl, bool& again) = 0;
   void send_response() override = 0;
   const char* name() const override { return "post_obj"; }
@@ -1300,12 +1299,12 @@ public:
     RGWOp::init(store, s, h);
     policy.set_ctx(s->cct);
   }
-  int init_processing() override;
-  int verify_permission() override;
+  int init_processing(optional_yield y) override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override { }
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   virtual void filter_out_temp_url(map<string, bufferlist>& add_attrs,
                                    const set<string>& rmattr_names,
@@ -1317,7 +1316,7 @@ public:
 
 class RGWPutMetadataBucket : public RGWOp {
 protected:
-  map<string, buffer::list> attrs;
+  rgw::sal::RGWAttrs attrs;
   set<string> rmattr_names;
   bool has_policy, has_cors;
   uint32_t policy_rw_mask;
@@ -1340,11 +1339,11 @@ public:
     policy.set_ctx(s->cct);
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_bucket_metadata"; }
   RGWOpType get_type() override { return RGW_OP_PUT_METADATA_BUCKET; }
@@ -1366,11 +1365,11 @@ public:
     RGWOp::init(store, s, h);
     policy.set_ctx(s->cct);
   }
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_obj_metadata"; }
   RGWOpType get_type() override { return RGW_OP_PUT_METADATA_OBJECT; }
@@ -1399,12 +1398,12 @@ public:
       bypass_governance_mode(false) {
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
-  int handle_slo_manifest(bufferlist& bl);
+  void execute(optional_yield y) override;
+  int handle_slo_manifest(bufferlist& bl, optional_yield y);
 
-  virtual int get_params() { return 0; }
+  virtual int get_params(optional_yield y) { return 0; }
   void send_response() override = 0;
   const char* name() const override { return "delete_obj"; }
   RGWOpType get_type() override { return RGW_OP_DELETE_OBJ; }
@@ -1432,18 +1431,16 @@ protected:
   ceph::real_time unmod_time;
   ceph::real_time *mod_ptr;
   ceph::real_time *unmod_ptr;
-  map<string, buffer::list> attrs;
-  string src_tenant_name, src_bucket_name;
-  rgw_bucket src_bucket;
-  rgw_obj_key src_object;
-  string dest_tenant_name, dest_bucket_name;
-  rgw_bucket dest_bucket;
-  string dest_object;
+  rgw::sal::RGWAttrs attrs;
+  string src_tenant_name, src_bucket_name, src_obj_name;
+  std::unique_ptr<rgw::sal::RGWBucket> src_bucket;
+  std::unique_ptr<rgw::sal::RGWObject> src_object;
+  string dest_tenant_name, dest_bucket_name, dest_obj_name;
+  std::unique_ptr<rgw::sal::RGWBucket> dest_bucket;
+  std::unique_ptr<rgw::sal::RGWObject> dest_object;
   ceph::real_time src_mtime;
   ceph::real_time mtime;
-  RGWRados::AttrsMod attrs_mod;
-  RGWBucketInfo src_bucket_info;
-  RGWBucketInfo dest_bucket_info;
+  rgw::sal::AttrsMod attrs_mod;
   string source_zone;
   string etag;
 
@@ -1470,13 +1467,13 @@ public:
     end = -1;
     mod_ptr = NULL;
     unmod_ptr = NULL;
-    attrs_mod = RGWRados::ATTRSMOD_NONE;
+    attrs_mod = rgw::sal::ATTRSMOD_NONE;
     last_ofs = 0;
     olh_epoch = 0;
     copy_if_newer = false;
   }
 
-  static bool parse_copy_location(const boost::string_view& src,
+  static bool parse_copy_location(const std::string_view& src,
                                   string& bucket_name,
                                   rgw_obj_key& object);
 
@@ -1488,9 +1485,9 @@ public:
     RGWOp::init(store, s, h);
     dest_policy.set_ctx(s->cct);
   }
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
   void progress_cb(off_t ofs);
 
   virtual int check_storage_class(const rgw_placement_rule& src_placement) {
@@ -1498,7 +1495,7 @@ public:
   }
 
   virtual int init_dest_policy() { return 0; }
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   virtual void send_partial_response(off_t ofs) {}
   void send_response() override = 0;
   const char* name() const override { return "copy_obj"; }
@@ -1514,9 +1511,9 @@ protected:
 public:
   RGWGetACLs() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "get_acls"; }
@@ -1533,12 +1530,12 @@ public:
   RGWPutACLs() {}
   ~RGWPutACLs() override {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   virtual int get_policy_from_state(rgw::sal::RGWRadosStore *store, struct req_state *s, stringstream& ss) { return 0; }
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_acls"; }
   RGWOpType get_type() override { return RGW_OP_PUT_ACLS; }
@@ -1552,9 +1549,9 @@ public:
   RGWGetLC() { }
   ~RGWGetLC() override { }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override = 0;
+  void execute(optional_yield) override = 0;
 
   void send_response() override = 0;
   const char* name() const override { return "get_lifecycle"; }
@@ -1583,12 +1580,12 @@ public:
     cookie = buf;
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
 //  virtual int get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss) { return 0; }
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_lifecycle"; }
   RGWOpType get_type() override { return RGW_OP_PUT_LC; }
@@ -1598,9 +1595,9 @@ public:
 class RGWDeleteLC : public RGWOp {
 public:
   RGWDeleteLC() = default;
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "delete_lifecycle"; }
@@ -1614,8 +1611,8 @@ protected:
 public:
   RGWGetCORS() {}
 
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "get_cors"; }
@@ -1632,10 +1629,10 @@ public:
   RGWPutCORS() {}
   ~RGWPutCORS() override {}
 
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "put_cors"; }
   RGWOpType get_type() override { return RGW_OP_PUT_CORS; }
@@ -1648,8 +1645,8 @@ protected:
 public:
   RGWDeleteCORS() {}
 
-  int verify_permission() override;
-  void execute() override;
+  int verify_permission(optional_yield y) override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "delete_cors"; }
@@ -1667,9 +1664,9 @@ public:
                      req_hdrs(NULL), req_meth(NULL) {
   }
 
-  int verify_permission() override {return 0;}
+  int verify_permission(optional_yield y) override {return 0;}
   int validate_cors_request(RGWCORSConfiguration *cc);
-  void execute() override;
+  void execute(optional_yield y) override;
   void get_response_params(string& allowed_hdrs, string& exp_hdrs, unsigned *max_age);
   void send_response() override = 0;
   const char* name() const override { return "options_cors"; }
@@ -1684,9 +1681,9 @@ protected:
 public:
   RGWGetRequestPayment() : requester_pays(0) {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "get_request_payment"; }
@@ -1701,11 +1698,11 @@ protected:
 public:
  RGWSetRequestPayment() : requester_pays(false) {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() { return 0; }
+  virtual int get_params(optional_yield y) { return 0; }
 
   void send_response() override = 0;
   const char* name() const override { return "set_request_payment"; }
@@ -1726,11 +1723,11 @@ public:
     RGWOp::init(store, s, h);
     policy.set_ctx(s->cct);
   }
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "init_multipart"; }
   RGWOpType get_type() override { return RGW_OP_INIT_MULTIPART; }
@@ -1744,38 +1741,18 @@ protected:
   string etag;
   string version_id;
   bufferlist data;
-
-  struct MPSerializer {
-    librados::IoCtx ioctx;
-    rados::cls::lock::Lock lock;
-    librados::ObjectWriteOperation op;
-    std::string oid;
-    bool locked;
-
-    MPSerializer() : lock("RGWCompleteMultipart"), locked(false)
-      {}
-
-    int try_lock(const std::string& oid, utime_t dur);
-
-    int unlock() {
-      return lock.unlock(&ioctx, oid);
-    }
-
-    void clear_locked() {
-      locked = false;
-    }
-  } serializer;
+  rgw::sal::MPSerializer* serializer;
 
 public:
-  RGWCompleteMultipart() {}
-  ~RGWCompleteMultipart() override {}
+  RGWCompleteMultipart() : serializer(nullptr) {}
+  ~RGWCompleteMultipart() override { delete serializer; }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
   void complete() override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "complete_multipart"; }
   RGWOpType get_type() override { return RGW_OP_COMPLETE_MULTIPART; }
@@ -1786,9 +1763,9 @@ class RGWAbortMultipart : public RGWOp {
 public:
   RGWAbortMultipart() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   void send_response() override = 0;
   const char* name() const override { return "abort_multipart"; }
@@ -1816,11 +1793,11 @@ public:
     RGWOp::init(store, s, h);
     policy = RGWAccessControlPolicy(s->cct);
   }
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "list_multipart"; }
   RGWOpType get_type() override { return RGW_OP_LIST_MULTIPART; }
@@ -1864,11 +1841,11 @@ public:
     max_uploads = default_max;
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "list_bucket_multiparts"; }
   RGWOpType get_type() override { return RGW_OP_LIST_BUCKET_MULTIPARTS; }
@@ -1881,11 +1858,11 @@ public:
   RGWGetCrossDomainPolicy() = default;
   ~RGWGetCrossDomainPolicy() override = default;
 
-  int verify_permission() override {
+  int verify_permission(optional_yield) override {
     return 0;
   }
 
-  void execute() override {
+  void execute(optional_yield) override {
     op_ret = 0;
   }
 
@@ -1906,11 +1883,11 @@ public:
   RGWGetHealthCheck() = default;
   ~RGWGetHealthCheck() override = default;
 
-  int verify_permission() override {
+  int verify_permission(optional_yield) override {
     return 0;
   }
 
-  void execute() override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "get_health_check"; }
 
@@ -1927,21 +1904,26 @@ public:
 class RGWDeleteMultiObj : public RGWOp {
 protected:
   bufferlist data;
-  rgw_bucket bucket;
+  rgw::sal::RGWBucket* bucket;
   bool quiet;
   bool status_dumped;
   bool acl_allowed = false;
+  bool bypass_perm;
+  bool bypass_governance_mode;
+
 
 public:
   RGWDeleteMultiObj() {
     quiet = false;
     status_dumped = false;
+    bypass_perm = true;
+    bypass_governance_mode = false;
   }
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   virtual void send_status() = 0;
   virtual void begin_response() = 0;
   virtual void send_partial_response(rgw_obj_key& key, bool delete_marker,
@@ -1957,15 +1939,15 @@ public:
   RGWInfo() = default;
   ~RGWInfo() override = default;
 
-  int verify_permission() override { return 0; }
+  int verify_permission(optional_yield) override { return 0; }
   const char* name() const override { return "get info"; }
   RGWOpType get_type() override { return RGW_OP_GET_INFO; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
 };
 
-extern int rgw_build_bucket_policies(rgw::sal::RGWRadosStore* store, struct req_state* s);
+extern int rgw_build_bucket_policies(rgw::sal::RGWRadosStore* store, struct req_state* s, optional_yield y);
 extern int rgw_build_object_policies(rgw::sal::RGWRadosStore *store, struct req_state *s,
-                                    bool prefetch_data);
+                                    bool prefetch_data, optional_yield y);
 extern void rgw_build_iam_environment(rgw::sal::RGWRadosStore* store,
                                                                          struct req_state* s);
 extern vector<rgw::IAM::Policy> get_iam_user_policy_from_attr(CephContext* cct,
@@ -1973,9 +1955,9 @@ extern vector<rgw::IAM::Policy> get_iam_user_policy_from_attr(CephContext* cct,
                         map<string, bufferlist>& attrs,
                         const string& tenant);
 
-static inline int get_system_versioning_params(req_state *s,
-                                             uint64_t *olh_epoch,
-                                             string *version_id)
+inline int get_system_versioning_params(req_state *s,
+                                       uint64_t *olh_epoch,
+                                       string *version_id)
 {
   if (!s->system_request) {
     return 0;
@@ -2031,12 +2013,12 @@ static inline void format_xattr(std::string &xattr)
  * On failure returns a negative error code.
  *
  */
-static inline int rgw_get_request_metadata(CephContext* const cct,
-                                           struct req_info& info,
-                                           std::map<std::string, ceph::bufferlist>& attrs,
-                                           const bool allow_empty_attrs = true)
+inline int rgw_get_request_metadata(CephContext* const cct,
+                                   struct req_info& info,
+                                   std::map<std::string, ceph::bufferlist>& attrs,
+                                   const bool allow_empty_attrs = true)
 {
-  static const std::set<std::string> blacklisted_headers = {
+  static const std::set<std::string> blocklisted_headers = {
       "x-amz-server-side-encryption-customer-algorithm",
       "x-amz-server-side-encryption-customer-key",
       "x-amz-server-side-encryption-customer-key-md5",
@@ -2048,7 +2030,7 @@ static inline int rgw_get_request_metadata(CephContext* const cct,
     const std::string& name = kv.first;
     std::string& xattr = kv.second;
 
-    if (blacklisted_headers.count(name) == 1) {
+    if (blocklisted_headers.count(name) == 1) {
       lsubdout(cct, rgw, 10) << "skipping x>> " << name << dendl;
       continue;
     } else if (allow_empty_attrs || !xattr.empty()) {
@@ -2094,8 +2076,8 @@ static inline int rgw_get_request_metadata(CephContext* const cct,
   return 0;
 } /* rgw_get_request_metadata */
 
-static inline void encode_delete_at_attr(boost::optional<ceph::real_time> delete_at,
-                                       map<string, bufferlist>& attrs)
+inline void encode_delete_at_attr(boost::optional<ceph::real_time> delete_at,
+                                 map<string, bufferlist>& attrs)
 {
   if (delete_at == boost::none) {
     return;
@@ -2106,7 +2088,7 @@ static inline void encode_delete_at_attr(boost::optional<ceph::real_time> delete
   attrs[RGW_ATTR_DELETE_AT] = delatbl;
 } /* encode_delete_at_attr */
 
-static inline void encode_obj_tags_attr(RGWObjTags* obj_tags, map<string, bufferlist>& attrs)
+inline void encode_obj_tags_attr(RGWObjTags* obj_tags, map<string, bufferlist>& attrs)
 {
   if (obj_tags == nullptr){
     // we assume the user submitted a tag format which we couldn't parse since
@@ -2120,8 +2102,8 @@ static inline void encode_obj_tags_attr(RGWObjTags* obj_tags, map<string, buffer
   attrs[RGW_ATTR_TAGS] = tagsbl;
 }
 
-static inline int encode_dlo_manifest_attr(const char * const dlo_manifest,
-                                         map<string, bufferlist>& attrs)
+inline int encode_dlo_manifest_attr(const char * const dlo_manifest,
+                                   map<string, bufferlist>& attrs)
 {
   string dm = dlo_manifest;
 
@@ -2136,7 +2118,7 @@ static inline int encode_dlo_manifest_attr(const char * const dlo_manifest,
   return 0;
 } /* encode_dlo_manifest_attr */
 
-static inline void complete_etag(MD5& hash, string *etag)
+inline void complete_etag(MD5& hash, string *etag)
 {
   char etag_buf[CEPH_CRYPTO_MD5_DIGESTSIZE];
   char etag_buf_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 16];
@@ -2148,9 +2130,38 @@ static inline void complete_etag(MD5& hash, string *etag)
   *etag = etag_buf_str;
 } /* complete_etag */
 
+using boost::container::flat_map;
+
+class RGWGetAttrs : public RGWOp {
+public:
+    using get_attrs_t = flat_map<std::string, std::optional<buffer::list>>;
+protected:
+  get_attrs_t attrs;
+
+public:
+  RGWGetAttrs()
+  {}
+
+  virtual ~RGWGetAttrs() {}
+
+  void emplace_key(std::string&& key) {
+    attrs.emplace(std::move(key), std::nullopt);
+  }
+
+  int verify_permission(optional_yield y);
+  void pre_exec();
+  void execute(optional_yield y);
+
+  virtual int get_params() = 0;
+  virtual void send_response() = 0;
+  virtual const char* name() const { return "get_attrs"; }
+  virtual RGWOpType get_type() { return RGW_OP_GET_ATTRS; }
+  virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; }
+}; /* RGWGetAttrs */
+
 class RGWSetAttrs : public RGWOp {
 protected:
-  map<string, buffer::list> attrs;
+  map<std::string, buffer::list> attrs;
 
 public:
   RGWSetAttrs() {}
@@ -2160,17 +2171,42 @@ public:
     attrs.emplace(std::move(key), std::move(bl));
   }
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   void send_response() override = 0;
   const char* name() const override { return "set_attrs"; }
   RGWOpType get_type() override { return RGW_OP_SET_ATTRS; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
 };
 
+class RGWRMAttrs : public RGWOp {
+protected:
+  rgw::sal::RGWAttrs attrs;
+
+public:
+  RGWRMAttrs()
+  {}
+
+  virtual ~RGWRMAttrs() {}
+
+  void emplace_key(std::string&& key) {
+    attrs.emplace(std::move(key), buffer::list());
+  }
+
+  int verify_permission(optional_yield y);
+  void pre_exec();
+  void execute(optional_yield y);
+
+  virtual int get_params() = 0;
+  virtual void send_response() = 0;
+  virtual const char* name() const { return "rm_attrs"; }
+  virtual RGWOpType get_type() { return RGW_OP_DELETE_ATTRS; }
+  virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; }
+}; /* RGWRMAttrs */
+
 class RGWGetObjLayout : public RGWOp {
 protected:
   RGWObjManifest *manifest{nullptr};
@@ -2183,11 +2219,11 @@ public:
   int check_caps(RGWUserCaps& caps) {
     return caps.check_cap("admin", RGW_CAP_READ);
   }
-  int verify_permission() override {
+  int verify_permission(optional_yield) override {
     return check_caps(s->user->get_info().caps);
   }
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "get_obj_layout"; }
   virtual RGWOpType get_type() override { return RGW_OP_GET_OBJ_LAYOUT; }
@@ -2201,12 +2237,12 @@ public:
   ~RGWPutBucketPolicy() {
   }
   void send_response() override;
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   uint32_t op_mask() override {
     return RGW_OP_TYPE_WRITE;
   }
-  void execute() override;
-  int get_params();
+  void execute(optional_yield y) override;
+  int get_params(optional_yield y);
   const char* name() const override { return "put_bucket_policy"; }
   RGWOpType get_type() override {
     return RGW_OP_PUT_BUCKET_POLICY;
@@ -2218,11 +2254,11 @@ class RGWGetBucketPolicy : public RGWOp {
 public:
   RGWGetBucketPolicy() = default;
   void send_response() override;
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   uint32_t op_mask() override {
     return RGW_OP_TYPE_READ;
   }
-  void execute() override;
+  void execute(optional_yield y) override;
   const char* name() const override { return "get_bucket_policy"; }
   RGWOpType get_type() override {
     return RGW_OP_GET_BUCKET_POLICY;
@@ -2233,12 +2269,12 @@ class RGWDeleteBucketPolicy : public RGWOp {
 public:
   RGWDeleteBucketPolicy() = default;
   void send_response() override;
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   uint32_t op_mask() override {
     return RGW_OP_TYPE_WRITE;
   }
-  void execute() override;
-  int get_params();
+  void execute(optional_yield y) override;
+  int get_params(optional_yield y);
   const char* name() const override { return "delete_bucket_policy"; }
   RGWOpType get_type() override {
     return RGW_OP_DELETE_BUCKET_POLICY;
@@ -2253,11 +2289,11 @@ protected:
 public:
   RGWPutBucketObjectLock() = default;
   ~RGWPutBucketObjectLock() {}
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
-  virtual void send_response() = 0;
-  virtual int get_params() = 0;
+  void execute(optional_yield y) override;
+  virtual void send_response() override = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_bucket_object_lock"; }
   RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_OBJ_LOCK; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
@@ -2265,10 +2301,10 @@ public:
 
 class RGWGetBucketObjectLock : public RGWOp {
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
-  virtual void send_response() = 0;
+  void execute(optional_yield y) override;
+  virtual void send_response() override = 0;
   const char* name() const override {return "get_bucket_object_lock"; }
   RGWOpType get_type() override { return RGW_OP_GET_BUCKET_OBJ_LOCK; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
@@ -2282,11 +2318,11 @@ protected:
   bool bypass_governance_mode;
 public:
   RGWPutObjRetention():bypass_perm(true), bypass_governance_mode(false) {}
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
   virtual void send_response() override = 0;
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_obj_retention"; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
   RGWOpType get_type() override { return RGW_OP_PUT_OBJ_RETENTION; }
@@ -2296,10 +2332,10 @@ class RGWGetObjRetention : public RGWOp {
 protected:
   RGWObjectRetention obj_retention;
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
-  virtual void send_response() = 0;
+  void execute(optional_yield y) override;
+  virtual void send_response() override = 0;
   const char* name() const override {return "get_obj_retention"; }
   RGWOpType get_type() override { return RGW_OP_GET_OBJ_RETENTION; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
@@ -2310,11 +2346,11 @@ protected:
   bufferlist data;
   RGWObjectLegalHold obj_legal_hold;
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
   virtual void send_response() override = 0;
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "put_obj_legal_hold"; }
   uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
   RGWOpType get_type() override { return RGW_OP_PUT_OBJ_LEGAL_HOLD; }
@@ -2324,10 +2360,10 @@ class RGWGetObjLegalHold : public RGWOp {
 protected:
   RGWObjectLegalHold obj_legal_hold;
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
-  virtual void send_response() = 0;
+  void execute(optional_yield y) override;
+  virtual void send_response() override = 0;
   const char* name() const override {return "get_obj_legal_hold"; }
   RGWOpType get_type() override { return RGW_OP_GET_OBJ_LEGAL_HOLD; }
   uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
@@ -2340,11 +2376,11 @@ protected:
 public:
   RGWConfigBucketMetaSearch() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
-  virtual int get_params() = 0;
+  virtual int get_params(optional_yield y) = 0;
   const char* name() const override { return "config_bucket_meta_search"; }
   virtual RGWOpType get_type() override { return RGW_OP_CONFIG_BUCKET_META_SEARCH; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
@@ -2354,9 +2390,9 @@ class RGWGetBucketMetaSearch : public RGWOp {
 public:
   RGWGetBucketMetaSearch() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override {}
+  void execute(optional_yield) override {}
 
   const char* name() const override { return "get_bucket_meta_search"; }
   virtual RGWOpType get_type() override { return RGW_OP_GET_BUCKET_META_SEARCH; }
@@ -2367,9 +2403,9 @@ class RGWDelBucketMetaSearch : public RGWOp {
 public:
   RGWDelBucketMetaSearch() {}
 
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   void pre_exec() override;
-  void execute() override;
+  void execute(optional_yield y) override;
 
   const char* name() const override { return "delete_bucket_meta_search"; }
   virtual RGWOpType delete_type() { return RGW_OP_DEL_BUCKET_META_SEARCH; }
@@ -2378,17 +2414,17 @@ public:
 
 class RGWGetClusterStat : public RGWOp {
 protected:
-  struct rados_cluster_stat_t stats_op;
+  RGWClusterStat stats_op;
 public:
   RGWGetClusterStat() {}
 
   void init(rgw::sal::RGWRadosStore *store, struct req_state *s, RGWHandler *h) override {
     RGWOp::init(store, s, h);
   }
-  int verify_permission() override {return 0;}
+  int verify_permission(optional_yield) override {return 0;}
   virtual void send_response() override = 0;
-  virtual int get_params() = 0;
-  void execute() override;
+  virtual int get_params(optional_yield y) = 0;
+  void execute(optional_yield y) override;
   const char* name() const override { return "get_cluster_stat"; }
   dmc::client_id dmclock_client() override { return dmc::client_id::admin; }
 };
@@ -2397,11 +2433,11 @@ class RGWGetBucketPolicyStatus : public RGWOp {
 protected:
   bool isPublic {false};
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   const char* name() const override { return "get_bucket_policy_status"; }
   virtual RGWOpType get_type() override { return RGW_OP_GET_BUCKET_POLICY_STATUS; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
-  void execute() override;
+  void execute(optional_yield y) override;
   dmc::client_id dmclock_client() override { return dmc::client_id::metadata; }
 };
 
@@ -2410,12 +2446,12 @@ protected:
   bufferlist data;
   PublicAccessBlockConfiguration access_conf;
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   const char* name() const override { return "put_bucket_public_access_block";}
   virtual RGWOpType get_type() override { return RGW_OP_PUT_BUCKET_PUBLIC_ACCESS_BLOCK; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
-  int get_params();
-  void execute() override;
+  int get_params(optional_yield y);
+  void execute(optional_yield y) override;
   dmc::client_id dmclock_client() override { return dmc::client_id::metadata; }
 };
 
@@ -2423,12 +2459,12 @@ class RGWGetBucketPublicAccessBlock : public RGWOp {
 protected:
   PublicAccessBlockConfiguration access_conf;
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   const char* name() const override { return "get_bucket_public_access_block";}
   virtual RGWOpType get_type() override { return RGW_OP_GET_BUCKET_PUBLIC_ACCESS_BLOCK; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; }
-  int get_params();
-  void execute() override;
+  int get_params(optional_yield y);
+  void execute(optional_yield y) override;
   dmc::client_id dmclock_client() override { return dmc::client_id::metadata; }
 };
 
@@ -2436,17 +2472,17 @@ class RGWDeleteBucketPublicAccessBlock : public RGWOp {
 protected:
   PublicAccessBlockConfiguration access_conf;
 public:
-  int verify_permission() override;
+  int verify_permission(optional_yield y) override;
   const char* name() const override { return "delete_bucket_public_access_block";}
   virtual RGWOpType get_type() override { return RGW_OP_DELETE_BUCKET_PUBLIC_ACCESS_BLOCK; }
   virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
-  int get_params();
-  void execute() override;
+  int get_params(optional_yield y);
+  void execute(optional_yield y) override;
   void send_response() override;
   dmc::client_id dmclock_client() override { return dmc::client_id::metadata; }
 };
 
-static inline int parse_value_and_bound(
+inline int parse_value_and_bound(
     const string &input,
     int &output,
     const long lower_bound,
@@ -2477,7 +2513,4 @@ static inline int parse_value_and_bound(
   return 0;
 }
 
-int forward_request_to_master(struct req_state *s, obj_version *objv, rgw::sal::RGWRadosStore *store,
-                              bufferlist& in_data, JSONParser *jp, req_info *forward_info = nullptr);
-
 #endif /* CEPH_RGW_OP_H */