0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 11:18:51 +02:00

ircd::fs::aio: Add assertions at cancel() entry; tweak assertions that compare pointers.

This commit is contained in:
Jason Volk 2019-03-10 17:52:52 -07:00
parent 0c24ea5f40
commit 7aa9102f45

View file

@ -488,7 +488,10 @@ catch(const ctx::terminated &)
void
ircd::fs::aio::system::cancel(request &request)
{
const auto &cb
assert(request.retval == std::numeric_limits<ssize_t>::min());
assert(request.aio_data == uintptr_t(&request));
iocb *const cb
{
static_cast<iocb *>(&request)
};
@ -793,7 +796,8 @@ noexcept try
// Check that everything lines up.
assert(iocb == static_cast<struct ::iocb *>(&request));
assert(reinterpret_cast<aio::request *>(iocb->aio_data) == &request);
assert(request.aio_data == iocb->aio_data);
assert(request.aio_data == uintptr_t(&request));
// Assert that we understand the return-value semantics of this interface.
assert(event.res2 >= 0);