diff options
author | Adam Emerson <aemerson@redhat.com> | 2023-08-10 05:59:34 +0200 |
---|---|---|
committer | Adam Emerson <aemerson@redhat.com> | 2023-12-07 22:23:08 +0100 |
commit | 6fab4159ec6c4586d88bd26979a442692a541caf (patch) | |
tree | 2331e4615a03edbb8d7bfc37f4eff4cc1d166dba /src/neorados | |
parent | neorados: Change `cmpxattr_op` to `cmp_op` and use in `Op::cmp_omap` (diff) | |
download | ceph-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.cc | 7 |
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); |