diff options
author | Adam C. Emerson <aemerson@redhat.com> | 2022-12-02 08:17:44 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2023-11-29 19:15:27 +0100 |
commit | 897f4a9fce2ca4c037608244f50703157f3cec83 (patch) | |
tree | 1993d1bfafb72d22908804af006e903d7dd9f049 /src/rgw/driver/rados | |
parent | rgw: Remove `RGWSI_RADOS` from `RGWSI_MDLog` (diff) | |
download | ceph-897f4a9fce2ca4c037608244f50703157f3cec83.tar.xz ceph-897f4a9fce2ca4c037608244f50703157f3cec83.zip |
rgw: Remove `RGWSI_RADOS` from `RGWSI_Notify`
Simply use the RADOS handle directly.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/rgw/driver/rados')
-rw-r--r-- | src/rgw/driver/rados/rgw_service.cc | 2 | ||||
-rw-r--r-- | src/rgw/driver/rados/rgw_tools.h | 33 |
2 files changed, 27 insertions, 8 deletions
diff --git a/src/rgw/driver/rados/rgw_service.cc b/src/rgw/driver/rados/rgw_service.cc index af4043efa7a..ddd4dfdcd74 100644 --- a/src/rgw/driver/rados/rgw_service.cc +++ b/src/rgw/driver/rados/rgw_service.cc @@ -106,7 +106,7 @@ int RGWServices_Def::init(CephContext *cct, meta->init(sysobj.get(), mdlog.get(), meta_bes); meta_be_sobj->init(sysobj.get(), mdlog.get()); meta_be_otp->init(sysobj.get(), mdlog.get(), cls.get()); - notify->init(zone.get(), rados.get(), finisher.get()); + notify->init(zone.get(), radoshandle, finisher.get()); otp->init(zone.get(), meta.get(), meta_be_otp.get()); rados->init(); zone->init(sysobj.get(), rados.get(), sync_modules.get(), bucket_sync_sobj.get()); diff --git a/src/rgw/driver/rados/rgw_tools.h b/src/rgw/driver/rados/rgw_tools.h index 7fdb3ea3eff..a7639acbb24 100644 --- a/src/rgw/driver/rados/rgw_tools.h +++ b/src/rgw/driver/rados/rgw_tools.h @@ -108,34 +108,53 @@ struct rgw_rados_ref { rgw_raw_obj obj; - int operate(const DoutPrefixProvider *dpp, librados::ObjectReadOperation *op, - bufferlist *pbl, optional_yield y, int flags = 0) { + int operate(const DoutPrefixProvider* dpp, librados::ObjectReadOperation* op, + bufferlist* pbl, optional_yield y, int flags = 0) { return rgw_rados_operate(dpp, ioctx, obj.oid, op, pbl, y, flags); } - int operate(const DoutPrefixProvider *dpp, librados::ObjectWriteOperation *op, + int operate(const DoutPrefixProvider* dpp, librados::ObjectWriteOperation* op, optional_yield y, int flags = 0) { return rgw_rados_operate(dpp, ioctx, obj.oid, op, y, flags); } - int aio_operate(librados::AioCompletion *c, - librados::ObjectWriteOperation *op) { + int aio_operate(librados::AioCompletion* c, + librados::ObjectWriteOperation* op) { return ioctx.aio_operate(obj.oid, c, op); } - int aio_operate(librados::AioCompletion *c, librados::ObjectReadOperation *op, + int aio_operate(librados::AioCompletion* c, librados::ObjectReadOperation* op, bufferlist *pbl) { return ioctx.aio_operate(obj.oid, c, op, pbl); } - int notify(const DoutPrefixProvider *dpp, bufferlist& bl, uint64_t timeout_ms, + int watch(uint64_t* handle, librados::WatchCtx2* ctx) { + return ioctx.watch2(obj.oid, handle, ctx); + } + + int aio_watch(librados::AioCompletion* c, uint64_t* handle, + librados::WatchCtx2 *ctx) { + return ioctx.aio_watch(obj.oid, c, handle, ctx); + } + + int unwatch(uint64_t handle) { + return ioctx.unwatch2(handle); + } + + int notify(const DoutPrefixProvider* dpp, bufferlist& bl, uint64_t timeout_ms, bufferlist* pbl, optional_yield y) { return rgw_rados_notify(dpp, ioctx, obj.oid, bl, timeout_ms, pbl, y); } + + void notify_ack(uint64_t notify_id, uint64_t cookie, bufferlist& bl) { + ioctx.notify_ack(obj.oid, notify_id, cookie, bl); + } }; + inline std::ostream& operator <<(std::ostream& m, const rgw_rados_ref& ref) { return m << ref.obj; } + int rgw_get_rados_ref(const DoutPrefixProvider* dpp, librados::Rados* rados, rgw_raw_obj obj, rgw_rados_ref* ref); |