#include "common/Cond.h"
#include "common/Mutex.h"
+#include "common/ceph_time.h"
#include "include/Context.h"
#include "include/utime.h"
#include "include/rbd/librbd.hpp"
int ref;
bool released;
ImageCtx *ictx;
- utime_t start_time;
+ coarse_mono_time start_time;
aio_type_t aio_type;
ReadResult read_result;
AsyncOperation async_op;
- uint64_t journal_tid;
xlist<AioCompletion*>::item m_xlist_item;
bool event_notify;
}
template <typename T, void (T::*MF)(int) = &T::complete>
- static AioCompletion *create_and_start(T *obj, ImageCtx *image_ctx,
- aio_type_t type) {
+ static AioCompletion *create(T *obj, ImageCtx *image_ctx, aio_type_t type) {
AioCompletion *comp = create<T, MF>(obj);
comp->init_time(image_ctx, type);
+ return comp;
+ }
+
+ template <typename T, void (T::*MF)(int) = &T::complete>
+ static AioCompletion *create_and_start(T *obj, ImageCtx *image_ctx,
+ aio_type_t type) {
+ AioCompletion *comp = create<T, MF>(obj, image_ctx, type);
comp->start_op();
return comp;
}
complete_arg(NULL), rbd_comp(NULL),
pending_count(0), blockers(1),
ref(1), released(false), ictx(NULL),
- aio_type(AIO_TYPE_NONE),
- journal_tid(0), m_xlist_item(this), event_notify(false) {
+ aio_type(AIO_TYPE_NONE), m_xlist_item(this),
+ event_notify(false) {
}
~AioCompletion() {
void set_request_count(uint32_t num);
void add_request() {
lock.Lock();
- assert(pending_count > 0);
+ ceph_assert(pending_count > 0);
lock.Unlock();
get();
}
void complete_request(ssize_t r);
- void associate_journal_event(uint64_t tid);
-
bool is_complete();
ssize_t get_return_value();
void get() {
lock.Lock();
- assert(ref > 0);
+ ceph_assert(ref > 0);
ref++;
lock.Unlock();
}
void release() {
lock.Lock();
- assert(!released);
+ ceph_assert(!released);
released = true;
put_unlock();
}
put_unlock();
}
void put_unlock() {
- assert(ref > 0);
+ ceph_assert(ref > 0);
int n = --ref;
lock.Unlock();
if (!n) {
}
void unblock() {
Mutex::Locker l(lock);
- assert(blockers > 0);
+ ceph_assert(blockers > 0);
--blockers;
if (pending_count == 0 && blockers == 0) {
finalize(rval);