From: chunmei-liu Date: Wed, 27 Apr 2022 08:52:06 +0000 (-0700) Subject: crimson/errorator: change errorator template to int X-Git-Tag: v18.0.0~942^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=01e7122c9788ad698c4c66f921036fd0af402500;p=ceph.git crimson/errorator: change errorator template to int need define EDQUOT which is not included in std::errc. Signed-off-by: chunmei-liu --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index d50dee547dc1f..5898b8c96c24f 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -1112,40 +1112,41 @@ using compound_errorator_t = typename compound_errorator::type; // this is conjunction of two nasty features: C++14's variable template // and inline global variable of C++17. The latter is crucial to ensure // the variable will get the same address across all translation units. -template -inline std::error_code ec = std::make_error_code(ErrorV); +template +inline std::error_code ec = std::error_code(ErrorV, std::generic_category()); -template +template using ct_error_code = unthrowable_wrapper>; namespace ct_error { - using enoent = ct_error_code; - using enodata = ct_error_code; - using invarg = ct_error_code; - using input_output_error = ct_error_code; - using object_corrupted = ct_error_code; - using permission_denied = ct_error_code; + using enoent = ct_error_code(std::errc::no_such_file_or_directory)>; + using enodata = ct_error_code(std::errc::no_message_available)>; + using invarg = ct_error_code(std::errc::invalid_argument)>; + using input_output_error = ct_error_code(std::errc::io_error)>; + using object_corrupted = ct_error_code(std::errc::illegal_byte_sequence)>; + using permission_denied = ct_error_code(std::errc::permission_denied)>; using operation_not_supported = - ct_error_code; - using not_connected = ct_error_code; - using timed_out = ct_error_code; + ct_error_code(std::errc::operation_not_supported)>; + using not_connected = ct_error_code(std::errc::not_connected)>; + using timed_out = ct_error_code(std::errc::timed_out)>; using erange = - ct_error_code; + ct_error_code(std::errc::result_out_of_range)>; using ebadf = - ct_error_code; + ct_error_code(std::errc::bad_file_descriptor)>; using enospc = - ct_error_code; - using value_too_large = ct_error_code; + ct_error_code(std::errc::no_space_on_device)>; + using value_too_large = ct_error_code(std::errc::value_too_large)>; using eagain = - ct_error_code; + ct_error_code(std::errc::resource_unavailable_try_again)>; using file_too_large = - ct_error_code; - using address_in_use = ct_error_code; - using address_not_available = ct_error_code; - using ecanceled = ct_error_code; - using einprogress = ct_error_code; - using enametoolong = ct_error_code; - using eexist = ct_error_code; + ct_error_code(std::errc::file_too_large)>; + using address_in_use = ct_error_code(std::errc::address_in_use)>; + using address_not_available = ct_error_code(std::errc::address_not_available)>; + using ecanceled = ct_error_code(std::errc::operation_canceled)>; + using einprogress = ct_error_code(std::errc::operation_in_progress)>; + using enametoolong = ct_error_code(std::errc::filename_too_long)>; + using eexist = ct_error_code(std::errc::file_exists)>; + using edquot = ct_error_code; struct pass_further_all { template