mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
rgw_rados: add guard assert in add_io()
Use the iterator-returning insert operation in std::map, check assert the insert case. As a side effect, this makes use of the inserted object record more clear. Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This commit is contained in:
parent
a159f3d1c0
commit
d10c37adf9
@ -9656,7 +9656,12 @@ struct get_obj_data : public RefCountedObject {
|
||||
void add_io(off_t ofs, off_t len, bufferlist **pbl, AioCompletion **pc) {
|
||||
Mutex::Locker l(lock);
|
||||
|
||||
get_obj_io& io = io_map[ofs];
|
||||
const auto& io_iter = io_map.insert(
|
||||
map<off_t, get_obj_io>::value_type(ofs, get_obj_io()));
|
||||
|
||||
assert(io_iter.second); // assert new insertion
|
||||
|
||||
get_obj_io& io = (io_iter.first)->second;
|
||||
*pbl = &io.bl;
|
||||
|
||||
struct get_obj_aio_data aio;
|
||||
|
Loading…
Reference in New Issue
Block a user