summaryrefslogtreecommitdiffstats
path: root/src/neorados
diff options
context:
space:
mode:
authorAdam Emerson <aemerson@redhat.com>2023-08-10 05:59:34 +0200
committerAdam Emerson <aemerson@redhat.com>2023-12-07 22:23:08 +0100
commit6fab4159ec6c4586d88bd26979a442692a541caf (patch)
tree2331e4615a03edbb8d7bfc37f4eff4cc1d166dba /src/neorados
parentneorados: Change `cmpxattr_op` to `cmp_op` and use in `Op::cmp_omap` (diff)
downloadceph-6fab4159ec6c4586d88bd26979a442692a541caf.tar.xz
ceph-6fab4159ec6c4586d88bd26979a442692a541caf.zip
neorados: Improve `cmp_omap` argument structure
A map from strings to value/op pairs is a bit much and a bit annoying for what's essentially a list of assertions. Just use a vector. Also put op in the middle so it matches `cmpxattr`. Signed-off-by: Adam Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/neorados')
-rw-r--r--src/neorados/RADOS.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc
index 84cc200929f..0c12b861c87 100644
--- a/src/neorados/RADOS.cc
+++ b/src/neorados/RADOS.cc
@@ -444,13 +444,10 @@ void Op::assert_exists() {
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);