]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: Port rgw watcher list
authorNitzanMordhai <nmordech@redhat.com>
Tue, 2 Aug 2022 08:02:26 +0000 (08:02 +0000)
committerNitzanMordhai <nmordech@redhat.com>
Tue, 2 Aug 2022 08:02:26 +0000 (08:02 +0000)
Implemented function cls_cxx_list_watchers for crimson

Signed-off-by: Nitzan Mordechai <nmordec@redhat.com>
src/crimson/osd/objclass.cc

index ae3e61b3bc9d0e06aa8129714ec617dcb5fc9c16..ece780bf51ab4c2e96910c4e19c340e19f3f91e2 100644 (file)
@@ -444,6 +444,17 @@ int cls_cxx_map_remove_key(cls_method_context_t hctx, const string &key)
 int cls_cxx_list_watchers(cls_method_context_t hctx,
                           obj_list_watch_response_t *watchers)
 {
+  OSDOp op{CEPH_OSD_OP_LIST_WATCHERS};
+  if (const auto ret = execute_osd_op(hctx, op); ret < 0) {
+    return ret;
+  }
+
+  try {
+    auto iter = op.outdata.cbegin();
+    decode(*watchers, iter);
+  } catch (buffer::error&) {
+    return -EIO;
+  }
   return 0;
 }