IOContext *ioc = static_cast<IOContext*>(aio[i]->priv);
Mutex::Locker l(ioc->lock);
--ioc->num_running;
- dout(10) << __func__ << " finished aio " << aio[i] << " ioc " << ioc
+ int r = aio[i]->get_return_value();
+ dout(10) << __func__ << " finished aio " << aio[i] << " r " << r
+ << " ioc " << ioc
<< " with " << ioc->num_running << " aios left" << dendl;
+ assert(r >= 0);
_aio_finish(ioc, aio[i]->offset, aio[i]->length);
if (ioc->num_running == 0) {
ioc->running_bl.clear();
int fd;
vector<iovec> iov;
uint64_t offset, length;
+ int rval;
- aio_t(void *p, int f) : priv(p), fd(f) {
+ aio_t(void *p, int f) : priv(p), fd(f), rval(-1000) {
memset(&iocb, 0, sizeof(iocb));
}
for (unsigned u=0; u<iov.size(); ++u)
length += iov[u].iov_len;
}
+
+ int get_return_value() {
+ return rval;
+ }
};
struct aio_queue_t {
}
for (int i=0; i<r; ++i) {
paio[i] = (aio_t *)event[i].obj;
+ paio[i]->rval = event[i].res;
}
return r;
}