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 #ifndef _INCLUDED_RBD_REPLAY_PENDINGIO_HPP
16 #define _INCLUDED_RBD_REPLAY_PENDINGIO_HPP
18 #include <boost/enable_shared_from_this.hpp>
19 #include "actions.hpp"
21 /// Do not call outside of rbd_replay::PendingIO.
23 void rbd_replay_pending_io_callback(librbd::completion_t cb, void *arg);
25 namespace rbd_replay {
28 A PendingIO is an I/O operation that has been started but not completed.
30 class PendingIO : public boost::enable_shared_from_this<PendingIO> {
32 typedef boost::shared_ptr<PendingIO> ptr;
34 PendingIO(action_id_t id,
39 action_id_t id() const {
43 ceph::bufferlist &bufferlist() {
47 librbd::RBD::AioCompletion &completion() {
52 void completed(librbd::completion_t cb);
54 friend void ::rbd_replay_pending_io_callback(librbd::completion_t cb, void *arg);
56 const action_id_t m_id;
57 ceph::bufferlist m_bl;
58 librbd::RBD::AioCompletion *m_completion;