1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2014 Adam Crume <adamcrume@gmail.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #include "PendingIO.hpp"
16 #include "rbd_replay_debug.hpp"
18 #define dout_context g_ceph_context
20 using namespace rbd_replay
;
23 void rbd_replay_pending_io_callback(librbd::completion_t cb
, void *arg
) {
24 PendingIO
*io
= static_cast<PendingIO
*>(arg
);
28 PendingIO::PendingIO(action_id_t id
,
31 m_completion(new librbd::RBD::AioCompletion(this, rbd_replay_pending_io_callback
)),
35 PendingIO::~PendingIO() {
36 m_completion
->release();
39 void PendingIO::completed(librbd::completion_t cb
) {
40 dout(ACTION_LEVEL
) << "Completed pending IO #" << m_id
<< dendl
;
41 ssize_t r
= m_completion
->get_return_value();
42 assertf(r
>= 0, "id = %d, r = %d", m_id
, r
);
43 m_worker
.remove_pending(shared_from_this());