auto& aiocp = aios.front();
int rc;
if (block) {
- rc = aiocp->wait_for_complete();
+ aiocp->wait_for_complete();
+ rc = aiocp->get_return_value();
} else {
if (aiocp->is_complete()) {
rc = aiocp->get_return_value();
}
for (auto& aiocp : removes) {
- if (int rc = aiocp->wait_for_complete(); rc < 0 && rc != -ENOENT) {
+ aiocp->wait_for_complete();
+ if (int rc = aiocp->get_return_value(); rc < 0 && rc != -ENOENT) {
d(1) << " aio_remove failed: " << cpp_strerror(rc) << dendl;
return rc;
}
}
/* we need to wait so we don't have dangling extents */
d(10) << " waiting for allocated update" << dendl;
- if (int rc = aiocp->wait_for_complete(); rc < 0) {
+ aiocp->wait_for_complete();
+ if (int rc = aiocp->get_return_value(); rc < 0) {
d(1) << " update failure: " << cpp_strerror(rc) << dendl;
return rc;
}
if (allocated != new_allocated) {
/* we need to wait so we don't have dangling extents */
d(10) << "waiting for allocated update" << dendl;
- if (int rc = aiocp->wait_for_complete(); rc < 0) {
+ aiocp->wait_for_complete();
+ if (int rc = aiocp->get_return_value(); rc < 0) {
d(1) << " update failure: " << cpp_strerror(rc) << dendl;
return rc;
}
r = 0;
for (auto& [bl, aiocp] : reads) {
- if (int rc = aiocp->wait_for_complete(); rc < 0) {
+ aiocp->wait_for_complete();
+ if (int rc = aiocp->get_return_value(); rc < 0) {
d(1) << " read failure: " << cpp_strerror(rc) << dendl;
return rc;
}