]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: simplify RGWSI_RADOS params with default arguments
authorCasey Bodley <cbodley@redhat.com>
Fri, 19 Jul 2019 15:23:47 +0000 (11:23 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 29 Jul 2019 19:20:50 +0000 (15:20 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/services/svc_rados.cc
src/rgw/services/svc_rados.h

index c139ee91c48e8456e685284b1dcf5ef55df0e5fd..dea97e36a3b309ac3fb6a4fbb27790ac2624d185 100644 (file)
@@ -54,11 +54,11 @@ uint64_t RGWSI_RADOS::instance_id()
 }
 
 int RGWSI_RADOS::open_pool_ctx(const rgw_pool& pool, librados::IoCtx& io_ctx,
-                               ceph::optional_ref_default<OpenParams> params)
+                               const OpenParams& params)
 {
   return rgw_init_ioctx(get_rados_handle(), pool, io_ctx,
-                        params->create,
-                        params->mostly_omap);
+                        params.create,
+                        params.mostly_omap);
 }
 
 int RGWSI_RADOS::pool_iterate(librados::IoCtx& io_ctx,
@@ -284,9 +284,9 @@ int RGWSI_RADOS::Pool::lookup()
   return 0;
 }
 
-int RGWSI_RADOS::Pool::open(ceph::optional_ref_default<RGWSI_RADOS::OpenParams> params)
+int RGWSI_RADOS::Pool::open(const OpenParams& params)
 {
-  return rados_svc->open_pool_ctx(pool, state.ioctx);
+  return rados_svc->open_pool_ctx(pool, state.ioctx, params);
 }
 
 int RGWSI_RADOS::Pool::List::init(const string& marker, RGWAccessListFilter *filter)
index 9d56e8f294a623dc5e5a9d0242b38960835b732b..595b7a4fd2d306eb57ffc085ce0bb5b947f51069 100644 (file)
@@ -9,8 +9,6 @@
 #include "common/async/yield_context.h"
 #include "common/RWLock.h"
 
-#include "common/optional_ref_default.h"
-
 class RGWAsyncRadosProcessor;
 
 class RGWAccessListFilter {
@@ -40,6 +38,8 @@ public:
     bool create{true};
     bool mostly_omap{false};
 
+    OpenParams() {}
+
     OpenParams& set_create(bool _create) {
       create = _create;
       return *this;
@@ -53,7 +53,7 @@ public:
 private:
   librados::Rados* get_rados_handle();
   int open_pool_ctx(const rgw_pool& pool, librados::IoCtx& io_ctx,
-                    ceph::optional_ref_default<OpenParams> params = std::nullopt);
+                    const OpenParams& params = {});
   int pool_iterate(librados::IoCtx& ioctx,
                    librados::NObjectIterator& iter,
                    uint32_t num, vector<rgw_bucket_dir_entry>& objs,
@@ -98,7 +98,7 @@ public:
     int create();
     int create(const std::vector<rgw_pool>& pools, std::vector<int> *retcodes);
     int lookup();
-    int open(ceph::optional_ref_default<RGWSI_RADOS::OpenParams> params = std::nullopt);
+    int open(const OpenParams& params = {});
 
     const rgw_pool& get_pool() {
       return pool;