]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/common: extract parallel_for_each_state out
authorKefu Chai <kchai@redhat.com>
Sat, 19 Jun 2021 11:12:36 +0000 (19:12 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 19 Jun 2021 11:12:38 +0000 (19:12 +0800)
commit108eaf795f222c0e61b18f5bccc2c6dd6b383dda
treec15da3b80ec255c86f3ae615e30c0c7ffa50ad2f
parenta7af60243ffd320e8d2d799e38dc685aa7fdde04
crimson/common: extract parallel_for_each_state out

if `parallel_for_each_state` is defined as a nested class in errorator,
clang fails to compile it:

../src/crimson/common/errorator.h:716:47: error: no class named 'parallel_for_each_state' in 'errorator<AllowedErrors...>'
    friend class errorator<AllowedErrors...>::parallel_for_each_state;
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

and the forward declaration does not help. so we have to extract it
out of the errorator. to speed up the compilation, it is moved into
errorator-loop.h. its name mirrors `include/seastar/core/loop.h`.

we could extract the `errorator<>::parallel_for_each()` out as well,
as its return type can be deduced from the type of Iterator and Func.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/errorator-loop.h [new file with mode: 0644]
src/crimson/common/errorator.h
src/test/crimson/test_errorator.cc