]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: RADOS::Obj::operate takes optional_yield
authorCasey Bodley <cbodley@redhat.com>
Mon, 12 Nov 2018 19:07:59 +0000 (14:07 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 27 Nov 2018 17:30:25 +0000 (12:30 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/services/svc_notify.cc
src/rgw/services/svc_rados.cc
src/rgw/services/svc_rados.h
src/rgw/services/svc_sys_obj_core.cc

index 466b9d0696d1d999f2defefa0ebdc316af3f93bb..c34c1578bd63e5e1bb1dd2fcb79e3b36deb80914 100644 (file)
@@ -190,7 +190,7 @@ int RGWSI_Notify::init_watch()
 
     librados::ObjectWriteOperation op;
     op.create(false);
-    r = notify_obj.operate(&op);
+    r = notify_obj.operate(&op, null_yield);
     if (r < 0 && r != -EEXIST) {
       ldout(cct, 0) << "ERROR: notify_obj.operate() returned r=" << r << dendl;
       return r;
index 3a466db4d688f3e8996ab11d604fd5f0ce20783e..e31378cb304239776613c57eb9e023fd79deba37 100644 (file)
@@ -3,6 +3,7 @@
 #include "include/rados/librados.hpp"
 #include "common/errno.h"
 #include "osd/osd_types.h"
+#include "rgw/rgw_tools.h"
 
 #define dout_subsys ceph_subsys_rgw
 
@@ -151,14 +152,16 @@ int RGWSI_RADOS::Obj::open()
   return 0;
 }
 
-int RGWSI_RADOS::Obj::operate(librados::ObjectWriteOperation *op)
+int RGWSI_RADOS::Obj::operate(librados::ObjectWriteOperation *op,
+                              optional_yield y)
 {
-  return ref.ioctx.operate(ref.oid, op);
+  return rgw_rados_operate(ref.ioctx, ref.oid, op, y);
 }
 
-int RGWSI_RADOS::Obj::operate(librados::ObjectReadOperation *op, bufferlist *pbl)
+int RGWSI_RADOS::Obj::operate(librados::ObjectReadOperation *op, bufferlist *pbl,
+                              optional_yield y)
 {
-  return ref.ioctx.operate(ref.oid, op, pbl);
+  return rgw_rados_operate(ref.ioctx, ref.oid, op, pbl, y);
 }
 
 int RGWSI_RADOS::Obj::aio_operate(librados::AioCompletion *c, librados::ObjectWriteOperation *op)
index 7225cf2e6734410096b4496aecedeef45ae5b57d..4d242a75c16ab033a5357215f952563b3cbdd7f3 100644 (file)
@@ -5,6 +5,7 @@
 #include "rgw/rgw_service.h"
 
 #include "include/rados/librados.hpp"
+#include "common/async/yield_context.h"
 
 class RGWAccessListFilter {
 public:
@@ -74,8 +75,9 @@ public:
 
     int open();
 
-    int operate(librados::ObjectWriteOperation *op);
-    int operate(librados::ObjectReadOperation *op, bufferlist *pbl);
+    int operate(librados::ObjectWriteOperation *op, optional_yield y);
+    int operate(librados::ObjectReadOperation *op, bufferlist *pbl,
+                optional_yield y);
     int aio_operate(librados::AioCompletion *c, librados::ObjectWriteOperation *op);
     int aio_operate(librados::AioCompletion *c, librados::ObjectReadOperation *op,
                     bufferlist *pbl);
index e2c8514c26d7cd229150d57fcbcc8bfed4d57e28..1f9c83494561f75d1d96b243be27ff3be34799f6 100644 (file)
@@ -123,7 +123,7 @@ int RGWSI_SysObj_Core::raw_stat(const rgw_raw_obj& obj, uint64_t *psize, real_ti
     op.read(0, cct->_conf->rgw_max_chunk_size, first_chunk, nullptr);
   }
   bufferlist outbl;
-  r = rados_obj.operate(&op, &outbl);
+  r = rados_obj.operate(&op, &outbl, null_yield);
 
   if (epoch) {
     *epoch = rados_obj.get_last_version();
@@ -215,7 +215,7 @@ int RGWSI_SysObj_Core::read(RGWSysObjectCtxBase& obj_ctx,
     ldout(cct, 20) << "get_rados_obj() on obj=" << obj << " returned " << r << dendl;
     return r;
   }
-  r = rados_obj.operate(&op, nullptr);
+  r = rados_obj.operate(&op, nullptr, null_yield);
   if (r < 0) {
     ldout(cct, 20) << "rados_obj.operate() r=" << r << " bl.length=" << bl->length() << dendl;
     return r;
@@ -262,7 +262,7 @@ int RGWSI_SysObj_Core::get_attr(const rgw_raw_obj& obj,
   int rval;
   op.getxattr(name, dest, &rval);
   
-  r = rados_obj.operate(&op, nullptr);
+  r = rados_obj.operate(&op, nullptr, null_yield);
   if (r < 0)
     return r;
 
@@ -310,7 +310,7 @@ int RGWSI_SysObj_Core::set_attrs(const rgw_raw_obj& obj,
 
   bufferlist bl;
 
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   if (r < 0)
     return r;
 
@@ -340,7 +340,7 @@ int RGWSI_SysObj_Core::omap_get_vals(const rgw_raw_obj& obj,
     int rval;
     op.omap_get_vals2(start_after, count, &t, &more, &rval);
   
-    r = rados_obj.operate(&op, nullptr);
+    r = rados_obj.operate(&op, nullptr, null_yield);
     if (r < 0) {
       return r;
     }
@@ -379,7 +379,7 @@ int RGWSI_SysObj_Core::omap_get_all(const rgw_raw_obj& obj, std::map<string, buf
     int rval;
     op.omap_get_vals2(start_after, count, &t, &more, &rval);
   
-    r = rados_obj.operate(&op, nullptr);
+    r = rados_obj.operate(&op, nullptr, null_yield);
     if (r < 0) {
       return r;
     }
@@ -409,7 +409,7 @@ int RGWSI_SysObj_Core::omap_set(const rgw_raw_obj& obj, const std::string& key,
   if (must_exist)
     op.assert_exists();
   op.omap_set(m);
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   return r;
 }
 
@@ -426,7 +426,7 @@ int RGWSI_SysObj_Core::omap_set(const rgw_raw_obj& obj, const std::map<std::stri
   if (must_exist)
     op.assert_exists();
   op.omap_set(m);
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   return r;
 }
 
@@ -446,7 +446,7 @@ int RGWSI_SysObj_Core::omap_del(const rgw_raw_obj& obj, const std::string& key)
 
   op.omap_rm_keys(k);
 
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   return r;
 }
 
@@ -484,7 +484,7 @@ int RGWSI_SysObj_Core::remove(RGWSysObjectCtxBase& obj_ctx,
   }
 
   op.remove();
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   if (r < 0)
     return r;
 
@@ -540,7 +540,7 @@ int RGWSI_SysObj_Core::write(const rgw_raw_obj& obj,
     op.setxattr(name.c_str(), bl);
   }
 
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   if (r < 0) {
     return r;
   }
@@ -579,7 +579,7 @@ int RGWSI_SysObj_Core::write_data(const rgw_raw_obj& obj,
     objv_tracker->prepare_op_for_write(&op);
   }
   op.write_full(bl);
-  r = rados_obj.operate(&op);
+  r = rados_obj.operate(&op, null_yield);
   if (r < 0)
     return r;