lte = 6
};
+struct cmp_assertion {
+ std::string attr;
+ cmp_op op;
+ ceph::buffer::list bl;
+};
+
namespace alloc_hint {
enum alloc_hint_t {
sequential_write = 1,
void cmpxattr(std::string_view name, cmp_op op, std::uint64_t val);
void assert_version(uint64_t ver);
void assert_exists();
- void cmp_omap(const boost::container::flat_map<std::string,
- std::pair<ceph::buffer::list,
- cmp_op>>& assertions);
+ void cmp_omap(const std::vector<cmp_assertion>& assertions);
void exec(std::string_view cls, std::string_view method,
const ceph::buffer::list& inbl,
return std::move(*this);
}
- ReadOp& cmp_omap(
- const boost::container::flat_map<
- std::string, std::pair<ceph::buffer::list, cmp_op>>& assertions) & {
+ ReadOp& cmp_omap(const std::vector<cmp_assertion>& assertions) & {
Op::cmp_omap(assertions);
return *this;
}
- ReadOp&& cmp_omap(
- const boost::container::flat_map<
- std::string, std::pair<ceph::buffer::list, cmp_op>>& assertions) && {
+ ReadOp&& cmp_omap(const std::vector<cmp_assertion>& assertions) && {
Op::cmp_omap(assertions);
return std::move(*this);
}
return std::move(*this);
}
- WriteOp& cmp_omap(
- const boost::container::flat_map<
- std::string, std::pair<ceph::buffer::list, cmp_op>>& assertions) & {
+ WriteOp& cmp_omap(const std::vector<cmp_assertion>& assertions) & {
Op::cmp_omap(assertions);
return *this;
}
- WriteOp&& cmp_omap(
- const boost::container::flat_map<
- std::string, std::pair<ceph::buffer::list, cmp_op>>& assertions) && {
+ WriteOp&& cmp_omap(const std::vector<cmp_assertion>& assertions) && {
Op::cmp_omap(assertions);
return std::move(*this);
}
static_cast<ceph::real_time*>(nullptr),
static_cast<bs::error_code*>(nullptr));
}
-void Op::cmp_omap(const bc::flat_map<
- std::string, std::pair<cb::list,
- cmp_op>>& assertions) {
+void Op::cmp_omap(const std::vector<cmp_assertion>& assertions) {
buffer::list bl;
encode(uint32_t(assertions.size()), bl);
- for (const auto& [key, assertion] : assertions) {
- const auto& [value, op] = assertion;
+ for (const auto& [key, op, value] : assertions) {
encode(key, bl);
encode(value, bl);
encode(int(op), bl);