mirror of
https://github.com/ceph/ceph
synced 2025-01-31 07:22:56 +00:00
librbd: Add interface to let user can get private data from comp
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
This commit is contained in:
parent
e7a1506b30
commit
1ab727d194
@ -479,6 +479,7 @@ CEPH_RBD_API int rbd_aio_create_completion(void *cb_arg,
|
||||
CEPH_RBD_API int rbd_aio_is_complete(rbd_completion_t c);
|
||||
CEPH_RBD_API int rbd_aio_wait_for_complete(rbd_completion_t c);
|
||||
CEPH_RBD_API ssize_t rbd_aio_get_return_value(rbd_completion_t c);
|
||||
CEPH_RBD_API void *rbd_aio_get_arg(rbd_completion_t c);
|
||||
CEPH_RBD_API void rbd_aio_release(rbd_completion_t c);
|
||||
CEPH_RBD_API int rbd_flush(rbd_image_t image);
|
||||
/**
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
bool is_complete();
|
||||
int wait_for_complete();
|
||||
ssize_t get_return_value();
|
||||
void *get_arg();
|
||||
void release();
|
||||
};
|
||||
|
||||
|
@ -157,6 +157,10 @@ namespace librbd {
|
||||
Mutex::Locker l(lock);
|
||||
event_notify = true;
|
||||
}
|
||||
|
||||
void *get_arg() {
|
||||
return complete_arg;
|
||||
}
|
||||
};
|
||||
|
||||
class C_AioRequest : public Context {
|
||||
|
@ -304,6 +304,12 @@ namespace librbd {
|
||||
return c->get_return_value();
|
||||
}
|
||||
|
||||
void *RBD::AioCompletion::get_arg()
|
||||
{
|
||||
librbd::AioCompletion *c = (librbd::AioCompletion *)pc;
|
||||
return c->get_arg();
|
||||
}
|
||||
|
||||
void RBD::AioCompletion::release()
|
||||
{
|
||||
librbd::AioCompletion *c = (librbd::AioCompletion *)pc;
|
||||
@ -2252,6 +2258,12 @@ extern "C" ssize_t rbd_aio_get_return_value(rbd_completion_t c)
|
||||
return comp->get_return_value();
|
||||
}
|
||||
|
||||
extern "C" void *rbd_aio_get_arg(rbd_completion_t c)
|
||||
{
|
||||
librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
|
||||
return comp->get_arg();
|
||||
}
|
||||
|
||||
extern "C" void rbd_aio_release(rbd_completion_t c)
|
||||
{
|
||||
librbd::RBD::AioCompletion *comp = (librbd::RBD::AioCompletion *)c;
|
||||
|
Loading…
Reference in New Issue
Block a user