From: Casey Bodley Date: Mon, 12 Nov 2018 19:07:59 +0000 (-0500) Subject: rgw: RADOS::Obj::operate takes optional_yield X-Git-Tag: v14.1.0~759^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9a35b610bcc34a9112d98df98fd2d204cb876a07;p=ceph-ci.git rgw: RADOS::Obj::operate takes optional_yield Signed-off-by: Casey Bodley --- diff --git a/src/rgw/services/svc_notify.cc b/src/rgw/services/svc_notify.cc index 466b9d0696d..c34c1578bd6 100644 --- a/src/rgw/services/svc_notify.cc +++ b/src/rgw/services/svc_notify.cc @@ -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; diff --git a/src/rgw/services/svc_rados.cc b/src/rgw/services/svc_rados.cc index 3a466db4d68..e31378cb304 100644 --- a/src/rgw/services/svc_rados.cc +++ b/src/rgw/services/svc_rados.cc @@ -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) diff --git a/src/rgw/services/svc_rados.h b/src/rgw/services/svc_rados.h index 7225cf2e673..4d242a75c16 100644 --- a/src/rgw/services/svc_rados.h +++ b/src/rgw/services/svc_rados.h @@ -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); diff --git a/src/rgw/services/svc_sys_obj_core.cc b/src/rgw/services/svc_sys_obj_core.cc index e2c8514c26d..1f9c8349456 100644 --- a/src/rgw/services/svc_sys_obj_core.cc +++ b/src/rgw/services/svc_sys_obj_core.cc @@ -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::mapprepare_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;