From: Radoslaw Zarzynski Date: Sat, 14 Sep 2019 10:22:34 +0000 (+0200) Subject: crimson/os: alias errorator for CyanStore::get_attrs(). X-Git-Tag: v15.1.0~801^2~50 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=71864a95a36d8fefb484c0ad8b7f79cfd709962e;p=ceph.git crimson/os: alias errorator for CyanStore::get_attrs(). Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/os/cyan_store.cc b/src/crimson/os/cyan_store.cc index 0dafec55cef7..e8088ff65ef7 100644 --- a/src/crimson/os/cyan_store.cc +++ b/src/crimson/os/cyan_store.cc @@ -198,11 +198,10 @@ seastar::future CyanStore::read(CollectionRef ch, return seastar::make_ready_future(o->read(offset, l)); } -crimson::errorator::future -CyanStore::get_attr(CollectionRef ch, - const ghobject_t& oid, - std::string_view name) const +CyanStore::get_attr_errorator::future CyanStore::get_attr( + CollectionRef ch, + const ghobject_t& oid, + std::string_view name) const { auto c = static_cast(ch.get()); logger().debug("{} {} {}", @@ -212,8 +211,7 @@ CyanStore::get_attr(CollectionRef ch, return crimson::make_error(); } if (auto found = o->xattr.find(name); found != o->xattr.end()) { - return crimson::errorator::its_error_free( + return get_attr_errorator::its_error_free( seastar::make_ready_future(found->second)); } else { return crimson::make_error(); diff --git a/src/crimson/os/cyan_store.h b/src/crimson/os/cyan_store.h index 84311882e52b..96f3eb84a231 100644 --- a/src/crimson/os/cyan_store.h +++ b/src/crimson/os/cyan_store.h @@ -49,11 +49,10 @@ public: uint64_t offset, size_t len, uint32_t op_flags = 0) final; - virtual crimson::errorator::future - get_attr(CollectionRef c, - const ghobject_t& oid, - std::string_view name) const final; + get_attr_errorator::future get_attr( + CollectionRef c, + const ghobject_t& oid, + std::string_view name) const final; seastar::future get_attrs(CollectionRef c, const ghobject_t& oid) final; diff --git a/src/crimson/os/futurized_store.h b/src/crimson/os/futurized_store.h index b7045a7b00ec..401f9d456d18 100644 --- a/src/crimson/os/futurized_store.h +++ b/src/crimson/os/futurized_store.h @@ -47,9 +47,13 @@ public: uint64_t offset, size_t len, uint32_t op_flags = 0) = 0; - virtual crimson::errorator::future - get_attr(CollectionRef c, const ghobject_t& oid, std::string_view name) const = 0; + using get_attr_errorator = crimson::errorator< + crimson::ct_error::enoent, + crimson::ct_error::enodata>; + virtual get_attr_errorator::future get_attr( + CollectionRef c, + const ghobject_t& oid, + std::string_view name) const = 0; using attrs_t = std::map>; virtual seastar::future get_attrs(CollectionRef c, diff --git a/src/crimson/osd/pg_backend.cc b/src/crimson/osd/pg_backend.cc index be8a2f8cfdad..58c087678eb5 100644 --- a/src/crimson/osd/pg_backend.cc +++ b/src/crimson/osd/pg_backend.cc @@ -498,9 +498,7 @@ seastar::future<> PGBackend::getxattr( //ctx->delta_stats.num_rd++; } -crimson::errorator::future -PGBackend::getxattr( +PGBackend::get_attr_errorator::future PGBackend::getxattr( const hobject_t& soid, std::string_view key) const { diff --git a/src/crimson/osd/pg_backend.h b/src/crimson/osd/pg_backend.h index e831fcfe9c7f..6973236bcd89 100644 --- a/src/crimson/osd/pg_backend.h +++ b/src/crimson/osd/pg_backend.h @@ -87,8 +87,8 @@ public: seastar::future<> getxattr( const ObjectState& os, OSDOp& osd_op) const; - crimson::errorator::future getxattr( + using get_attr_errorator = crimson::os::FuturizedStore::get_attr_errorator; + get_attr_errorator::future getxattr( const hobject_t& soid, std::string_view key) const;