]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: switch small occurances of throwing to errorator.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 24 Sep 2019 18:23:20 +0000 (20:23 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 20 Nov 2019 19:37:43 +0000 (20:37 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/exceptions.h
src/crimson/osd/ops_executer.cc
src/crimson/osd/ops_executer.h

index 1bd1a6a09a0c102b69d30dd4f01d1e239ae9d5b0..2783ed252ce3c06168bb0e5c42a81caa81d6516e 100644 (file)
@@ -34,31 +34,13 @@ struct object_not_found : public error {
   object_not_found() : error(std::errc::no_such_file_or_directory) {}
 };
 
-struct object_corrupted : public error {
-  object_corrupted() : error(std::errc::illegal_byte_sequence) {}
-};
-
 struct invalid_argument : public error {
   invalid_argument() : error(std::errc::invalid_argument) {}
 };
 
-struct no_message_available : public error {
-  no_message_available() : error(std::errc::no_message_available) {}
-};
-
 // FIXME: error handling
-struct operation_not_supported : public error {
-  operation_not_supported()
-    : error(std::errc::operation_not_supported) {
-  }
-};
-
 struct permission_denied : public error {
   permission_denied() : error(std::errc::operation_not_permitted) {}
 };
 
-struct input_output_error : public error {
-  input_output_error() : error(std::errc::io_error) {}
-};
-
 } // namespace crimson::osd
index 9c416786fa4b9ab1909215e04f8ab95ef13d8f0a..d1994943788af58761cb4670b8798e648db90cfa 100644 (file)
@@ -432,7 +432,7 @@ OpsExecuter::execute_osd_op(OSDOp& osd_op)
     });
   case CEPH_OSD_OP_OMAPSETVALS:
     if (!pg.get_pool().info.supports_omap()) {
-      throw crimson::osd::operation_not_supported{};
+      return crimson::ct_error::operation_not_supported::make();
     }
     return do_write_op([&osd_op] (auto& backend, auto& os, auto& txn) {
       return backend.omap_set_vals(os, osd_op, txn);
index 53a14bcb35c90f75ed4b96117e9a8be6ac066321..fa8528c2ae0aceb9428af4c1c339da3278284587 100644 (file)
@@ -100,8 +100,8 @@ class OpsExecuter {
                                  std::as_const(msg->get_hobj().nspace));
   }
 
-  seastar::future<> dont_do_legacy_op() {
-    throw crimson::osd::operation_not_supported();
+  decltype(auto) dont_do_legacy_op() {
+    return crimson::ct_error::operation_not_supported::make();
   }
 
   using read_errorator = PGBackend::read_errorator;